summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-08-10 14:18:22 +0100
committerDylan Griffith <dyl.griffith@gmail.com>2018-08-16 16:33:45 +0100
commitff44d3f9b37301304bba5ff4fee97cadaa91e4f6 (patch)
treebd9cab0d68b4e2646d03ee684385d411430a3d60
parent76f8e25d9469b7af125e8109c1d5dbccb7353410 (diff)
downloadgitlab-ce-41729-enable-auto-devops-instance-wide-for-everyone.tar.gz
Remove all feature flag logic for Project#auto_devops_enabled41729-enable-auto-devops-instance-wide-for-everyone
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.rb5
-rw-r--r--doc/topics/autodevops/index.md5
-rw-r--r--spec/models/project_spec.rb28
-rw-r--r--spec/spec_helper.rb7
4 files changed, 2 insertions, 43 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 94c1d60f071..373afd1429b 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
extend Gitlab::Cache::RequestCache
extend Gitlab::ConfigHelper
@@ -528,11 +527,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 ec20cf4af72..cb43d62b96e 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -234,11 +234,6 @@ all the projects that haven't explicitly set an option will have Auto DevOps
enabled by default. From version 10.3 onwards this setting will already be
enabled by default and you can disable it if you choose.
-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 d8a5e5f6869..7bcce20c15e 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -3259,11 +3259,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? }
@@ -3306,14 +3301,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
@@ -3362,11 +3349,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
@@ -3388,16 +3370,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 f4441a6b700..bd564cc60a6 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -111,13 +111,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