Commit baec7677 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '212985-remove-ff-check-for-synthetic-milestone-notes-creation' into 'master'

Remove check for enabled feature flag on milestone notes builder

Closes #212985

See merge request gitlab-org/gitlab!28440
parents 72cd61d6 c4f16ac6
......@@ -10,8 +10,6 @@ module ResourceEvents
private
def synthetic_notes
return [] unless tracking_enabled?
milestone_change_events.map do |event|
MilestoneNote.from_event(event, resource: resource, resource_parent: resource_parent)
end
......@@ -23,9 +21,5 @@ module ResourceEvents
events = resource.resource_milestone_events.includes(user: :status) # rubocop: disable CodeReuse/ActiveRecord
since_fetch_at(events)
end
def tracking_enabled?
::Feature.enabled?(:track_resource_milestone_change_events, resource.project)
end
end
end
---
title: Fix missing synthetic milestone change notes for disabled milestone change event tracking feature flag
merge_request: 28440
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe ResourceEvents::SyntheticMilestoneNotesBuilderService do
describe '#execute' do
let_it_be(:user) { create(:user) }
let_it_be(:issue) { create(:issue, author: user) }
before do
create_list(:resource_milestone_event, 3, issue: issue)
stub_feature_flags(track_resource_milestone_change_events: false)
end
context 'when resource milestone events are disabled' do
# https://gitlab.com/gitlab-org/gitlab/-/issues/212985
it 'still builds notes for existing resource milestone events' do
notes = described_class.new(issue, user).execute
expect(notes.size).to eq(3)
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