diff --git a/app/models/project_authorization.rb b/app/models/project_authorization.rb index 3161bdaacd8dd59af24b2a4684a4dbfb87ed9f6b..c328e7d37c86c69a858bde78d83087d58c81b7e0 100644 --- a/app/models/project_authorization.rb +++ b/app/models/project_authorization.rb @@ -34,7 +34,7 @@ def self.insert_all(attributes) private def assign_is_unique - self.is_unique = true if Feature.enabled?(:write_project_authorizations_is_unique) + self.is_unique = true end end diff --git a/app/models/project_authorizations/changes.rb b/app/models/project_authorizations/changes.rb index d0175b4662d4f0cee4bf3eed325b2a68d344f1ff..1f0cec1a50cb07d2201700e9c2052bb403821ea7 100644 --- a/app/models/project_authorizations/changes.rb +++ b/app/models/project_authorizations/changes.rb @@ -89,10 +89,8 @@ def insert_all_in_batches(attributes) add_delay = add_delay_between_batches?(entire_size: attributes.size, batch_size: BATCH_SIZE) log_details(entire_size: attributes.size, batch_size: BATCH_SIZE) if add_delay - write_is_unique = Feature.enabled?(:write_project_authorizations_is_unique) - attributes.each_slice(BATCH_SIZE) do |attributes_batch| - attributes_batch.each { |attrs| attrs[:is_unique] = true } if write_is_unique + attributes_batch.each { |attrs| attrs[:is_unique] = true } ProjectAuthorization.insert_all(attributes_batch) perform_delay if add_delay diff --git a/config/feature_flags/development/write_project_authorizations_is_unique.yml b/config/feature_flags/development/write_project_authorizations_is_unique.yml deleted file mode 100644 index 7dc735eb5a629c982f42fc7514092dc0388dac55..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/write_project_authorizations_is_unique.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: write_project_authorizations_is_unique -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130299 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/424097 -milestone: '16.4' -type: development -group: group::security policies -default_enabled: false diff --git a/spec/models/project_authorization_spec.rb b/spec/models/project_authorization_spec.rb index 84c3c8abdb0efd292fd05a6c6ae44d2790c3d9db..9fed05342aaf2b4e78aafa576cc6db2211c5c910 100644 --- a/spec/models/project_authorization_spec.rb +++ b/spec/models/project_authorization_spec.rb @@ -18,16 +18,6 @@ it 'sets is_unique' do expect { project_auth.save! }.to change { project_auth.is_unique }.to(true) end - - context 'with feature disabled' do - before do - stub_feature_flags(write_project_authorizations_is_unique: false) - end - - it 'does not set is_unique' do - expect { project_auth.save! }.not_to change { project_auth.is_unique }.from(nil) - end - end end describe 'unique user, project authorizations' do diff --git a/spec/models/project_authorizations/changes_spec.rb b/spec/models/project_authorizations/changes_spec.rb index 84d7e0788cfc85ca20e7559a6b4d9932d0a33590..5f4dd963fb33ab88917ecb097543aa89aff5d022 100644 --- a/spec/models/project_authorizations/changes_spec.rb +++ b/spec/models/project_authorizations/changes_spec.rb @@ -110,18 +110,6 @@ expect(user.project_authorizations.pluck(:is_unique)).to all(be(true)) end - context 'with feature disabled' do - before do - stub_feature_flags(write_project_authorizations_is_unique: false) - end - - it 'does not write is_unique' do - apply_project_authorization_changes - - expect(user.project_authorizations.pluck(:is_unique)).to all(be(nil)) - end - end - it_behaves_like 'logs the detail', batch_size: 2 it_behaves_like 'publishes AuthorizationsChangedEvent'