-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Warn when fixing enhancements without changelog #274
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)." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, won't this trigger for other repos too ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As of #273 the list of refs for non-Bugzilla-using projects should be empty, which should match projects which use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see what you mean, well spotted. Fix pushed. |
||
); | ||
} | ||
} | ||
} | ||
|
||
|
||
/** | ||
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 ref
pleaseThere 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.