Commit 4a8401cf authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'remove-deployment-feature-flags' into 'master'

Remove deployment feature flags

See merge request gitlab-org/gitlab!22624
parents c8563a11 45bfb5be
......@@ -221,11 +221,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
def ci_environments_status
environments =
if ci_environments_status_on_merge_result?
if Feature.enabled?(:deployment_merge_requests_widget, @project)
EnvironmentStatus.for_deployed_merge_request(@merge_request, current_user)
else
EnvironmentStatus.after_merge_request(@merge_request, current_user)
end
else
EnvironmentStatus.for_merge_request(@merge_request, current_user)
end
......
......@@ -10,17 +10,9 @@ module Deployments
def perform(deployment_id)
if (deploy = Deployment.find_by_id(deployment_id))
link_merge_requests(deploy)
LinkMergeRequestsService.new(deploy).execute
deploy.execute_hooks
end
end
def link_merge_requests(deployment)
unless Feature.enabled?(:deployment_merge_requests, deployment.project)
return
end
LinkMergeRequestsService.new(deployment).execute
end
end
end
---
title: Track deployed merge requests using GitLab environments and deployments
merge_request:
author:
type: added
......@@ -1289,19 +1289,6 @@ describe Projects::MergeRequestsController do
get_ci_environments_status(environment_target: 'merge_commit')
end
context 'when the deployment_merge_requests_widget feature flag is disabled' do
it 'uses the deployments retrieved using CI builds' do
stub_feature_flags(deployment_merge_requests_widget: false)
expect(EnvironmentStatus)
.to receive(:after_merge_request)
.with(merge_request, user)
.and_call_original
get_ci_environments_status(environment_target: 'merge_commit')
end
end
def get_ci_environments_status(extra_params = {})
params = {
namespace_id: merge_request.project.namespace.to_param,
......
......@@ -49,17 +49,5 @@ describe Deployments::FinishedWorker do
expect(ProjectServiceWorker).not_to have_received(:perform_async)
end
context 'when the tracking of merge requests is disabled' do
it 'does not track the deployed merge requests' do
stub_feature_flags(deployment_merge_requests: false)
deployment = create(:deployment)
expect(Deployments::LinkMergeRequestsService).not_to receive(:new)
worker.perform(deployment.id)
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