Commit 22e313e6 authored by Fabio Pitino's avatar Fabio Pitino

Merge branch 'remove-ff-for-fixed-pipelines' into 'master'

Remove fixed pipeline notification FF

See merge request gitlab-org/gitlab!37694
parents 847b346f 37a3f263
......@@ -120,8 +120,4 @@ module NotificationsHelper
def can_read_project?(project)
can?(current_user, :read_project, project)
end
def notification_event_disabled?(event)
event == :fixed_pipeline && !Gitlab::Ci::Features.pipeline_fixed_notifications?
end
end
......@@ -1084,8 +1084,6 @@ module Ci
end
def ensure_ci_ref!
return unless Gitlab::Ci::Features.pipeline_fixed_notifications?
self.ci_ref = Ci::Ref.ensure_for(self)
end
......
......@@ -47,8 +47,6 @@ module Ci
end
def update_status_by!(pipeline)
return unless Gitlab::Ci::Features.pipeline_fixed_notifications?
retry_lock(self) do
next unless last_finished_pipeline_id == pipeline.id
......
......@@ -23,7 +23,6 @@
#{ paragraph.html_safe }
.col-lg-8
- notification_setting.email_events.each_with_index do |event, index|
- next if notification_event_disabled?(event)
- field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]"
.form-group
.form-check{ class: ("gl-mt-0" if index == 0) }
......
......@@ -187,7 +187,7 @@ To minimize the number of notifications that do not require any action, from [Gi
| Remove milestone merge request | Subscribers, participants mentioned, and Custom notification level with this event selected |
| New comment | The above, plus anyone mentioned by `@username` in the comment, with notification level "Mention" or higher |
| Failed pipeline | The author of the pipeline |
| Fixed pipeline | The author of the pipeline. Enabled by default. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24309) in GitLab 13.1. Administrators can disable this notification option using the `ci_pipeline_fixed_notifications` [feature flag](../../administration/feature_flags.md). |
| Fixed pipeline | The author of the pipeline. Enabled by default. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24309) in GitLab 13.1. |
| Successful pipeline | The author of the pipeline, if they have the custom notification setting for successful pipelines set. If the pipeline failed previously, a `Fixed pipeline` message will be sent for the first successful pipeline after the failure, then a `Successful pipeline` message for any further successful pipelines. |
| New epic **(ULTIMATE)** | |
| Close epic **(ULTIMATE)** | |
......
......@@ -14,10 +14,6 @@ module Gitlab
::Feature.enabled?(:ci_job_heartbeats_runner, project, default_enabled: true)
end
def self.pipeline_fixed_notifications?
::Feature.enabled?(:ci_pipeline_fixed_notifications, default_enabled: true)
end
def self.instance_variables_ui_enabled?
::Feature.enabled?(:ci_instance_variables_ui, default_enabled: true)
end
......
......@@ -67,20 +67,6 @@ RSpec.describe 'Projects > Show > User manages notifications', :js do
end
end
end
context 'when ci_pipeline_fixed_notifications is disabled' do
before do
stub_feature_flags(ci_pipeline_fixed_notifications: false)
end
it 'hides fixed_pipeline checkbox' do
visit project_path(project)
click_notifications_button
page.find('a[data-notification-level="custom"]').click
expect(page).not_to have_selector("input[name='notification_setting[fixed_pipeline]']")
end
end
end
context 'when project emails are disabled' do
......
......@@ -2918,25 +2918,9 @@ RSpec.describe Ci::Pipeline, :mailer do
describe '#ensure_ci_ref!' do
subject { pipeline.ensure_ci_ref! }
shared_examples_for 'protected by feature flag' do
context 'when feature flag is disabled' do
before do
stub_feature_flags(ci_pipeline_fixed_notifications: false)
end
it 'does not do anything' do
expect(Ci::Ref).not_to receive(:ensure_for)
subject
end
end
end
context 'when ci_ref does not exist yet' do
let!(:pipeline) { create(:ci_pipeline, ci_ref_presence: false) }
it_behaves_like 'protected by feature flag'
it 'creates a new ci_ref and assigns it' do
expect { subject }.to change { Ci::Ref.count }.by(1)
......@@ -2947,8 +2931,6 @@ RSpec.describe Ci::Pipeline, :mailer do
context 'when ci_ref already exists' do
let!(:pipeline) { create(:ci_pipeline) }
it_behaves_like 'protected by feature flag'
it 'fetches a new ci_ref and assigns it' do
expect { subject }.not_to change { Ci::Ref.count }
......
......@@ -161,16 +161,6 @@ RSpec.describe Ci::Ref do
it_behaves_like 'no-op'
end
context 'when feature flag is disabled' do
let(:pipeline) { create(:ci_pipeline, :success, ci_ref: ci_ref) }
before do
stub_feature_flags(ci_pipeline_fixed_notifications: false)
end
it_behaves_like 'no-op'
end
context 'when pipeline is not the latest pipeline' do
let!(:pipeline) { create(:ci_pipeline, :success, ci_ref: ci_ref) }
let!(:latest_pipeline) { create(:ci_pipeline, :success, ci_ref: ci_ref) }
......
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