Commit 4df29625 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'remove-ff-issue-links-flag' into 'master'

Remove feature_flag_issue_links Feature Flag

See merge request gitlab-org/gitlab!42762
parents f52610b6 d52af43c
- @gfm_form = Feature.enabled?(:feature_flags_issue_links, @project, default_enabled: true)
- @gfm_form = true
- add_to_breadcrumbs s_('FeatureFlags|Feature Flags'), project_feature_flags_path(@project)
- breadcrumb_title @feature_flag.name
......
......@@ -352,32 +352,8 @@ end
## Feature Flag Related Issues **(PREMIUM)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36617) in GitLab 13.2.
> - It's deployed behind a feature flag, enabled by default.
> - It's enabled on GitLab.com.
> - It can't be enabled or disabled per-project
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to disable it.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36617) in GitLab 13.2.
You can link related issues to a feature flag. In the **Linked issues** section, click the `+` button and input the issue reference number or the full URL of the issue.
This feature is similar to the [related issues](../user/project/issues/related_issues.md) feature.
### Enable or disable Feature Flag Related Issues **(CORE ONLY)**
Feature Flag Related Issues is under development but 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 opt to disable it for your instance.
To disable it:
```ruby
Feature.disable(:feature_flags_issue_links)
```
To enable it:
```ruby
Feature.enable(:feature_flags_issue_links)
```
......@@ -4,7 +4,6 @@ module Projects
class FeatureFlagIssuesController < Projects::ApplicationController
include IssuableLinks
before_action :ensure_feature_enabled!
before_action :authorize_admin_feature_flags_issue_links!
private
......@@ -28,9 +27,5 @@ module Projects
def feature_flag
project.operations_feature_flags.find_by_iid(params[:feature_flag_iid])
end
def ensure_feature_enabled!
render_404 unless Feature.enabled?(:feature_flags_issue_links, project, default_enabled: true)
end
end
end
......@@ -12,7 +12,7 @@ module FeatureFlagsHelper
end
def feature_flag_issues_links_endpoint(project, feature_flag, user)
return '' unless Feature.enabled?(:feature_flags_issue_links, project, default_enabled: true) && can?(user, :admin_feature_flags_issue_links, project)
return '' unless can?(user, :admin_feature_flags_issue_links, project)
project_feature_flag_issues_path(project, feature_flag)
end
......
---
name: feature_flags_issue_links
introduced_by_url:
rollout_issue_url:
group:
type: development
default_enabled: true
......@@ -162,16 +162,6 @@ RSpec.describe Projects::FeatureFlagIssuesController do
expect(json_response.map { |issue| issue['id'] }).to eq([issue_b.id])
end
it 'returns not found when the feature is off' do
stub_feature_flags(feature_flags_issue_links: false)
feature_flag, _, _ = setup
sign_in(developer)
get_request(project, feature_flag)
expect(response).to have_gitlab_http_status(:not_found)
end
context 'when feature flag related issues feature is unlicensed' do
before do
stub_licensed_features(feature_flags_related_issues: false)
......
......@@ -60,19 +60,6 @@ RSpec.describe 'Feature flag issue links', :js do
end
end
context 'when the feature is disabled' do
before do
stub_feature_flags(feature_flags_issue_links: false)
end
it 'does not show the related issues widget' do
visit(edit_project_feature_flag_path(project, feature_flag))
expect(page).to have_text 'Strategies'
expect(page).not_to have_selector '#related-issues'
end
end
context 'when the feature is unlicensed' do
before do
stub_licensed_features(feature_flags_related_issues: false)
......
......@@ -22,12 +22,6 @@ RSpec.describe FeatureFlagsHelper do
describe '#feature_flag_issues_links_endpoint' do
subject { helper.feature_flag_issues_links_endpoint(project, feature_flag, user) }
it 'returns an empty string when the feature flag is disabled' do
stub_feature_flags(feature_flags_issue_links: false)
is_expected.to be_empty
end
it 'returns an empty string when the user is not allowed' do
allow(helper).to receive(:can?).with(user, :admin_feature_flags_issue_links, project).and_return(false)
......
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