Commit 22523d27 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch '333556-remove-feature-flag' into 'master'

Cleanup group_devops_adoption feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!64498
parents e51c2761 0783e298
---
name: group_devops_adoption
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55039
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323159
milestone: '13.10'
type: development
group: group::optimize
default_enabled: true
...@@ -7,14 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -7,14 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Group DevOps Adoption **(ULTIMATE)** # Group DevOps Adoption **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/321083) in GitLab 13.11 as a [Beta feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#beta). > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/321083) in GitLab 13.11 as a [Beta feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#beta).
> - [Deployed behind a feature flag](../../../user/feature_flags.md), disabled by default. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/333556) in GitLab 14.1.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/323159) in GitLab 13.12.
> - Enabled on GitLab.com.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-group-devops-adoption). **(ULTIMATE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
Prerequisites: Prerequisites:
...@@ -64,12 +57,6 @@ Each group appears as a separate row in the table. ...@@ -64,12 +57,6 @@ Each group appears as a separate row in the table.
For each row, a feature is considered "adopted" if it has been used in a project in the given group For each row, a feature is considered "adopted" if it has been used in a project in the given group
during the time period (including projects in any sub-groups of the given group). during the time period (including projects in any sub-groups of the given group).
You should expect adoption to be lower at the beginning of the month,
before you have had an opportunity to use all the features listed in the table.
In the future [we plan to implement](https://gitlab.com/gitlab-org/gitlab/-/issues/329708)
a rolling 30-day perspective instead.
## When is a feature considered adopted ## When is a feature considered adopted
A feature is considered "adopted" if it has been used anywhere in the group in the specified time. A feature is considered "adopted" if it has been used anywhere in the group in the specified time.
...@@ -104,22 +91,3 @@ the data. ...@@ -104,22 +91,3 @@ the data.
Please note that the sub-group data might not appear immediately, Please note that the sub-group data might not appear immediately,
because GitLab requires a few moments to collect the data. because GitLab requires a few moments to collect the data.
Generally the data will be visible in less than one minute. Generally the data will be visible in less than one minute.
## Enable or disable Group DevOps Adoption **(ULTIMATE SELF)**
Group DevOps Adoption is under development and not ready for production use. It is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can disable it.
To disable it:
```ruby
Feature.disable(:group_devops_adoption)
```
To re-enable it:
```ruby
Feature.enable(:group_devops_adoption)
```
...@@ -42,7 +42,6 @@ module EE ...@@ -42,7 +42,6 @@ module EE
end end
condition(:group_devops_adoption_enabled) do condition(:group_devops_adoption_enabled) do
::Feature.enabled?(:group_devops_adoption, @subject, default_enabled: :yaml) &&
::License.feature_available?(:group_level_devops_adoption) ::License.feature_available?(:group_level_devops_adoption)
end end
......
...@@ -1566,19 +1566,10 @@ RSpec.describe GroupPolicy do ...@@ -1566,19 +1566,10 @@ RSpec.describe GroupPolicy do
let(:current_user) { owner } let(:current_user) { owner }
let(:policy) { :view_group_devops_adoption } let(:policy) { :view_group_devops_adoption }
context 'when feature is disabled' do
before do
stub_feature_flags(group_devops_adoption: false)
end
it { is_expected.to be_disallowed(policy) }
end
context 'when license does not include the feature' do context 'when license does not include the feature' do
let(:current_user) { admin } let(:current_user) { admin }
before do before do
stub_feature_flags(group_devops_adoption: true)
stub_licensed_features(group_level_devops_adoption: false) stub_licensed_features(group_level_devops_adoption: false)
enable_admin_mode!(current_user) enable_admin_mode!(current_user)
end end
...@@ -1586,7 +1577,7 @@ RSpec.describe GroupPolicy do ...@@ -1586,7 +1577,7 @@ RSpec.describe GroupPolicy do
it { is_expected.to be_disallowed(policy) } it { is_expected.to be_disallowed(policy) }
end end
context 'when feature is enabled and license includes the feature' do context 'when license includes the feature' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:role, :allowed) do where(:role, :allowed) do
...@@ -1600,7 +1591,6 @@ RSpec.describe GroupPolicy do ...@@ -1600,7 +1591,6 @@ RSpec.describe GroupPolicy do
end end
before do before do
stub_feature_flags(group_devops_adoption: true)
stub_licensed_features(group_level_devops_adoption: true) stub_licensed_features(group_level_devops_adoption: true)
enable_admin_mode!(current_user) if current_user.admin? enable_admin_mode!(current_user) if current_user.admin?
end end
...@@ -1617,19 +1607,10 @@ RSpec.describe GroupPolicy do ...@@ -1617,19 +1607,10 @@ RSpec.describe GroupPolicy do
let(:current_user) { owner } let(:current_user) { owner }
let(:policy) { :manage_devops_adoption_namespaces } let(:policy) { :manage_devops_adoption_namespaces }
context 'when feature is disabled' do
before do
stub_feature_flags(group_devops_adoption: false)
end
it { is_expected.to be_disallowed(policy) }
end
context 'when license does not include the feature' do context 'when license does not include the feature' do
let(:current_user) { admin } let(:current_user) { admin }
before do before do
stub_feature_flags(group_devops_adoption: true)
stub_licensed_features(group_level_devops_adoption: false) stub_licensed_features(group_level_devops_adoption: false)
enable_admin_mode!(current_user) enable_admin_mode!(current_user)
end end
...@@ -1637,60 +1618,54 @@ RSpec.describe GroupPolicy do ...@@ -1637,60 +1618,54 @@ RSpec.describe GroupPolicy do
it { is_expected.to be_disallowed(policy) } it { is_expected.to be_disallowed(policy) }
end end
context 'when feature is enabled' do context 'when license includes the feature' do
before do using RSpec::Parameterized::TableSyntax
stub_feature_flags(group_devops_adoption: true)
end
context 'when license includes the feature' do
using RSpec::Parameterized::TableSyntax
where(:role, :allowed) do where(:role, :allowed) do
:admin | true :admin | true
:owner | true :owner | true
:maintainer | true :maintainer | true
:developer | true :developer | true
:reporter | true :reporter | true
:guest | false :guest | false
:non_group_member | false :non_group_member | false
end end
before do before do
stub_licensed_features(group_level_devops_adoption: true) stub_licensed_features(group_level_devops_adoption: true)
enable_admin_mode!(current_user) if current_user.admin? enable_admin_mode!(current_user) if current_user.admin?
end end
with_them do with_them do
let(:current_user) { public_send(role) } let(:current_user) { public_send(role) }
it { is_expected.to(allowed ? be_allowed(policy) : be_disallowed(policy)) } it { is_expected.to(allowed ? be_allowed(policy) : be_disallowed(policy)) }
end
end end
end
context 'when license plan does not include the feature' do context 'when license plan does not include the feature' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:role, :allowed) do where(:role, :allowed) do
:admin | true :admin | true
:owner | false :owner | false
:maintainer | false :maintainer | false
:developer | false :developer | false
:reporter | false :reporter | false
:guest | false :guest | false
:non_group_member | false :non_group_member | false
end end
before do before do
stub_licensed_features(group_level_devops_adoption: true) stub_licensed_features(group_level_devops_adoption: true)
allow(group).to receive(:feature_available?).with(:group_level_devops_adoption).and_return(false) allow(group).to receive(:feature_available?).with(:group_level_devops_adoption).and_return(false)
enable_admin_mode!(current_user) if current_user.admin? enable_admin_mode!(current_user) if current_user.admin?
end end
with_them do with_them do
let(:current_user) { public_send(role) } let(:current_user) { public_send(role) }
it { is_expected.to(allowed ? be_allowed(policy) : be_disallowed(policy)) } it { is_expected.to(allowed ? be_allowed(policy) : be_disallowed(policy)) }
end
end end
end end
end end
......
...@@ -10,7 +10,6 @@ RSpec.describe Groups::Analytics::DevopsAdoptionController do ...@@ -10,7 +10,6 @@ RSpec.describe Groups::Analytics::DevopsAdoptionController do
sign_in(current_user) sign_in(current_user)
stub_licensed_features(group_level_devops_adoption: true) stub_licensed_features(group_level_devops_adoption: true)
stub_feature_flags(group_devops_adoption: true)
end end
describe 'GET show' do describe 'GET show' do
...@@ -28,18 +27,6 @@ RSpec.describe Groups::Analytics::DevopsAdoptionController do ...@@ -28,18 +27,6 @@ RSpec.describe Groups::Analytics::DevopsAdoptionController do
expect(response).to render_template :show expect(response).to render_template :show
end end
context 'when the feature flag is false' do
before do
stub_feature_flags(group_devops_adoption: false)
end
it 'renders forbidden' do
subject
expect(response).to have_gitlab_http_status(:forbidden)
end
end
context 'when the feature is not available' do context 'when the feature is not available' do
before do before do
stub_licensed_features(group_level_devops_adoption: false) stub_licensed_features(group_level_devops_adoption: false)
......
...@@ -95,21 +95,9 @@ RSpec.describe 'layouts/nav/sidebar/_group' do ...@@ -95,21 +95,9 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
expect(rendered).to have_text 'DevOps Adoption' expect(rendered).to have_text 'DevOps Adoption'
end end
context 'feature flag is disabled' do
before do
stub_feature_flags(group_devops_adoption: false)
end
it 'is not visible' do
render
expect(rendered).not_to have_text 'DevOps Adoption'
end
end
end end
context 'DevOps apoption feature is not available' do context 'DevOps adoption feature is not available' do
before do before do
stub_licensed_features(group_level_devops_adoption: false) stub_licensed_features(group_level_devops_adoption: false)
end end
...@@ -119,18 +107,6 @@ RSpec.describe 'layouts/nav/sidebar/_group' do ...@@ -119,18 +107,6 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
expect(rendered).not_to have_text 'DevOps Adoption' expect(rendered).not_to have_text 'DevOps Adoption'
end end
context 'feature flag is disabled' do
before do
stub_feature_flags(group_devops_adoption: false)
end
it 'is not visible' do
render
expect(rendered).not_to have_text 'DevOps Adoption'
end
end
end end
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