-
-
Notifications
You must be signed in to change notification settings - Fork 14
Warn when fixing enhancements without changelog #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
517246b
bf4a75e
f2b60a9
e03480e
3946807
d52ecbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,27 @@ struct UserMessage | |
| } | ||
|
|
||
|
|
||
| void checkEnhancementChangelog(in ref PullRequest pr, ref UserMessage[] msgs, | ||
| in Issue[] bugzillaIssues, in IssueRef[] refs) | ||
| { | ||
| import dlangbot.utils : request, expectOK; | ||
| import vibe.stream.operations : readAllUTF8; | ||
|
|
||
| if (bugzillaIssues.any!(i => i.status.among("NEW", "ASSIGNED", "REOPENED") && | ||
| i.severity == "enhancement" && | ||
| refs.canFind!(r => r.id == i.id && r.fixed))) | ||
| { | ||
| auto diff = request(pr.diffURL).expectOK.bodyReader.readAllUTF8; | ||
| if (!diff.canFind("\n+++ b/changelog/")) | ||
| { | ||
| msgs ~= UserMessage(UserMessage.Type.Warning, | ||
| "Pull requests implementing enhancements should include a [full changelog entry](https://github.com/dlang/dmd/tree/master/changelog)." | ||
|
||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| Check bugzilla priority | ||
| - enhancement -> changelog entry | ||
|
|
@@ -50,6 +71,7 @@ UserMessage[] checkForWarnings(in PullRequest pr, in Issue[] bugzillaIssues, in | |
| { | ||
| UserMessage[] msgs; | ||
| pr.checkBugzilla(msgs, bugzillaIssues, refs); | ||
| pr.checkEnhancementChangelog(msgs, bugzillaIssues, refs); | ||
| return msgs; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use
in refpleaseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using the same signature as the method below.