Commit 416f87c8 authored by Max Woolf's avatar Max Woolf Committed by Michael Kozono

Rename ff_compliance_approval_gates to ff_external_status_checks

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