@@ -20,21 +20,45 @@ import vibe.stream.operations : readAllUTF8;
20
20
// Github comments
21
21
// ==============================================================================
22
22
23
- string formatComment (R1 , R2 )( R1 refs, R2 descs)
23
+ string formatComment (in ref PullRequest pr, in IssueRef[] refs, in Issue[] descs)
24
24
{
25
25
import std.array : appender;
26
26
import std.format : formattedWrite;
27
27
28
- auto combined = zip(refs.map! (r => r.id), refs.map! (r => r.fixed), descs.map! (d => d.desc));
29
28
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.
32
33
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 )
34
52
{
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
+ }
38
62
}
39
63
return app.data;
40
64
}
@@ -97,14 +121,10 @@ auto ghSendRequest(T...)(HTTPMethod method, string url, T arg)
97
121
void updateGithubComment (in ref PullRequest pr, in ref GHComment comment, string action, IssueRef[] refs, Issue[] descs)
98
122
{
99
123
logDebug(" %s" , refs);
100
- if (refs.empty)
101
- {
102
- return comment.remove();
103
- }
104
124
logDebug(" %s" , descs);
105
125
assert (refs.map! (r => r.id).equal(descs.map! (d => d.id)));
106
126
107
- auto msg = formatComment(refs, descs);
127
+ auto msg = pr. formatComment(refs, descs);
108
128
logDebug(" %s" , msg);
109
129
110
130
if (msg != comment.body_)
@@ -121,6 +141,12 @@ void updateGithubComment(in ref PullRequest pr, in ref GHComment comment, string
121
141
// Github Auto-merge
122
142
// ==============================================================================
123
143
144
+ static struct User
145
+ {
146
+ string login;
147
+ }
148
+
149
+ User user;
124
150
alias LabelsAndCommits = Tuple ! (Json[], " labels" , Json[], " commits" );
125
151
enum MergeMethod { none = 0 , merge, squash, rebase }
126
152
0 commit comments