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
5d62db25
Commit
5d62db25
authored
May 04, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix changelog Dangerfile to convert MR IID to a string before comparison
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
0d038abc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
changelogs/unreleased/fix-danger-changelog-bug.yml
changelogs/unreleased/fix-danger-changelog-bug.yml
+5
-0
danger/changelog/Dangerfile
danger/changelog/Dangerfile
+4
-3
No files found.
changelogs/unreleased/fix-danger-changelog-bug.yml
0 → 100644
View file @
5d62db25
---
title
:
Fix changelog Dangerfile to convert MR IID to a string before comparison
merge_request
:
60899
author
:
type
:
fixed
danger/changelog/Dangerfile
View file @
5d62db25
...
...
@@ -38,16 +38,17 @@ end
def
check_changelog_yaml
(
path
)
raw_file
=
File
.
read
(
path
)
yaml
=
YAML
.
safe_load
(
raw_file
)
yaml_merge_request
=
yaml
[
"merge_request"
].
to_s
fail
"`title` should be set, in
#{
helper
.
html_link
(
path
)
}
!
#{
SEE_DOC
}
"
if
yaml
[
"title"
].
nil?
fail
"`type` should be set, in
#{
helper
.
html_link
(
path
)
}
!
#{
SEE_DOC
}
"
if
yaml
[
"type"
].
nil?
return
if
helper
.
security_mr?
return
if
helper
.
mr_iid
.
to_s
.
empty?
return
if
helper
.
mr_iid
.
empty?
cherry_pick_against_stable_branch
=
helper
.
cherry_pick_mr?
&&
helper
.
stable_branch?
if
yaml
[
"merge_request"
].
nil
?
if
yaml
_merge_request
.
empty
?
mr_line
=
raw_file
.
lines
.
find_index
(
"merge_request:
\n
"
)
if
mr_line
...
...
@@ -55,7 +56,7 @@ def check_changelog_yaml(path)
else
message
"Consider setting `merge_request` to
#{
helper
.
mr_iid
}
in
#{
helper
.
html_link
(
path
)
}
.
#{
SEE_DOC
}
"
end
elsif
yaml
[
"merge_request"
]
!=
helper
.
mr_iid
&&
!
cherry_pick_against_stable_branch
elsif
yaml
_merge_request
!=
helper
.
mr_iid
&&
!
cherry_pick_against_stable_branch
fail
"Merge request ID was not set to
#{
helper
.
mr_iid
}
!
#{
SEE_DOC
}
"
end
rescue
Psych
::
Exception
...
...
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