Commit 74ea508e authored by Imre Farkas's avatar Imre Farkas

Merge branch 'remove_jira_connect_app_feature_flag' into 'master'

Remove jira_connect_app feature flag

See merge request gitlab-org/gitlab!24818
parents e8f51a55 a4806fa0
...@@ -15,8 +15,6 @@ The following are required to install and test the app: ...@@ -15,8 +15,6 @@ The following are required to install and test the app:
or [ngrok](https://ngrok.com). These also take care of SSL for you because Jira or [ngrok](https://ngrok.com). These also take care of SSL for you because Jira
requires all connections to the app host to be over SSL. requires all connections to the app host to be over SSL.
> This feature is currently behind the `:jira_connect_app` feature flag
## Installing the app in Jira ## Installing the app in Jira
1. Enable Jira development mode to install apps that are not from the Atlassian Marketplace 1. Enable Jira development mode to install apps that are not from the Atlassian Marketplace
......
...@@ -5,17 +5,12 @@ class JiraConnect::ApplicationController < ApplicationController ...@@ -5,17 +5,12 @@ class JiraConnect::ApplicationController < ApplicationController
skip_before_action :authenticate_user! skip_before_action :authenticate_user!
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
before_action :check_feature_flag_enabled!
before_action :verify_atlassian_jwt! before_action :verify_atlassian_jwt!
attr_reader :current_jira_installation attr_reader :current_jira_installation
private private
def check_feature_flag_enabled!
render_404 unless Feature.enabled?(:jira_connect_app)
end
def verify_atlassian_jwt! def verify_atlassian_jwt!
return render_403 unless atlassian_jwt_valid? return render_403 unless atlassian_jwt_valid?
......
...@@ -748,6 +748,10 @@ module EE ...@@ -748,6 +748,10 @@ module EE
::Project.with_groups_level_repos_templates.exists?(id) ::Project.with_groups_level_repos_templates.exists?(id)
end end
def jira_subscription_exists?
feature_available?(:jira_dev_panel_integration) && JiraConnectSubscription.for_project(self).exists?
end
private private
def group_hooks def group_hooks
......
...@@ -11,7 +11,7 @@ module EE ...@@ -11,7 +11,7 @@ module EE
def branch_change_hooks def branch_change_hooks
super super
return unless jira_subscription_exists? return unless project.jira_subscription_exists?
branch_to_sync = branch_name if Atlassian::JiraIssueKeyExtractor.has_keys?(branch_name) branch_to_sync = branch_name if Atlassian::JiraIssueKeyExtractor.has_keys?(branch_name)
commits_to_sync = limited_commits.select { |commit| Atlassian::JiraIssueKeyExtractor.has_keys?(commit.safe_message) }.map(&:sha) commits_to_sync = limited_commits.select { |commit| Atlassian::JiraIssueKeyExtractor.has_keys?(commit.safe_message) }.map(&:sha)
...@@ -21,12 +21,6 @@ module EE ...@@ -21,12 +21,6 @@ module EE
end end
end end
def jira_subscription_exists?
::Feature.enabled?(:jira_connect_app) &&
project.feature_available?(:jira_dev_panel_integration) &&
JiraConnectSubscription.for_project(project).exists?
end
override :pipeline_options override :pipeline_options
def pipeline_options def pipeline_options
mirror_update = project.mirror? && mirror_update = project.mirror? &&
......
...@@ -9,7 +9,7 @@ module EE ...@@ -9,7 +9,7 @@ module EE
def execute_hooks(merge_request, action = 'open', old_rev: nil, old_associations: {}) def execute_hooks(merge_request, action = 'open', old_rev: nil, old_associations: {})
super super
return unless jira_subscription_exists? return unless project.jira_subscription_exists?
if Atlassian::JiraIssueKeyExtractor.has_keys?(merge_request.title, merge_request.description) if Atlassian::JiraIssueKeyExtractor.has_keys?(merge_request.title, merge_request.description)
JiraConnect::SyncMergeRequestWorker.perform_async(merge_request.id) JiraConnect::SyncMergeRequestWorker.perform_async(merge_request.id)
...@@ -20,12 +20,6 @@ module EE ...@@ -20,12 +20,6 @@ module EE
attr_accessor :blocking_merge_requests_params attr_accessor :blocking_merge_requests_params
def jira_subscription_exists?
::Feature.enabled?(:jira_connect_app) &&
project.feature_available?(:jira_dev_panel_integration) &&
JiraConnectSubscription.for_project(project).exists?
end
override :filter_params override :filter_params
def filter_params(merge_request) def filter_params(merge_request)
unless current_user.can?(:update_approvers, merge_request) unless current_user.can?(:update_approvers, merge_request)
......
---
title: Release Jira connect feature
merge_request: 24818
author:
type: added
...@@ -4,23 +4,6 @@ require 'spec_helper' ...@@ -4,23 +4,6 @@ require 'spec_helper'
describe JiraConnect::AppDescriptorController do describe JiraConnect::AppDescriptorController do
describe '#show' do describe '#show' do
context 'feature disabled' do
before do
stub_feature_flags(jira_connect_app: false)
end
it 'returns 404' do
get :show
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'feature enabled' do
before do
stub_feature_flags(jira_connect_app: true)
end
it 'returns JSON app descriptor' do it 'returns JSON app descriptor' do
get :show get :show
...@@ -34,5 +17,4 @@ describe JiraConnect::AppDescriptorController do ...@@ -34,5 +17,4 @@ describe JiraConnect::AppDescriptorController do
) )
end end
end end
end
end end
...@@ -3,33 +3,6 @@ ...@@ -3,33 +3,6 @@
require 'spec_helper' require 'spec_helper'
describe JiraConnect::EventsController do describe JiraConnect::EventsController do
context 'feature disabled' do
before do
stub_feature_flags(jira_connect_app: false)
end
describe '#installed' do
it 'returns 404' do
post :installed
expect(response).to have_gitlab_http_status(:not_found)
end
end
describe '#uninstalled' do
it 'returns 404' do
post :uninstalled
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
context 'feature enabled' do
before do
stub_feature_flags(jira_connect_app: true)
end
describe '#installed' do describe '#installed' do
subject do subject do
post :installed, params: { post :installed, params: {
...@@ -61,7 +34,6 @@ describe JiraConnect::EventsController do ...@@ -61,7 +34,6 @@ describe JiraConnect::EventsController do
expect(response).to have_gitlab_http_status(:unprocessable_entity) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
end end
end
describe '#uninstalled' do describe '#uninstalled' do
let!(:installation) { create(:jira_connect_installation) } let!(:installation) { create(:jira_connect_installation) }
......
...@@ -3,44 +3,7 @@ ...@@ -3,44 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe JiraConnect::SubscriptionsController do describe JiraConnect::SubscriptionsController do
context 'feature disabled' do let_it_be(:installation) { create(:jira_connect_installation) }
before do
stub_feature_flags(jira_connect_app: false)
end
describe '#index' do
it 'returns 404' do
get :index
expect(response).to have_gitlab_http_status(:not_found)
end
end
describe '#create' do
it '#create returns 404' do
post :create
expect(response).to have_gitlab_http_status(:not_found)
end
end
describe '#destroy' do
let(:subscription) { create(:jira_connect_subscription) }
it '#destroy returns 404' do
delete :destroy, params: { id: subscription.id }
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
context 'feature enabled' do
before do
stub_feature_flags(jira_connect_app: true)
end
let(:installation) { create(:jira_connect_installation) }
describe '#index' do describe '#index' do
before do before do
...@@ -163,5 +126,4 @@ describe JiraConnect::SubscriptionsController do ...@@ -163,5 +126,4 @@ describe JiraConnect::SubscriptionsController do
end end
end end
end end
end
end end
...@@ -3,10 +3,6 @@ ...@@ -3,10 +3,6 @@
require 'spec_helper' require 'spec_helper'
describe 'Subscriptions Content Security Policy' do describe 'Subscriptions Content Security Policy' do
before do
stub_feature_flags(jira_connect_app: true)
end
let(:installation) { create(:jira_connect_installation) } let(:installation) { create(:jira_connect_installation) }
let(:qsh) { Atlassian::Jwt.create_query_string_hash('https://gitlab.test/subscriptions', 'GET', 'https://gitlab.test') } let(:qsh) { Atlassian::Jwt.create_query_string_hash('https://gitlab.test/subscriptions', 'GET', 'https://gitlab.test') }
let(:jwt) { Atlassian::Jwt.encode({ iss: installation.client_key, qsh: qsh }, installation.shared_secret) } let(:jwt) { Atlassian::Jwt.encode({ iss: installation.client_key, qsh: qsh }, installation.shared_secret) }
......
...@@ -2640,4 +2640,22 @@ describe Project do ...@@ -2640,4 +2640,22 @@ describe Project do
end end
end end
end end
describe '#jira_subscription_exists?' do
subject { project.jira_subscription_exists? }
context 'jira connect subscription exists' do
let!(:jira_connect_subscription) { create(:jira_connect_subscription, namespace: project.namespace) }
it { is_expected.to eq(false) }
context 'dev panel integration is available' do
before do
stub_licensed_features(jira_dev_panel_integration: true)
end
it { is_expected.to eq(true) }
end
end
end
end end
...@@ -176,11 +176,6 @@ describe Git::BranchPushService do ...@@ -176,11 +176,6 @@ describe Git::BranchPushService do
end end
end end
context 'when feature is enabled' do
before do
stub_feature_flags(jira_connect_app: true)
end
context 'has Jira dev panel integration license' do context 'has Jira dev panel integration license' do
before do before do
stub_licensed_features(jira_dev_panel_integration: true) stub_licensed_features(jira_dev_panel_integration: true)
...@@ -226,13 +221,4 @@ describe Git::BranchPushService do ...@@ -226,13 +221,4 @@ describe Git::BranchPushService do
it_behaves_like 'does not enqueue Jira sync worker' it_behaves_like 'does not enqueue Jira sync worker'
end end
end end
context 'when feature is disabled' do
before do
stub_feature_flags(jira_connect_app: false)
end
it_behaves_like 'does not enqueue Jira sync worker'
end
end
end end
...@@ -35,11 +35,6 @@ describe MergeRequests::BaseService do ...@@ -35,11 +35,6 @@ describe MergeRequests::BaseService do
end end
end end
context 'when feature is enabled' do
before do
stub_feature_flags(jira_connect_app: true)
end
context 'has Jira dev panel integration license' do context 'has Jira dev panel integration license' do
before do before do
stub_licensed_features(jira_dev_panel_integration: true) stub_licensed_features(jira_dev_panel_integration: true)
...@@ -75,15 +70,6 @@ describe MergeRequests::BaseService do ...@@ -75,15 +70,6 @@ describe MergeRequests::BaseService do
end end
end end
context 'when feature is disabled' do
before do
stub_feature_flags(jira_connect_app: false)
end
it_behaves_like 'does not enqueue Jira sync worker'
end
end
describe '#filter_params' do describe '#filter_params' do
let(:params_filtering_service) { double(:params_filtering_service) } let(:params_filtering_service) { double(:params_filtering_service) }
......
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