diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-08-10 14:18:22 +0100 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-09-07 13:36:06 +0100 |
commit | c429c18974fe41a4b8417ce32cfa4213dc28a333 (patch) | |
tree | 8b3371f36ab99b8f2df260abd1e4b401f47f09d8 | |
parent | 535e6e91d483e664b46517fe59e73c57a43ee104 (diff) | |
download | gitlab-ce-50193-remove-feature-flag-for-force_autodevops_on_by_default.tar.gz |
Remove all feature flag logic for Project#auto_devops_enabled50193-remove-feature-flag-for-force_autodevops_on_by_default
This is since we now enable it for everyone using the instance wide setting in the database we do not need this anymore
-rw-r--r-- | app/models/project.rb | 5 | ||||
-rw-r--r-- | doc/topics/autodevops/index.md | 5 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 28 | ||||
-rw-r--r-- | spec/spec_helper.rb | 7 |
4 files changed, 2 insertions, 43 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 997c1cf98fc..a7330381aca 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -27,7 +27,6 @@ class Project < ActiveRecord::Base include FastDestroyAll::Helpers include WithUploads include BatchDestroyDependentAssociations - include FeatureGate include OptionallySearch extend Gitlab::Cache::RequestCache @@ -549,11 +548,11 @@ class Project < ActiveRecord::Base def has_auto_devops_implicitly_enabled? auto_devops&.enabled.nil? && - (Gitlab::CurrentSettings.auto_devops_enabled? || Feature.enabled?(:force_autodevops_on_by_default, self)) + Gitlab::CurrentSettings.auto_devops_enabled? end def has_auto_devops_implicitly_disabled? - auto_devops&.enabled.nil? && !(Gitlab::CurrentSettings.auto_devops_enabled? || Feature.enabled?(:force_autodevops_on_by_default, self)) + auto_devops&.enabled.nil? && !Gitlab::CurrentSettings.auto_devops_enabled? end def empty_repo? diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md index c0268ce136c..9b9f11c0e2f 100644 --- a/doc/topics/autodevops/index.md +++ b/doc/topics/autodevops/index.md @@ -233,11 +233,6 @@ in **Admin Area > Settings > Continuous Integration and Deployment**. Doing that all the projects that haven't explicitly set an option will have Auto DevOps enabled by default. -NOTE: **Note:** -There is also a feature flag to enable Auto DevOps to a percentage of projects -which can be enabled from the console with -`Feature.get(:force_autodevops_on_by_default).enable_percentage_of_actors(10)`. - ### Deployment strategy > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/38542) in GitLab 11.0. diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 264632dba4b..bf249e77fd2 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3307,11 +3307,6 @@ describe Project do end describe '#auto_devops_enabled?' do - before do - allow(Feature).to receive(:enabled?).and_call_original - Feature.get(:force_autodevops_on_by_default).enable_percentage_of_actors(0) - end - set(:project) { create(:project) } subject { project.auto_devops_enabled? } @@ -3354,14 +3349,6 @@ describe Project do it { is_expected.to be_truthy } end - - context 'when force_autodevops_on_by_default is enabled for the project' do - before do - Feature.get(:force_autodevops_on_by_default).enable_percentage_of_actors(100) - end - - it { is_expected.to be_truthy } - end end end @@ -3410,11 +3397,6 @@ describe Project do end describe '#has_auto_devops_implicitly_disabled?' do - before do - allow(Feature).to receive(:enabled?).and_call_original - Feature.get(:force_autodevops_on_by_default).enable_percentage_of_actors(0) - end - set(:project) { create(:project) } context 'when enabled in settings' do @@ -3436,16 +3418,6 @@ describe Project do expect(project).to have_auto_devops_implicitly_disabled end - context 'when force_autodevops_on_by_default is enabled for the project' do - before do - Feature.get(:force_autodevops_on_by_default).enable_percentage_of_actors(100) - end - - it 'does not have auto devops implicitly disabled' do - expect(project).not_to have_auto_devops_implicitly_disabled - end - end - context 'when explicitly disabled' do before do create(:project_auto_devops, project: project, enabled: false) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c4bb1c13f2e..1e0bb229812 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -113,13 +113,6 @@ RSpec.configure do |config| config.before(:example) do # Enable all features by default for testing allow(Feature).to receive(:enabled?) { true } - - # The following can be removed when we remove the staged rollout strategy - # and we can just enable it using instance wide settings - # (ie. ApplicationSetting#auto_devops_enabled) - allow(Feature).to receive(:enabled?) - .with(:force_autodevops_on_by_default, anything) - .and_return(false) end config.before(:example, :request_store) do |