Commit d06ecf1d authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ajk-294034-enable-jira-deployments' into 'master'

Remove jira_sync_deployments feature flag

See merge request gitlab-org/gitlab!51629
parents 320f7268 2d56dfe5
......@@ -112,7 +112,6 @@ class Deployment < ApplicationRecord
after_transition any => any - [:skipped] do |deployment, transition|
next if transition.loopback?
next unless Feature.enabled?(:jira_sync_deployments, deployment.project)
deployment.run_after_commit do
::JiraConnect::SyncDeploymentsWorker.perform_async(id)
......@@ -121,8 +120,6 @@ class Deployment < ApplicationRecord
end
after_create unless: :importing? do |deployment|
next unless Feature.enabled?(:jira_sync_deployments, deployment.project)
run_after_commit do
::JiraConnect::SyncDeploymentsWorker.perform_async(deployment.id)
end
......
......@@ -14,7 +14,6 @@ module JiraConnect
deployment = Deployment.find_by_id(deployment_id)
return unless deployment
return unless Feature.enabled?(:jira_sync_deployments, deployment.project)
::JiraConnect::SyncService
.new(deployment.project)
......
---
title: Send deployment information to Jira
merge_request: 51629
author:
type: added
---
name: jira_sync_deployments
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49757
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/294034
milestone: '13.7'
type: development
group: group::ecosystem
default_enabled: false
......@@ -57,8 +57,6 @@ module Atlassian
end
def store_deploy_info(project:, deployments:, **opts)
return unless Feature.enabled?(:jira_sync_deployments, project)
items = deployments.map { |d| ::Atlassian::JiraConnect::Serializers::DeploymentEntity.represent(d, opts) }
items.reject! { |d| d.issue_keys.empty? }
......
......@@ -238,22 +238,6 @@ RSpec.describe Atlassian::JiraConnect::Client do
expect(response['errorMessages']).to eq(%w(X Y Z))
end
end
it 'does not call the API if the feature flag is not enabled' do
stub_feature_flags(jira_sync_deployments: false)
expect(subject).not_to receive(:post)
subject.send(:store_deploy_info, project: project, deployments: deployments)
end
it 'does call the API if the feature flag enabled for the project' do
stub_feature_flags(jira_sync_deployments: project)
expect(subject).to receive(:post).with('/rest/deployments/0.1/bulk', { deployments: Array }).and_call_original
subject.send(:store_deploy_info, project: project, deployments: deployments)
end
end
describe '#store_ff_info' do
......
......@@ -254,26 +254,6 @@ RSpec.describe Deployment do
deployment.send(event)
end
context 'the feature is disabled' do
it 'does not trigger a worker' do
stub_feature_flags(jira_sync_deployments: false)
expect(worker).not_to receive(:perform_async)
deployment.send(event)
end
end
context 'the feature is enabled for this project' do
it 'does trigger a worker' do
stub_feature_flags(jira_sync_deployments: deployment.project)
expect(worker).to receive(:perform_async)
deployment.send(event)
end
end
end
end
end
......
......@@ -32,29 +32,5 @@ RSpec.describe ::JiraConnect::SyncDeploymentsWorker do
subject
end
end
context 'when the feature flag is disabled' do
before do
stub_feature_flags(jira_sync_deployments: false)
end
it 'does not call the sync service' do
expect_next(::JiraConnect::SyncService).not_to receive(:execute)
subject
end
end
context 'when the feature flag is enabled for this project' do
before do
stub_feature_flags(jira_sync_deployments: deployment.project)
end
it 'calls the sync service' do
expect_next(::JiraConnect::SyncService).to receive(:execute)
subject
end
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