Commit 3187239c authored by Michael Kozono's avatar Michael Kozono

Merge branch '329853-rename-approval-gates-feature-flag' into 'master'

Rename ff_compliance_approval_gates to ff_external_status_checks

See merge request gitlab-org/gitlab!64286
parents 659926f6 416f87c8
......@@ -161,18 +161,18 @@ To enable it:
```ruby
# For the instance
Feature.enable(:ff_compliance_approval_gates)
Feature.enable(:ff_external_status_checks)
# For a single project
Feature.enable(:ff_compliance_approval_gates, Project.find(<project id>))
Feature.enable(:ff_external_status_checks, Project.find(<project id>))
```
To disable it:
```ruby
# For the instance
Feature.disable(:ff_compliance_approval_gates)
Feature.disable(:ff_external_status_checks)
# For a single project
Feature.disable(:ff_compliance_approval_gates, Project.find(<project id>))
Feature.disable(:ff_external_status_checks, Project.find(<project id>))
```
## Related links
......
......@@ -160,18 +160,18 @@ To enable it:
```ruby
# For the instance
Feature.enable(:ff_compliance_approval_gates)
Feature.enable(:ff_external_status_checks)
# For a single project
Feature.enable(:ff_compliance_approval_gates, Project.find(<project id>))
Feature.enable(:ff_external_status_checks, Project.find(<project id>))
```
To disable it:
```ruby
# For the instance
Feature.disable(:ff_compliance_approval_gates)
Feature.disable(:ff_external_status_checks)
# For a single project
Feature.disable(:ff_compliance_approval_gates, Project.find(<project id>)
Feature.disable(:ff_external_status_checks, Project.find(<project id>)
```
## Related links
......
......@@ -141,7 +141,7 @@ class License < ApplicationRecord
api_fuzzing
auto_rollback
cilium_alerts
compliance_approval_gates
external_status_checks
container_scanning
coverage_fuzzing
credentials_inventory
......
......@@ -69,7 +69,7 @@ module EE
private
def expose_mr_status_checks?
::Feature.enabled?(:ff_compliance_approval_gates, project, default_enabled: :yaml) &&
::Feature.enabled?(:ff_external_status_checks, project, default_enabled: :yaml) &&
current_user.present? &&
project.external_status_checks.any?
end
......
......@@ -8,7 +8,7 @@
= render_ce 'projects/merge_request_merge_checks_settings', project: @project, form: form
- if ::Feature.enabled?(:ff_compliance_approval_gates, @project, default_enabled: :yaml)
- if ::Feature.enabled?(:ff_external_status_checks, @project, default_enabled: :yaml)
= render_if_exists 'projects/merge_request_status_checks_settings'
= render 'projects/merge_request_merge_suggestions_settings', project: @project, form: form
......
---
name: ff_compliance_approval_gates
name: ff_external_status_checks
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54002
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/320783
milestone: '13.10'
milestone: '14.1'
type: development
group: group::compliance
default_enabled: false
......@@ -13,8 +13,8 @@ module API
helpers do
def check_feature_enabled!
unauthorized! unless user_project.licensed_feature_available?(:compliance_approval_gates) &&
Feature.enabled?(:ff_compliance_approval_gates, user_project)
unauthorized! unless user_project.licensed_feature_available?(:external_status_checks) &&
Feature.enabled?(:ff_external_status_checks, user_project)
end
end
......@@ -22,7 +22,7 @@ module API
segment ':id/external_status_checks' do
desc 'Create a new external status check' do
success ::API::Entities::ExternalStatusCheck
detail 'This feature is gated by the :ff_compliance_approval_gates feature flag.'
detail 'This feature is gated by the :ff_external_status_checks feature flag.'
end
params do
requires :name, type: String, desc: 'The name of the external status check'
......@@ -46,7 +46,7 @@ module API
end
end
desc 'List project\'s external approval rules' do
detail 'This feature is gated by the :ff_compliance_approval_gates feature flag.'
detail 'This feature is gated by the :ff_external_status_checks feature flag.'
end
params do
use :pagination
......@@ -60,7 +60,7 @@ module API
segment ':check_id' do
desc 'Update an external approval rule' do
success ::API::Entities::ExternalStatusCheck
detail 'This feature is gated by the :ff_compliance_approval_gates feature flag.'
detail 'This feature is gated by the :ff_external_status_checks feature flag.'
end
params do
requires :check_id, type: Integer, desc: 'The ID of the external status check'
......@@ -86,7 +86,7 @@ module API
end
desc 'Delete an external status check' do
detail 'This feature is gated by the :ff_compliance_approval_gates feature flag.'
detail 'This feature is gated by the :ff_external_status_checks feature flag.'
end
params do
requires :check_id, type: Integer, desc: 'The ID of the status check'
......@@ -106,7 +106,7 @@ module API
segment ':id/merge_requests/:merge_request_iid' do
desc 'Externally approve a merge request' do
detail 'This feature was introduced in 13.12 and is gated behind the :ff_compliance_approval_gates feature flag.'
detail 'This feature was introduced in 13.12 and is gated behind the :ff_external_status_checks feature flag.'
success Entities::MergeRequests::StatusCheckResponse
end
params do
......@@ -116,7 +116,7 @@ module API
requires :sha, type: String, desc: 'The current SHA at HEAD of the merge request.'
end
post 'status_check_responses' do
not_found! unless ::Feature.enabled?(:ff_compliance_approval_gates, user_project)
not_found! unless ::Feature.enabled?(:ff_external_status_checks, user_project)
merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request)
......@@ -128,10 +128,10 @@ module API
end
desc 'List all status checks for a merge request and their state.' do
detail 'This feature was introduced in 13.12 and is gated behind the :ff_compliance_approval_gates feature flag.'
detail 'This feature was introduced in 13.12 and is gated behind the :ff_external_status_checks feature flag.'
end
get 'status_checks' do
not_found! unless ::Feature.enabled?(:ff_compliance_approval_gates, user_project)
not_found! unless ::Feature.enabled?(:ff_external_status_checks, user_project)
merge_request = find_merge_request_with_access(params[:merge_request_iid], :approve_merge_request)
......
......@@ -18,7 +18,7 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
end
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
end
context 'user is authorized' do
......@@ -31,7 +31,7 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
context 'feature flag is enabled' do
before do
stub_feature_flags(ff_compliance_approval_gates: true)
stub_feature_flags(ff_external_status_checks: true)
end
it 'shows the widget' do
......@@ -55,7 +55,7 @@ RSpec.describe 'Merge request > User sees status checks widget', :js do
context 'feature flag is disabled' do
before do
stub_feature_flags(ff_compliance_approval_gates: false)
stub_feature_flags(ff_external_status_checks: false)
end
it_behaves_like 'no status checks widget'
......
......@@ -19,7 +19,7 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do
context 'Status checks' do
context 'Feature is not available' do
before do
stub_licensed_features(compliance_approval_gates: false)
stub_licensed_features(external_status_checks: false)
end
it 'does not render the status checks area' do
......@@ -29,7 +29,7 @@ RSpec.describe 'Project settings > [EE] Merge Requests', :js do
context 'Feature is available' do
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
end
it 'adds a status check' do
......
......@@ -200,7 +200,7 @@ RSpec.describe MergeRequestPresenter do
let(:path) { exposes_path? ? expose_path("/api/v4/projects/#{merge_request.project.id}/merge_requests/#{merge_request.iid}/status_checks") : nil }
before do
stub_feature_flags(ff_compliance_approval_gates: feature_flag_enabled?)
stub_feature_flags(ff_external_status_checks: feature_flag_enabled?)
allow(project.external_status_checks).to receive(:any?).and_return(has_status_checks?)
end
......
......@@ -21,7 +21,7 @@ RSpec.describe API::StatusChecks do
describe 'permissions' do
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
end
it { expect { subject }.to be_allowed_for(:maintainer).of(project) }
......@@ -34,7 +34,7 @@ RSpec.describe API::StatusChecks do
context 'feature flag is disabled' do
before do
stub_feature_flags(ff_compliance_approval_gates: false)
stub_feature_flags(ff_external_status_checks: false)
end
it 'returns a not found error' do
......@@ -46,7 +46,7 @@ RSpec.describe API::StatusChecks do
context 'when current_user has access' do
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
project.add_user(project_maintainer, :maintainer)
end
......@@ -83,7 +83,7 @@ RSpec.describe API::StatusChecks do
context 'feature flag is disabled' do
before do
stub_feature_flags(ff_compliance_approval_gates: false)
stub_feature_flags(ff_external_status_checks: false)
end
it 'returns a not found error' do
......@@ -95,7 +95,7 @@ RSpec.describe API::StatusChecks do
context 'when user has access' do
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
project.add_user(project_maintainer, :maintainer)
end
......@@ -143,7 +143,7 @@ RSpec.describe API::StatusChecks do
describe 'DELETE projects/:id/external_status_checks/:check_id' do
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
end
it 'deletes the specified rule' do
......@@ -166,8 +166,8 @@ RSpec.describe API::StatusChecks do
with_them do
before do
stub_feature_flags(ff_compliance_approval_gates: flag)
stub_licensed_features(compliance_approval_gates: licensed)
stub_feature_flags(ff_external_status_checks: flag)
stub_licensed_features(external_status_checks: licensed)
end
it 'returns the correct status code' do
......@@ -182,8 +182,8 @@ RSpec.describe API::StatusChecks do
describe 'POST projects/:id/external_status_checks' do
context 'successfully creating new external approval rule' do
before do
stub_feature_flags(ff_compliance_approval_gates: true)
stub_licensed_features(compliance_approval_gates: true)
stub_feature_flags(ff_external_status_checks: true)
stub_licensed_features(external_status_checks: true)
end
subject do
......@@ -242,8 +242,8 @@ RSpec.describe API::StatusChecks do
with_them do
before do
stub_feature_flags(ff_compliance_approval_gates: flag)
stub_licensed_features(compliance_approval_gates: licensed)
stub_feature_flags(ff_external_status_checks: flag)
stub_licensed_features(external_status_checks: licensed)
end
it 'returns the correct status code' do
......@@ -263,7 +263,7 @@ RSpec.describe API::StatusChecks do
end
before do
stub_licensed_features(compliance_approval_gates: true)
stub_licensed_features(external_status_checks: true)
end
it 'responds with expected JSON', :aggregate_failures do
......@@ -293,8 +293,8 @@ RSpec.describe API::StatusChecks do
with_them do
before do
stub_feature_flags(ff_compliance_approval_gates: flag)
stub_licensed_features(compliance_approval_gates: licensed)
stub_feature_flags(ff_external_status_checks: flag)
stub_licensed_features(external_status_checks: licensed)
end
it 'returns the correct status code' do
......@@ -311,8 +311,8 @@ RSpec.describe API::StatusChecks do
context 'successfully updating external approval rule' do
before do
stub_feature_flags(ff_compliance_approval_gates: true)
stub_licensed_features(compliance_approval_gates: true)
stub_feature_flags(ff_external_status_checks: true)
stub_licensed_features(external_status_checks: true)
end
subject do
......@@ -375,8 +375,8 @@ RSpec.describe API::StatusChecks do
with_them do
before do
stub_feature_flags(ff_compliance_approval_gates: flag)
stub_licensed_features(compliance_approval_gates: licensed)
stub_feature_flags(ff_external_status_checks: flag)
stub_licensed_features(external_status_checks: licensed)
end
it 'returns the correct status code' do
......
......@@ -18,7 +18,7 @@ RSpec.describe 'projects/edit' do
context 'status checks' do
context 'feature enabled' do
before do
stub_feature_flags(ff_compliance_approval_gates: true)
stub_feature_flags(ff_external_status_checks: true)
render
end
......@@ -30,7 +30,7 @@ RSpec.describe 'projects/edit' do
context 'feature disabled' do
before do
stub_feature_flags(ff_compliance_approval_gates: false)
stub_feature_flags(ff_external_status_checks: false)
render
end
......
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