Skip to content

Commit 2ac5ffa

Browse files
committed
only tag as bug fix when the referenced issues git fixed
1 parent f293dee commit 2ac5ffa

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

source/dlangbot/app.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ void githubHook(HTTPServerRequest req, HTTPServerResponse res)
169169

170170
void handlePR(string action, PullRequest pr)
171171
{
172+
import std.algorithm : any;
172173
import vibe.core.core : setTimer;
173174

174175
Json[] commits;
@@ -197,7 +198,7 @@ void handlePR(string action, PullRequest pr)
197198

198199
pr.updateGithubComment(comment, action, refs, descs);
199200

200-
if (refs.length > 0 && comment.body_.length == 0)
201+
if (refs.any!(r => r.fixed) && comment.body_.length == 0)
201202
pr.addLabels(["Bug fix"]);
202203

203204
if (runTrello)

test/comments.d

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ unittest
3737
j = Json.emptyArray;
3838
},
3939
"/bugzilla/buglist.cgi?bug_id=8573&ctype=csv&columnlist=short_desc",
40-
// action: add bug fix label
41-
"/github/repos/dlang/phobos/issues/4921/labels",
42-
(scope HTTPServerRequest req, scope HTTPServerResponse res){
43-
assert(req.method == HTTPMethod.POST);
44-
assert(req.json[0].get!string == "Bug fix");
45-
res.writeVoidBody;
46-
},
40+
// no bug fix label, since Issues are only referenced but not fixed according to commit messages
4741
"/github/repos/dlang/phobos/issues/4921/comments",
4842
(scope HTTPServerRequest req, scope HTTPServerResponse res){
4943
assert(req.method == HTTPMethod.POST);

0 commit comments

Comments
 (0)