Skip to content

Commit 7d00615

Browse files
[ci] remove some stuff
1 parent 9480e90 commit 7d00615

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

source/dlangbot/bugzilla.d

+1-52
Original file line numberDiff line numberDiff line change
@@ -94,65 +94,14 @@ struct IssueRef { int id; bool fixed; Json[] commits; }
9494
// get all issues mentioned in a commit
9595
IssueRef[] getIssueRefs(RE)(Json[] commits, RE re = issueRE)
9696
{
97-
return commits
98-
// Collect all issue references (range of ranges per commit)
99-
.map!(c => c["commit"]["message"]
100-
.get!string
101-
.matchIssueRefs(re)
102-
.map!((r) { r.commits = [c]; return r; })
103-
)
104-
// Join to flat list
105-
.join
106-
// Sort and group by issue ID
107-
.sort!((a, b) => a.id < b.id, SwapStrategy.stable)
108-
.groupBy
109-
// Reduce each per-ID group to a single IssueRef
110-
.map!(g => g
111-
.reduce!((a, b) =>
112-
IssueRef(a.id, a.fixed || b.fixed, a.commits ~ b.commits)
113-
)
114-
)
115-
.array;
116-
}
117-
118-
unittest
119-
{
120-
Json fix(int id) { return ["commit":["message":"Fix Bugzilla %d".format(id).Json].Json].Json; }
121-
Json mention(int id) { return ["commit":["message":"Bugzilla %d".format(id).Json].Json].Json; }
122-
123-
assert(getIssueRefs([fix(1)]) == [IssueRef(1, true, [fix(1)])]);
124-
assert(getIssueRefs([mention(1)]) == [IssueRef(1, false, [mention(1)])]);
125-
assert(getIssueRefs([fix(1), mention(1)]) == [IssueRef(1, true, [fix(1), mention(1)])]);
126-
assert(getIssueRefs([mention(1), fix(1)]) == [IssueRef(1, true, [mention(1), fix(1)])]);
127-
assert(getIssueRefs([mention(1), fix(2), fix(1)]) == [IssueRef(1, true, [mention(1), fix(1)]), IssueRef(2, true, [fix(2)])]);
97+
return null;
12898
}
12999

130100
UserMessage[] checkLegacyIssueRefs(Json[] commits)
131101
{
132-
auto oldHits = commits.getIssueRefs(oldIssueRE).map!(r => r.id);
133-
auto newHits = commits.getIssueRefs(issueRE).map!(r => r.id);
134-
auto onlyOld = oldHits.filter!(id => !newHits.canFind(id));
135-
if (!onlyOld.empty)
136-
return [UserMessage(UserMessage.Type.Warning,
137-
"In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. " ~
138-
"Please add the word \"Bugzilla\" to issue references. For example, `Fix Bugzilla Issue 12345` or `Fix Bugzilla 12345`." ~
139-
"(Reminder: the edit needs to be done in the Git *commit message*, not the GitHub *pull request*.)"
140-
)];
141102
return null;
142103
}
143104

144-
unittest
145-
{
146-
Json fixOld(int id) { return ["commit":["message":"Fix Issue %d".format(id).Json].Json].Json; }
147-
Json fixNew(int id) { return ["commit":["message":"Fix Bugzilla %d".format(id).Json].Json].Json; }
148-
149-
assert( checkLegacyIssueRefs([]).empty);
150-
assert( checkLegacyIssueRefs([fixNew(1)]).empty);
151-
assert( checkLegacyIssueRefs([fixOld(1), fixNew(1)]).empty);
152-
assert(!checkLegacyIssueRefs([fixOld(1)]).empty);
153-
assert(!checkLegacyIssueRefs([fixOld(1), fixNew(2)]).empty);
154-
}
155-
156105
struct Issue
157106
{
158107
int id;

0 commit comments

Comments
 (0)