Commit 684bc404 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 1a3fc882 43abcf93
...@@ -154,7 +154,6 @@ Rails/SaveBang: ...@@ -154,7 +154,6 @@ Rails/SaveBang:
- 'spec/controllers/boards/issues_controller_spec.rb' - 'spec/controllers/boards/issues_controller_spec.rb'
- 'spec/controllers/sent_notifications_controller_spec.rb' - 'spec/controllers/sent_notifications_controller_spec.rb'
- 'spec/controllers/sessions_controller_spec.rb' - 'spec/controllers/sessions_controller_spec.rb'
- 'spec/factories_spec.rb'
- 'spec/frontend/fixtures/issues.rb' - 'spec/frontend/fixtures/issues.rb'
- 'spec/frontend/fixtures/merge_requests.rb' - 'spec/frontend/fixtures/merge_requests.rb'
- 'spec/graphql/mutations/merge_requests/set_locked_spec.rb' - 'spec/graphql/mutations/merge_requests/set_locked_spec.rb'
......
---
title: Fix Rails/SaveBang rubocop offenses in spec/factories_spec.rb
merge_request: 58102
author: Abdul Wadood @abdulwd
type: fixed
...@@ -114,3 +114,41 @@ class Pipeline < ApplicationRecord ...@@ -114,3 +114,41 @@ class Pipeline < ApplicationRecord
} }
end end
``` ```
## Add new values in the gap
After merging some EE and FOSS enums, there might be a gap between the two groups of values:
```ruby
module Enums
module Ci
module CommitStatus
def self.failure_reasons
{
# ...
data_integrity_failure: 12,
forward_deployment_failure: 13,
insufficient_bridge_permissions: 1_001,
downstream_bridge_project_not_found: 1_002,
# ...
}
end
end
end
end
```
To add new values, you should fill the gap first.
In the example above add `14` instead of `1_003`:
```ruby
{
# ...
data_integrity_failure: 12,
forward_deployment_failure: 13,
a_new_value: 14,
insufficient_bridge_permissions: 1_001,
downstream_bridge_project_not_found: 1_002,
# ...
}
```
...@@ -49,6 +49,26 @@ For one customer, the auditor found that having Code Quality, SAST, and Containe ...@@ -49,6 +49,26 @@ For one customer, the auditor found that having Code Quality, SAST, and Containe
See also the Code Climate list of [Supported Languages for Maintainability](https://docs.codeclimate.com/docs/supported-languages-for-maintainability). See also the Code Climate list of [Supported Languages for Maintainability](https://docs.codeclimate.com/docs/supported-languages-for-maintainability).
## Code Quality in diff view **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/267612) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.11.
> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default.
Changes to files in merge requests can cause Code Quality to fall if merged. In these cases,
an indicator is displayed (**{information-o}** **Code Quality**) on the file in the merge request's diff view. For example:
![Code Quality MR diff report](img/code_quality_mr_diff_report_v13_11.png)
To enable this feature, a GitLab administrator can run the following in a
[Rails console](../../../administration/operations/rails_console.md):
```ruby
# For the instance
Feature.enable(:codequality_mr_diff)
# For a single project
Feature.enable(:codequality_mr_diff, Project.find(<project id>))
```
## Use cases ## Use cases
For instance, consider the following workflow: For instance, consider the following workflow:
......
...@@ -44,7 +44,7 @@ RSpec.describe 'factories' do ...@@ -44,7 +44,7 @@ RSpec.describe 'factories' do
end end
it 'does not raise error when created' do it 'does not raise error when created' do
expect { create(factory.name) }.not_to raise_error expect { create(factory.name) }.not_to raise_error # rubocop:disable Rails/SaveBang
end end
factory.definition.defined_traits.map(&:name).each do |trait_name| factory.definition.defined_traits.map(&:name).each do |trait_name|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment