Commit 0a084a0c authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '299832-feature-flag-enable-jira_issues_show_integration' into 'master'

Add integration to view Jira issue details within GitLab [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!56942
parents d89150d5 d86d45c6
---
title: Enable :jira_issues_show_integration feature flag by default
merge_request: 56182
author:
type: added
---
name: jira_issues_show_integration
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52446
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/299832
milestone: '13.9'
type: development
group: group::ecosystem
default_enabled: false
......@@ -261,14 +261,8 @@ Issues are grouped into tabs based on their [Jira status](https://confluence.atl
#### View a Jira issue
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299832) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.10.
> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [enable it](#enable-or-disable-jira-issue-detail-view). **(PREMIUM)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299832) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.10 behind a feature flag, disabled by default.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/299832) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.11.
When viewing the [Jira issues list](#view-jira-issues), select an issue from the
list to open it in GitLab:
......@@ -323,22 +317,3 @@ which may lead to a `401 unauthorized` error when testing your Jira integration.
If CAPTCHA has been triggered, you can't use Jira's REST API to
authenticate with the Jira site. You need to log in to your Jira instance
and complete the CAPTCHA.
## Enable or disable Jira issue detail view
Jira issue detail view is under development but ready for production use. It is
deployed behind a feature flag that is **disabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it.
To enable it:
```ruby
Feature.enable(:jira_issues_show_integration)
```
To disable it:
```ruby
Feature.disable(:jira_issues_show_integration)
```
......@@ -13,7 +13,6 @@ module Projects
name: 'i_ecosystem_jira_service_list_issues'
before_action :check_feature_enabled!
before_action :check_issues_show_enabled!, only: :show
rescue_from ::Projects::Integrations::Jira::IssuesFinder::IntegrationError, with: :render_integration_error
rescue_from ::Projects::Integrations::Jira::IssuesFinder::RequestError, with: :render_request_error
......@@ -96,10 +95,6 @@ module Projects
return render_404 unless project.jira_issues_integration_available? && project.jira_service.issues_enabled
end
def check_issues_show_enabled!
render_404 unless ::Feature.enabled?(:jira_issues_show_integration, @project, default_enabled: :yaml)
end
# Return the informational message to the user
def render_integration_error(exception)
log_exception(exception)
......
......@@ -59,9 +59,7 @@ module Integrations
end
expose :gitlab_web_url do |jira_issue|
if ::Feature.enabled?(:jira_issues_show_integration, project, default_enabled: :yaml)
project_integrations_jira_issue_path(project, jira_issue.key)
end
project_integrations_jira_issue_path(project, jira_issue.key)
end
expose :references do |jira_issue|
......
---
title: Add integration to view Jira issue details within GitLab
merge_request: 56942
author:
type: added
......@@ -184,9 +184,9 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do
end
describe 'GET #show' do
context 'when `jira_issues_show_integration` feature is disabled' do
context 'when jira_issues_integration licensed feature is not available' do
before do
stub_feature_flags(jira_issues_show_integration: false)
stub_licensed_features(jira_issues_integration: false)
end
it 'returns 404 status' do
......@@ -196,12 +196,12 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do
end
end
context 'when `jira_issues_show_integration` feature is enabled' do
context 'when jira_issues_integration licensed feature is available' do
let(:jira_issue) { { 'from' => 'jira' } }
let(:issue_json) { { 'from' => 'backend' } }
before do
stub_feature_flags(jira_issues_show_integration: true)
stub_licensed_features(jira_issues_integration: true)
expect_next_found_instance_of(JiraService) do |service|
expect(service).to receive(:find_issue).with('1', rendered_fields: true).and_return(jira_issue)
......
......@@ -124,14 +124,4 @@ RSpec.describe Integrations::Jira::IssueEntity do
expect(subject).to include(labels: [])
end
end
context 'when feature flag "jira_issues_show_integration" is disabled' do
before do
stub_feature_flags(jira_issues_show_integration: false)
end
it 'sets `gitlab_web_url` to nil' do
expect(subject[:gitlab_web_url]).to eq(nil)
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