Commit 2d56dfe5 authored by Alex Kalderimis's avatar Alex Kalderimis

Remove jira_sync_deployments feature flag

This enables the synchronization of deployment information with
JiraConnect.
parent 9ba5b578
...@@ -112,7 +112,6 @@ class Deployment < ApplicationRecord ...@@ -112,7 +112,6 @@ class Deployment < ApplicationRecord
after_transition any => any - [:skipped] do |deployment, transition| after_transition any => any - [:skipped] do |deployment, transition|
next if transition.loopback? next if transition.loopback?
next unless Feature.enabled?(:jira_sync_deployments, deployment.project)
deployment.run_after_commit do deployment.run_after_commit do
::JiraConnect::SyncDeploymentsWorker.perform_async(id) ::JiraConnect::SyncDeploymentsWorker.perform_async(id)
...@@ -121,8 +120,6 @@ class Deployment < ApplicationRecord ...@@ -121,8 +120,6 @@ class Deployment < ApplicationRecord
end end
after_create unless: :importing? do |deployment| after_create unless: :importing? do |deployment|
next unless Feature.enabled?(:jira_sync_deployments, deployment.project)
run_after_commit do run_after_commit do
::JiraConnect::SyncDeploymentsWorker.perform_async(deployment.id) ::JiraConnect::SyncDeploymentsWorker.perform_async(deployment.id)
end end
......
...@@ -14,7 +14,6 @@ module JiraConnect ...@@ -14,7 +14,6 @@ module JiraConnect
deployment = Deployment.find_by_id(deployment_id) deployment = Deployment.find_by_id(deployment_id)
return unless deployment return unless deployment
return unless Feature.enabled?(:jira_sync_deployments, deployment.project)
::JiraConnect::SyncService ::JiraConnect::SyncService
.new(deployment.project) .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 ...@@ -57,8 +57,6 @@ module Atlassian
end end
def store_deploy_info(project:, deployments:, **opts) 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 = deployments.map { |d| ::Atlassian::JiraConnect::Serializers::DeploymentEntity.represent(d, opts) }
items.reject! { |d| d.issue_keys.empty? } items.reject! { |d| d.issue_keys.empty? }
......
...@@ -238,22 +238,6 @@ RSpec.describe Atlassian::JiraConnect::Client do ...@@ -238,22 +238,6 @@ RSpec.describe Atlassian::JiraConnect::Client do
expect(response['errorMessages']).to eq(%w(X Y Z)) expect(response['errorMessages']).to eq(%w(X Y Z))
end end
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 end
describe '#store_ff_info' do describe '#store_ff_info' do
......
...@@ -254,26 +254,6 @@ RSpec.describe Deployment do ...@@ -254,26 +254,6 @@ RSpec.describe Deployment do
deployment.send(event) deployment.send(event)
end 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 end
end end
......
...@@ -32,29 +32,5 @@ RSpec.describe ::JiraConnect::SyncDeploymentsWorker do ...@@ -32,29 +32,5 @@ RSpec.describe ::JiraConnect::SyncDeploymentsWorker do
subject subject
end end
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
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