Skip to content

Commit 7f06aad

Browse files
Recognise Merge:auto-merge label & friends
With the change from Bugzilla to GitHub we will now have a lot more labels, and they are naturally categorised into groups like `OS:Windows`. The ones that the bot deals with need to be handled properly here. Sill to do `Blocked`.
1 parent 0c3baab commit 7f06aad

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

source/dlangbot/github.d

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ GHMerge.MergeMethod autoMergeMethod(GHLabel[] labels)
181181
with (GHMerge.MergeMethod)
182182
{
183183
auto labelNames = labels.map!(l => l.name);
184-
if (labelNames.canFind!(l => l == "auto-merge"))
184+
if (labelNames.canFind!(l => (l == "auto-merge" || l == "Merge:auto-merge")))
185185
return merge;
186-
else if (labelNames.canFind!(l => l == "auto-merge-squash"))
186+
else if (labelNames.canFind!(l => (l == "auto-merge-squash" || || l == "Merge:auto-merge-squash")))
187187
return squash;
188-
else if (labelNames.canFind!(l => l == "auto-merge-rebase"))
188+
else if (labelNames.canFind!(l => (l == "auto-merge-rebase" || || l == "Merge:auto-merge-rebase")))
189189
return rebase;
190190
return none;
191191
}
@@ -217,13 +217,17 @@ Json[] tryMerge(in ref PullRequest pr, GHMerge.MergeMethod method)
217217
return commits;
218218
}
219219

220-
auto labelName = method.labelName;
220+
const labelName = method.labelName;
221+
const mergeLabelName = "Merge:" ~ labelName;
221222
if (commits.length == 1)
222223
method = GHMerge.MergeMethod.rebase;
223224

224225
auto events = ghGetRequest(pr.eventsURL).body[]
225226
.retro
226-
.filter!(e => e["event"] == "labeled" && e["label"]["name"] == labelName);
227+
.filter!(e => e["event"] == "labeled" && (
228+
e["label"]["name"] == labelName)
229+
|| e["label"]["name"] == mergeLabelName
230+
);
227231

228232
string author = "unknown";
229233
if (!events.empty)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy