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:
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.
> This feature is currently behind the `:jira_connect_app` feature flag
## Installing the app in Jira
1. Enable Jira development mode to install apps that are not from the Atlassian Marketplace
......
......@@ -5,17 +5,12 @@ class JiraConnect::ApplicationController < ApplicationController
skip_before_action :authenticate_user!
skip_before_action :verify_authenticity_token
before_action :check_feature_flag_enabled!
before_action :verify_atlassian_jwt!
attr_reader :current_jira_installation
private
def check_feature_flag_enabled!
render_404 unless Feature.enabled?(:jira_connect_app)
end
def verify_atlassian_jwt!
return render_403 unless atlassian_jwt_valid?
......
......@@ -748,6 +748,10 @@ module EE
::Project.with_groups_level_repos_templates.exists?(id)
end
def jira_subscription_exists?
feature_available?(:jira_dev_panel_integration) && JiraConnectSubscription.for_project(self).exists?
end
private
def group_hooks
......
......@@ -11,7 +11,7 @@ module EE
def branch_change_hooks
super
return unless jira_subscription_exists?
return unless project.jira_subscription_exists?
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)
......@@ -21,12 +21,6 @@ module EE
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
def pipeline_options
mirror_update = project.mirror? &&
......
......@@ -9,7 +9,7 @@ module EE
def execute_hooks(merge_request, action = 'open', old_rev: nil, old_associations: {})
super
return unless jira_subscription_exists?
return unless project.jira_subscription_exists?
if Atlassian::JiraIssueKeyExtractor.has_keys?(merge_request.title, merge_request.description)
JiraConnect::SyncMergeRequestWorker.perform_async(merge_request.id)
......@@ -20,12 +20,6 @@ module EE
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
def filter_params(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'
describe JiraConnect::AppDescriptorController 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
get :show
......@@ -34,5 +17,4 @@ describe JiraConnect::AppDescriptorController do
)
end
end
end
end
......@@ -3,33 +3,6 @@
require 'spec_helper'
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
subject do
post :installed, params: {
......@@ -61,7 +34,6 @@ describe JiraConnect::EventsController do
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
end
end
describe '#uninstalled' do
let!(:installation) { create(:jira_connect_installation) }
......
......@@ -3,44 +3,7 @@
require 'spec_helper'
describe JiraConnect::SubscriptionsController do
context 'feature disabled' do
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) }
let_it_be(:installation) { create(:jira_connect_installation) }
describe '#index' do
before do
......@@ -163,5 +126,4 @@ describe JiraConnect::SubscriptionsController do
end
end
end
end
end
......@@ -3,10 +3,6 @@
require 'spec_helper'
describe 'Subscriptions Content Security Policy' do
before do
stub_feature_flags(jira_connect_app: true)
end
let(:installation) { create(:jira_connect_installation) }
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) }
......
......@@ -2640,4 +2640,22 @@ describe Project do
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
......@@ -176,11 +176,6 @@ describe Git::BranchPushService do
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
before do
stub_licensed_features(jira_dev_panel_integration: true)
......@@ -226,13 +221,4 @@ describe Git::BranchPushService do
it_behaves_like 'does not enqueue Jira sync worker'
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
......@@ -35,11 +35,6 @@ describe MergeRequests::BaseService do
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
before do
stub_licensed_features(jira_dev_panel_integration: true)
......@@ -75,15 +70,6 @@ describe MergeRequests::BaseService do
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
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