Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c4f16ac6
Commit
c4f16ac6
authored
Mar 31, 2020
by
Patrick Derichs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove check for enabled feature flag on milestone notes builder
parent
0d452261
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
app/services/resource_events/synthetic_milestone_notes_builder_service.rb
...ource_events/synthetic_milestone_notes_builder_service.rb
+0
-6
changelogs/unreleased/212985-remove-ff-check-for-synthetic-milestone-notes-creation.yml
...emove-ff-check-for-synthetic-milestone-notes-creation.yml
+5
-0
spec/services/resource_events/synthetic_milestone_notes_builder_service_spec.rb
..._events/synthetic_milestone_notes_builder_service_spec.rb
+25
-0
No files found.
app/services/resource_events/synthetic_milestone_notes_builder_service.rb
View file @
c4f16ac6
...
@@ -10,8 +10,6 @@ module ResourceEvents
...
@@ -10,8 +10,6 @@ module ResourceEvents
private
private
def
synthetic_notes
def
synthetic_notes
return
[]
unless
tracking_enabled?
milestone_change_events
.
map
do
|
event
|
milestone_change_events
.
map
do
|
event
|
MilestoneNote
.
from_event
(
event
,
resource:
resource
,
resource_parent:
resource_parent
)
MilestoneNote
.
from_event
(
event
,
resource:
resource
,
resource_parent:
resource_parent
)
end
end
...
@@ -23,9 +21,5 @@ module ResourceEvents
...
@@ -23,9 +21,5 @@ module ResourceEvents
events
=
resource
.
resource_milestone_events
.
includes
(
user: :status
)
# rubocop: disable CodeReuse/ActiveRecord
events
=
resource
.
resource_milestone_events
.
includes
(
user: :status
)
# rubocop: disable CodeReuse/ActiveRecord
since_fetch_at
(
events
)
since_fetch_at
(
events
)
end
end
def
tracking_enabled?
::
Feature
.
enabled?
(
:track_resource_milestone_change_events
,
resource
.
project
)
end
end
end
end
end
changelogs/unreleased/212985-remove-ff-check-for-synthetic-milestone-notes-creation.yml
0 → 100644
View file @
c4f16ac6
---
title
:
Fix missing synthetic milestone change notes for disabled milestone change event tracking feature flag
merge_request
:
28440
author
:
type
:
fixed
spec/services/resource_events/synthetic_milestone_notes_builder_service_spec.rb
0 → 100644
View file @
c4f16ac6
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment