Commit 77b0cc3f authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '335280-feature-flag-remove-jira_issue_association_on_merge_request' into 'master'

Remove `jira_issue_association_on_merge_request` feature flag

See merge request gitlab-org/gitlab!68036
parents 11f38168 a43f09ec
...@@ -47,12 +47,9 @@ You can [disable comments](#disable-comments-on-jira-issues) on issues. ...@@ -47,12 +47,9 @@ You can [disable comments](#disable-comments-on-jira-issues) on issues.
### Require associated Jira issue for merge requests to be merged **(ULTIMATE)** ### Require associated Jira issue for merge requests to be merged **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/280766) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.12 behind a feature flag, disabled by default. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/280766) in GitLab 13.12, disabled behind `jira_issue_association_on_merge_request` [feature flag](../../administration/feature_flags.md).
> - [Deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61722) in GitLab 14.1. > - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61722) in GitLab 14.1.
> - Enabled on GitLab.com. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/335280) in GitLab 14.2.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-the-ability-to-require-an-associated-jira-issue-on-merge-requests). **(ULTIMATE SELF)**
You can prevent merge requests from being merged if they do not refer to a Jira issue. You can prevent merge requests from being merged if they do not refer to a Jira issue.
To enforce this: To enforce this:
...@@ -181,22 +178,3 @@ adding a comment to the Jira issue: ...@@ -181,22 +178,3 @@ adding a comment to the Jira issue:
1. Refer to the [Configure GitLab](configure.md) instructions. 1. Refer to the [Configure GitLab](configure.md) instructions.
1. Clear the **Enable comments** checkbox. 1. Clear the **Enable comments** checkbox.
## Enable or disable the ability to require an associated Jira issue on merge requests
The ability to require an associated Jira issue on merge requests 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.
To enable it:
```ruby
Feature.enable(:jira_issue_association_on_merge_request)
```
To disable it:
```ruby
Feature.disable(:jira_issue_association_on_merge_request)
```
...@@ -231,7 +231,6 @@ module EE ...@@ -231,7 +231,6 @@ module EE
strong_memoize(:jira_issue_association_required_to_merge_enabled) do strong_memoize(:jira_issue_association_required_to_merge_enabled) do
next false unless jira_issues_integration_available? next false unless jira_issues_integration_available?
next false unless jira_integration&.active? next false unless jira_integration&.active?
next false unless ::Feature.enabled?(:jira_issue_association_on_merge_request, self, default_enabled: :yaml)
next false unless feature_available?(:jira_issue_association_enforcement) next false unless feature_available?(:jira_issue_association_enforcement)
true true
......
---
name: jira_issue_association_on_merge_request
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52896
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300271
milestone: '13.9'
type: development
group: group::compliance
default_enabled: true
...@@ -138,20 +138,18 @@ RSpec.describe Project do ...@@ -138,20 +138,18 @@ RSpec.describe Project do
) )
project.build_jira_integration(active: jira_integration_active) project.build_jira_integration(active: jira_integration_active)
stub_feature_flags(jira_issue_association_on_merge_request: feature_flag)
end end
where( where(
jira_integration_licensed: [true, false], jira_integration_licensed: [true, false],
jira_integration_active: [true, false], jira_integration_active: [true, false],
jira_enforcement_licensed: [true, false], jira_enforcement_licensed: [true, false]
feature_flag: [true, false]
) )
with_them do with_them do
it 'is enabled if all values are true' do it 'is enabled if all values are true' do
expect(project.jira_issue_association_required_to_merge_enabled?).to be( expect(project.jira_issue_association_required_to_merge_enabled?).to be(
jira_integration_licensed && jira_integration_active && jira_enforcement_licensed && feature_flag jira_integration_licensed && jira_integration_active && jira_enforcement_licensed
) )
end end
end end
......
...@@ -29,7 +29,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do ...@@ -29,7 +29,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
before do before do
stub_licensed_features(jira_issues_integration: true, jira_issue_association_enforcement: true) stub_licensed_features(jira_issues_integration: true, jira_issue_association_enforcement: true)
stub_feature_flags(jira_issue_association_on_merge_request: true)
end end
it { is_expected.to include(:jira_associations) } it { is_expected.to include(:jira_associations) }
...@@ -90,16 +89,11 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do ...@@ -90,16 +89,11 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
context 'when feature is NOT available' do context 'when feature is NOT available' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:licensed, :feature_flag) do where(licensed: [true, false])
false | true
true | false
false | false
end
with_them do with_them do
before do before do
stub_licensed_features(jira_issue_association_enforcement: licensed) stub_licensed_features(jira_issue_association_enforcement: licensed)
stub_feature_flags(jira_issue_association_on_merge_request: feature_flag)
end end
it { is_expected.not_to include(:jira_associations) } it { is_expected.not_to include(:jira_associations) }
......
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