Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions changed.d
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ string escapeParens(string input)
/** Get a list of all bugzilla issues mentioned in revRange */
auto getIssues(string revRange)
{
import std.process : pipeProcess, Redirect, wait;
import std.process : execute, pipeProcess, Redirect, wait;
import std.regex : ctRegex, match, splitter;

// see https://github.com/github/github-services/blob/2e886f407696261bd5adfc99b16d36d5e7b50241/lib/services/bugzilla.rb#L155
Expand All @@ -101,7 +101,8 @@ auto getIssues(string revRange)
foreach (repo; ["dmd", "druntime", "phobos", "dlang.org", "tools", "installer"]
.map!(r => buildPath("..", r)))
{
auto cmd = ["git", "-C", repo, "fetch", "upstream", "--tags"];
auto cmd = ["git", "-C", repo, "fetch", "--tags", "https://github.com/dlang/" ~ repo.baseName,
"+refs/heads/*:refs/remotes/upstream/*"];
auto p = pipeProcess(cmd, Redirect.stdout);
enforce(wait(p.pid) == 0, "Failed to execute '%(%s %)'.".format(cmd));

Expand All @@ -128,13 +129,18 @@ auto getIssues(string revRange)
/** Generate and return the change log as a string. */
auto getBugzillaChanges(string revRange)
{
auto req = generateRequest(templateRequest, getIssues(revRange));
debug stderr.writeln(req); // write text
auto data = req.get;

// component (e.g. DMD) -> bug type (e.g. regression) -> list of bug entries
BugzillaEntry[][string][string] entries;

auto issues = getIssues(revRange);
// abort prematurely if no issues are found in all git logs
if (issues.empty)
return entries;

auto req = generateRequest(templateRequest, issues);
debug stderr.writeln(req); // write text
auto data = req.get;

foreach (fields; csvReader!(Tuple!(int, string, string, string))(data, null))
{
string comp = fields[1].toLower;
Expand All @@ -146,6 +152,7 @@ auto getBugzillaChanges(string revRange)
case "installer": comp = "Installer"; break;
case "phobos": comp = "Phobos"; break;
case "tools": comp = "Tools"; break;
case "visuald": comp = "VisualD"; break;
default: assert(0, comp);
}

Expand Down Expand Up @@ -364,7 +371,7 @@ Please supply a bugzilla version
// extract the previous version
auto parts = revRange.split("..");
if (parts.length > 1)
previousVersion = parts[0];
previousVersion = parts[0].replace("v", "");
}
else
{
Expand Down