Marrying bugzilla issues with git pull requests
Andrew Edwards via Digitalmars-d
digitalmars-d at puremagic.com
Thu Sep 25 06:53:14 PDT 2014
Currently a mention of a bugzilla issue number on a git pull request
triggers an automatic update of the issue when then pull gets merged.
There is also a trend of placing a link an applicable pull in the
comments section of the issue. I would like to request a formal location
in the header of the ticket to identify store this like instead. This
could be easily accomplished by appropriating and renaming the seldom
(if ever) used URL field and ensuring it accepts multiple urls (similar
to See Also). Or, if that is not possible, by adding a Pulls filed below
See Also.
This would provide a uniformed location to see if a pull exists for a
specific issue and allow for the automatic query of such information.
I currently need this functionality in a script i am writing to prepare
the update information for the beta release wiki pages. Since this
information is usually stored on the ticket it should be simple to
retrieve it but I am not sure how to do so from the comments. If the the
information was placed in a standard location in the header, it would
make things much simpler.
In it's current form the script looks like this:
<CODE>
import std.csv;
import std.net.curl : get;
import std.string;
import std.stdio;
import std.typecons;
pragma(lib, "curl");
void main()
{
// designate query url
auto front = "https://issues.dlang.org/buglist.cgi?bug_severity=";
auto back =
"&order=bug_id&query_format=advanced&resolution=---&ctype=csv&human=1";
auto regressions = front ~ "regression" ~ back;
auto blockers = front ~ "blocker" ~ back;
auto result = get(regressions).idup.splitLines[1 .. $];
printIssues("Regressions", result);
result = get(blockers).idup.splitLines[1 .. $];
printIssues("Blockers", result);
}
void printIssues(string issues, string[] result)
{
alias format = Tuple!(string, string, string, string, string, string,
string, string);
auto color = "orange";
if (issues == "Blockers")
color = "red";
writeln(`== <font color=` ~ color ~ `>'''Known ` ~ issues ~ `'''</font>
==`);
writeln(`{| class="wikitable sortable" border="1"`);
writeln(`|-`);
writeln(`! scope="col" | Issue`);
writeln(`! scope="col" | Repo`);
writeln(`! scope="col" class="unsortable" | Summary`);
writeln(`! scope="col" | Pull`);
writeln(`! scope="col" | Status`);
foreach (ndx, line; result) {
foreach (record; csvReader!(format)(line))
{
writeln("|-");
writeln("| [https://issues.dlang.org/show_bug.cgi?id="~record[0] ~"
"~ record[0]~"]");
writeln(" || ");
writeln(" || " ~ record[6]);
writeln(" || ");
writeln(" || ");
}
}
writeln("|}");
}
</CODE>
If there is a better way, I would appreciate guidance toward that
direction also.
Thanks,
Andrew
More information about the Digitalmars-d
mailing list