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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
9265e769
Commit
9265e769
authored
Jul 13, 2018
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the correct exceptions to look for invalid YAML in Changelogs
parent
924146a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
danger/changelog/Dangerfile
danger/changelog/Dangerfile
+4
-2
No files found.
danger/changelog/Dangerfile
View file @
9265e769
...
@@ -38,12 +38,14 @@ def check_changelog(path)
...
@@ -38,12 +38,14 @@ def check_changelog(path)
if
yaml
[
"merge_request"
].
nil?
if
yaml
[
"merge_request"
].
nil?
message
"Consider setting `merge_request` to
#{
gitlab
.
mr_json
[
"iid"
]
}
in
#{
gitlab
.
html_link
(
path
)
}
.
#{
SEE_DOC
}
"
message
"Consider setting `merge_request` to
#{
gitlab
.
mr_json
[
"iid"
]
}
in
#{
gitlab
.
html_link
(
path
)
}
.
#{
SEE_DOC
}
"
elsif
yaml
[
"merge_request"
]
!=
gitlab
.
mr_json
[
"iid"
]
&&
!
ce_port_changelog?
(
changelog_
path
)
elsif
yaml
[
"merge_request"
]
!=
gitlab
.
mr_json
[
"iid"
]
&&
!
ce_port_changelog?
(
path
)
fail
"Merge request ID was not set to
#{
gitlab
.
mr_json
[
"iid"
]
}
!
#{
SEE_DOC
}
"
fail
"Merge request ID was not set to
#{
gitlab
.
mr_json
[
"iid"
]
}
!
#{
SEE_DOC
}
"
end
end
rescue
StandardError
rescue
Psych
::
SyntaxError
,
Psych
::
DisallowedClass
,
Psych
::
BadAlias
# YAML could not be parsed, fail the build.
# YAML could not be parsed, fail the build.
fail
"
#{
gitlab
.
html_link
(
path
)
}
isn't valid YAML!
#{
SEE_DOC
}
"
fail
"
#{
gitlab
.
html_link
(
path
)
}
isn't valid YAML!
#{
SEE_DOC
}
"
rescue
StandardError
=>
e
warn
"There was a problem trying to check the Changelog. Exception:
#{
e
.
name
}
-
#{
e
.
message
}
"
end
end
def
presented_no_changelog_labels
def
presented_no_changelog_labels
...
...
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