@@ -20,21 +20,45 @@ import vibe.stream.operations : readAllUTF8;
2020// Github comments
2121// ==============================================================================
2222
23- string formatComment (R1 , R2 )( R1 refs, R2 descs)
23+ string formatComment (in ref PullRequest pr, in IssueRef[] refs, in Issue[] descs)
2424{
2525 import std.array : appender;
2626 import std.format : formattedWrite;
2727
28- auto combined = zip(refs.map! (r => r.id), refs.map! (r => r.fixed), descs.map! (d => d.desc));
2928 auto app = appender! string ();
30- app.put(" Fix | Bugzilla | Description\n " );
31- app.put(" --- | --- | ---\n " );
29+ app.formattedWrite(
30+ ` Thanks for your pull request, @%s! We are looking
31+ forward to reviewing it, and you should be hearing from
32+ a maintainer soon.
3233
33- foreach (num, closed, desc; combined)
34+ Some things that can help to speed things up:
35+
36+ - smaller, focused PRs are easier to review than big ones
37+
38+ - try not to mix up refactoring or style changes with bug
39+ fixes or feature enhancements
40+
41+ - provide helpful commit messages explaining the rationale
42+ behind each change
43+
44+ Bear in mind that large or tricky changes may require multiple
45+ rounds of review and revision.
46+
47+ Please see [CONTRIBUTING.md](https://github.com/%s/blob/master/CONTRIBUTING.md) for more information.
48+
49+ ` , pr.user.login, pr.repoSlug);
50+
51+ if (refs.length > 0 )
3452 {
35- app.formattedWrite(
36- " %1$s | [%2$s](%4$s/show_bug.cgi?id=%2$s) | %3$s\n " ,
37- closed ? " ✓" : " ✗" , num, desc, bugzillaURL);
53+ auto combined = zip(refs.map! (r => r.id), refs.map! (r => r.fixed), descs.map! (d => d.desc));
54+ app.put(" Fix | Bugzilla | Description\n " );
55+ app.put(" --- | --- | ---\n " );
56+ foreach (num, closed, desc; combined)
57+ {
58+ app.formattedWrite(
59+ " %1$s | [%2$s](%4$s/show_bug.cgi?id=%2$s) | %3$s\n " ,
60+ closed ? " ✓" : " ✗" , num, desc, bugzillaURL);
61+ }
3862 }
3963 return app.data;
4064}
@@ -97,14 +121,10 @@ auto ghSendRequest(T...)(HTTPMethod method, string url, T arg)
97121void updateGithubComment (in ref PullRequest pr, in ref GHComment comment, string action, IssueRef[] refs, Issue[] descs)
98122{
99123 logDebug(" %s" , refs);
100- if (refs.empty)
101- {
102- return comment.remove();
103- }
104124 logDebug(" %s" , descs);
105125 assert (refs.map! (r => r.id).equal(descs.map! (d => d.id)));
106126
107- auto msg = formatComment(refs, descs);
127+ auto msg = pr. formatComment(refs, descs);
108128 logDebug(" %s" , msg);
109129
110130 if (msg != comment.body_)
@@ -121,6 +141,12 @@ void updateGithubComment(in ref PullRequest pr, in ref GHComment comment, string
121141// Github Auto-merge
122142// ==============================================================================
123143
144+ static struct User
145+ {
146+ string login;
147+ }
148+
149+ User user;
124150alias LabelsAndCommits = Tuple ! (Json[], " labels" , Json[], " commits" );
125151enum MergeMethod { none = 0 , merge, squash, rebase }
126152
0 commit comments