Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[github.d] don't mention bugzilla for phobos PRs #305

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 7 additions & 2 deletions source/dlangbot/github.d
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ string markdownEscape(string desc)
return app.data;
}

bool usesGitHubIssues(in ref PullRequest pr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normally I would do usesBugzillaIssues but I don't know what the full set of repos that use it are.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you looking for this?

// D projects which use Bugzilla for bug tracking.
static immutable bugzillaProjectSlugs = ["dlang/dmd", "dlang/druntime", "dlang/phobos",
"dlang/dlang.org", "dlang/tools", "dlang/installer"];

{
return pr.repoSlug.among("dlang/phobos");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this needs to be compared against 0, since among returns 0 if it's not found and a one-based index of which one was found if one is found.

}

string formatComment(in ref PullRequest pr, in IssueRef[] refs, in Issue[] descs, in UserMessage[] msgs)
{
import std.array : appender;
Expand Down Expand Up @@ -91,7 +96,7 @@ If you have addressed all reviews or aren't sure how to proceed, don't hesitate
}

// markdown doesn't support breaking of long lines
if (bugzillaProjectSlugs.canFind(pr.repoSlug))
if (!pr.usesGitHubIssues && bugzillaProjectSlugs.canFind(pr.repoSlug))
{
app ~= "\n### Bugzilla references\n\n";
if (refs.length)
Expand All @@ -104,7 +109,7 @@ If your PR contains non-trivial changes, please [reference a Bugzilla issue](htt
`, pr.repoSlug, pr.repoSlug == "dlang/dlang.org" ? "language-changelog" : "changelog");
}

if (msgs.length)
if (!pr.usesGitHubIssues && msgs.length)
{
if (refs.length)
app ~= "\n";
Expand Down
Loading