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
892c6461
Commit
892c6461
authored
Nov 22, 2019
by
Lee Tickett
Committed by
Jan Provaznik
Nov 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore milestone_id from epics table 1/3
parent
5b30e143
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
5 deletions
+17
-5
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
app/models/epic.rb
app/models/epic.rb
+2
-0
app/services/issuable/clone/attributes_rewriter.rb
app/services/issuable/clone/attributes_rewriter.rb
+7
-1
changelogs/unreleased/remove_milestone_id_from_epics.yml
changelogs/unreleased/remove_milestone_id_from_epics.yml
+5
-0
config/pseudonymizer.yml
config/pseudonymizer.yml
+0
-1
ee/spec/services/ee/issuable/clone/attributes_rewriter_spec.rb
...ec/services/ee/issuable/clone/attributes_rewriter_spec.rb
+2
-2
No files found.
app/models/concerns/issuable.rb
View file @
892c6461
...
...
@@ -173,7 +173,7 @@ module Issuable
private
def
milestone_is_valid
errors
.
add
(
:milestone_id
,
message:
"is invalid"
)
if
milestone_id
.
present?
&&
!
milestone_available?
errors
.
add
(
:milestone_id
,
message:
"is invalid"
)
if
respond_to?
(
:milestone_id
)
&&
milestone_id
.
present?
&&
!
milestone_available?
end
def
description_max_length_for_new_records_is_valid
...
...
app/models/epic.rb
View file @
892c6461
...
...
@@ -3,6 +3,8 @@
# Placeholder class for model that is implemented in EE
# It reserves '&' as a reference prefix, but the table does not exists in CE
class
Epic
<
ApplicationRecord
self
.
ignored_columns
+=
%i[milestone_id]
def
self
.
link_reference_pattern
nil
end
...
...
app/services/issuable/clone/attributes_rewriter.rb
View file @
892c6461
...
...
@@ -10,7 +10,13 @@ module Issuable
end
def
execute
new_entity
.
update
(
milestone:
cloneable_milestone
,
labels:
cloneable_labels
)
update_attributes
=
{
labels:
cloneable_labels
}
milestone
=
cloneable_milestone
update_attributes
[
:milestone
]
=
milestone
if
milestone
.
present?
new_entity
.
update
(
update_attributes
)
copy_resource_label_events
end
...
...
changelogs/unreleased/remove_milestone_id_from_epics.yml
0 → 100644
View file @
892c6461
---
title
:
Remove milestone_id from epics
merge_request
:
20187
author
:
Lee Tickett
type
:
other
config/pseudonymizer.yml
View file @
892c6461
...
...
@@ -47,7 +47,6 @@ tables:
epics
:
whitelist
:
-
id
-
milestone_id
-
group_id
-
author_id
-
assignee_id
...
...
ee/spec/services/ee/issuable/clone/attributes_rewriter_spec.rb
View file @
892c6461
...
...
@@ -30,11 +30,11 @@ describe Issuable::Clone::AttributesRewriter do
end
context
'setting milestones'
do
it
'
sets milestone attribute as nil
'
do
it
'
ignores milestone attribute
'
do
milestone
=
create
(
:milestone
,
title:
'milestone'
,
group:
group
)
original_issue
.
update
(
milestone:
milestone
)
expect
(
new_epic
).
to
receive
(
:update
).
with
(
labels:
[]
,
milestone:
nil
)
expect
(
new_epic
).
to
receive
(
:update
).
with
(
labels:
[])
subject
.
execute
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