Skip to content

Only run Bugzilla actions for projects using Bugzilla #272

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

Merged
merged 3 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
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
449 changes: 449 additions & 0 deletions data/hooks/github/dlang_dub_merged_12345.json

Large diffs are not rendered by default.

254 changes: 254 additions & 0 deletions data/payloads/github_repos_dlang_dub_issues_12345_comments
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
[
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267737793",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267737793",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267737793,
"user": {
"login": "timotheecour",
"id": 2194784,
"avatar_url": "https://avatars.githubusercontent.com/u/2194784?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/timotheecour",
"html_url": "https://github.com/timotheecour",
"followers_url": "https://api.github.com/users/timotheecour/followers",
"following_url": "https://api.github.com/users/timotheecour/following{/other_user}",
"gists_url": "https://api.github.com/users/timotheecour/gists{/gist_id}",
"starred_url": "https://api.github.com/users/timotheecour/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/timotheecour/subscriptions",
"organizations_url": "https://api.github.com/users/timotheecour/orgs",
"repos_url": "https://api.github.com/users/timotheecour/repos",
"events_url": "https://api.github.com/users/timotheecour/events{/privacy}",
"received_events_url": "https://api.github.com/users/timotheecour/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T02:37:29Z",
"updated_at": "2016-12-17T02:37:29Z",
"body": "couldn't that be done with tooling ? (if not with existing traits, at least via instrumenting dmd)"
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267759950",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267759950",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267759950,
"user": {
"login": "WalterBright",
"id": 568298,
"avatar_url": "https://avatars.githubusercontent.com/u/568298?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/WalterBright",
"html_url": "https://github.com/WalterBright",
"followers_url": "https://api.github.com/users/WalterBright/followers",
"following_url": "https://api.github.com/users/WalterBright/following{/other_user}",
"gists_url": "https://api.github.com/users/WalterBright/gists{/gist_id}",
"starred_url": "https://api.github.com/users/WalterBright/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WalterBright/subscriptions",
"organizations_url": "https://api.github.com/users/WalterBright/orgs",
"repos_url": "https://api.github.com/users/WalterBright/repos",
"events_url": "https://api.github.com/users/WalterBright/events{/privacy}",
"received_events_url": "https://api.github.com/users/WalterBright/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T12:22:46Z",
"updated_at": "2016-12-17T12:22:46Z",
"body": "Why not pull it?"
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267772880",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267772880",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267772880,
"user": {
"login": "andralex",
"id": 566679,
"avatar_url": "https://avatars.githubusercontent.com/u/566679?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/andralex",
"html_url": "https://github.com/andralex",
"followers_url": "https://api.github.com/users/andralex/followers",
"following_url": "https://api.github.com/users/andralex/following{/other_user}",
"gists_url": "https://api.github.com/users/andralex/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andralex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andralex/subscriptions",
"organizations_url": "https://api.github.com/users/andralex/orgs",
"repos_url": "https://api.github.com/users/andralex/repos",
"events_url": "https://api.github.com/users/andralex/events{/privacy}",
"received_events_url": "https://api.github.com/users/andralex/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T16:49:06Z",
"updated_at": "2016-12-17T16:49:06Z",
"body": "@timotheecour it could, but @WalterBright warned the tool would be highly nontrivial.\r\n\r\n@WalterBright good idea, I'll pull."
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267773560",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267773560",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267773560,
"user": {
"login": "andralex",
"id": 566679,
"avatar_url": "https://avatars.githubusercontent.com/u/566679?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/andralex",
"html_url": "https://github.com/andralex",
"followers_url": "https://api.github.com/users/andralex/followers",
"following_url": "https://api.github.com/users/andralex/following{/other_user}",
"gists_url": "https://api.github.com/users/andralex/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andralex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andralex/subscriptions",
"organizations_url": "https://api.github.com/users/andralex/orgs",
"repos_url": "https://api.github.com/users/andralex/repos",
"events_url": "https://api.github.com/users/andralex/events{/privacy}",
"received_events_url": "https://api.github.com/users/andralex/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T16:58:13Z",
"updated_at": "2016-12-17T16:58:13Z",
"body": "Auto-merge toggled on"
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267775518",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267775518",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267775518,
"user": {
"login": "CyberShadow",
"id": 160894,
"avatar_url": "https://avatars.githubusercontent.com/u/160894?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/CyberShadow",
"html_url": "https://github.com/CyberShadow",
"followers_url": "https://api.github.com/users/CyberShadow/followers",
"following_url": "https://api.github.com/users/CyberShadow/following{/other_user}",
"gists_url": "https://api.github.com/users/CyberShadow/gists{/gist_id}",
"starred_url": "https://api.github.com/users/CyberShadow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/CyberShadow/subscriptions",
"organizations_url": "https://api.github.com/users/CyberShadow/orgs",
"repos_url": "https://api.github.com/users/CyberShadow/repos",
"events_url": "https://api.github.com/users/CyberShadow/events{/privacy}",
"received_events_url": "https://api.github.com/users/CyberShadow/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T17:34:32Z",
"updated_at": "2016-12-17T17:34:32Z",
"body": "> @timotheecour it could, but @WalterBright warned the tool would be highly nontrivial.\r\n\r\nJust brute-force it.\r\n\r\nExpand all imports to selective imports of all symbols, then wrap imports in a DustMite comment block and run it through DustMite. We did something similar at DConf 2016 to minimize imports in ddmd."
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267775601",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267775601",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267775601,
"user": {
"login": "CyberShadow",
"id": 160894,
"avatar_url": "https://avatars.githubusercontent.com/u/160894?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/CyberShadow",
"html_url": "https://github.com/CyberShadow",
"followers_url": "https://api.github.com/users/CyberShadow/followers",
"following_url": "https://api.github.com/users/CyberShadow/following{/other_user}",
"gists_url": "https://api.github.com/users/CyberShadow/gists{/gist_id}",
"starred_url": "https://api.github.com/users/CyberShadow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/CyberShadow/subscriptions",
"organizations_url": "https://api.github.com/users/CyberShadow/orgs",
"repos_url": "https://api.github.com/users/CyberShadow/repos",
"events_url": "https://api.github.com/users/CyberShadow/events{/privacy}",
"received_events_url": "https://api.github.com/users/CyberShadow/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T17:36:10Z",
"updated_at": "2016-12-17T17:36:10Z",
"body": "Which Phobos modules do you want this done on? I could do this in bulk. (After my current reduction finishes.)"
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267779176",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267779176",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267779176,
"user": {
"login": "andralex",
"id": 566679,
"avatar_url": "https://avatars.githubusercontent.com/u/566679?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/andralex",
"html_url": "https://github.com/andralex",
"followers_url": "https://api.github.com/users/andralex/followers",
"following_url": "https://api.github.com/users/andralex/following{/other_user}",
"gists_url": "https://api.github.com/users/andralex/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andralex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andralex/subscriptions",
"organizations_url": "https://api.github.com/users/andralex/orgs",
"repos_url": "https://api.github.com/users/andralex/repos",
"events_url": "https://api.github.com/users/andralex/events{/privacy}",
"received_events_url": "https://api.github.com/users/andralex/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T18:38:17Z",
"updated_at": "2016-12-17T18:38:17Z",
"body": "@CyberShadow the point of this experiment is to illustrates the steps (and the ongoing maintenance) needed to take advantage of lazy imports, which have not been implemented. As of now, doing this is just giving us more maintenance to do of these lists."
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267780746",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267780746",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267780746,
"user": {
"login": "CyberShadow",
"id": 160894,
"avatar_url": "https://avatars.githubusercontent.com/u/160894?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/CyberShadow",
"html_url": "https://github.com/CyberShadow",
"followers_url": "https://api.github.com/users/CyberShadow/followers",
"following_url": "https://api.github.com/users/CyberShadow/following{/other_user}",
"gists_url": "https://api.github.com/users/CyberShadow/gists{/gist_id}",
"starred_url": "https://api.github.com/users/CyberShadow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/CyberShadow/subscriptions",
"organizations_url": "https://api.github.com/users/CyberShadow/orgs",
"repos_url": "https://api.github.com/users/CyberShadow/repos",
"events_url": "https://api.github.com/users/CyberShadow/events{/privacy}",
"received_events_url": "https://api.github.com/users/CyberShadow/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T19:01:45Z",
"updated_at": "2016-12-17T19:01:45Z",
"body": "Sorry, I don't get it? Was this PR made to prove some point?\r\n\r\n> It was a major effort\r\n\r\nWell... all I'm saying is that it didn't need to be.\r\n\r\nIs there any practical reason why I shouldn't have a go at replacing module imports with selective imports throughout Phobos? Really shouldn't take much effort, just some setup and CPU time to do the reduction.\r\n\r\nI'm confused, if this change was not good, then why was it merged? And if it was good, then why shouldn't we have more of it, especially if there's an easy way to do it?"
},
{
"url": "https://api.github.com/repos/dlang/dub/issues/comments/267781743",
"html_url": "https://github.com/dlang/dub/pull/12345#issuecomment-267781743",
"issue_url": "https://api.github.com/repos/dlang/dub/issues/12345",
"id": 267781743,
"user": {
"login": "andralex",
"id": 566679,
"avatar_url": "https://avatars.githubusercontent.com/u/566679?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/andralex",
"html_url": "https://github.com/andralex",
"followers_url": "https://api.github.com/users/andralex/followers",
"following_url": "https://api.github.com/users/andralex/following{/other_user}",
"gists_url": "https://api.github.com/users/andralex/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andralex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andralex/subscriptions",
"organizations_url": "https://api.github.com/users/andralex/orgs",
"repos_url": "https://api.github.com/users/andralex/repos",
"events_url": "https://api.github.com/users/andralex/events{/privacy}",
"received_events_url": "https://api.github.com/users/andralex/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2016-12-17T19:21:20Z",
"updated_at": "2016-12-17T19:21:20Z",
"body": ">Sorry, I don't get it? Was this PR made to prove some point?\r\n\r\nYes. The point was to preview the kind of setup that would have all explicit declarations.\r\n\r\n>> It was a major effort\r\n\r\n>Well... all I'm saying is that it didn't need to be.\r\n\r\nUnderstood, thanks.\r\n\r\n>Is there any practical reason why I shouldn't have a go at replacing module imports with selective imports throughout Phobos?\r\n\r\nThe replacement has no value except it adds one extra chore to maintain.\r\n\r\n>I'm confused, if this change was not good, then why was it merged? And if it was good, then why shouldn't we have more of it, especially if there's an easy way to do it?\r\n\r\nI will undo the PR."
}
]
72 changes: 72 additions & 0 deletions data/payloads/github_repos_dlang_dub_pulls_12345_commits
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"sha": "e064d5664f92c4b2f0866c08f6d0290ba66825ed",
"commit": {
"author": {
"name": "Andrei Alexandrescu",
"email": "andrei@erdani.com",
"date": "2016-12-16T21:54:13Z"
},
"committer": {
"name": "Andrei Alexandrescu",
"email": "andrei@erdani.com",
"date": "2016-12-17T16:50:16Z"
},
"message": "[DEMO][DONOTPULL] Converted imports to selective imports in std.array",
"tree": {
"sha": "b3106d04851a8f349b6cfdcfd7c9db663edbbfcb",
"url": "https://api.github.com/repos/dlang/dub/git/trees/b3106d04851a8f349b6cfdcfd7c9db663edbbfcb"
},
"url": "https://api.github.com/repos/dlang/dub/git/commits/e064d5664f92c4b2f0866c08f6d0290ba66825ed",
"comment_count": 0
},
"url": "https://api.github.com/repos/dlang/dub/commits/e064d5664f92c4b2f0866c08f6d0290ba66825ed",
"html_url": "https://github.com/dlang/dub/commit/e064d5664f92c4b2f0866c08f6d0290ba66825ed",
"comments_url": "https://api.github.com/repos/dlang/dub/commits/e064d5664f92c4b2f0866c08f6d0290ba66825ed/comments",
"author": {
"login": "andralex",
"id": 566679,
"avatar_url": "https://avatars.githubusercontent.com/u/566679?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/andralex",
"html_url": "https://github.com/andralex",
"followers_url": "https://api.github.com/users/andralex/followers",
"following_url": "https://api.github.com/users/andralex/following{/other_user}",
"gists_url": "https://api.github.com/users/andralex/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andralex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andralex/subscriptions",
"organizations_url": "https://api.github.com/users/andralex/orgs",
"repos_url": "https://api.github.com/users/andralex/repos",
"events_url": "https://api.github.com/users/andralex/events{/privacy}",
"received_events_url": "https://api.github.com/users/andralex/received_events",
"type": "User",
"site_admin": false
},
"committer": {
"login": "andralex",
"id": 566679,
"avatar_url": "https://avatars.githubusercontent.com/u/566679?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/andralex",
"html_url": "https://github.com/andralex",
"followers_url": "https://api.github.com/users/andralex/followers",
"following_url": "https://api.github.com/users/andralex/following{/other_user}",
"gists_url": "https://api.github.com/users/andralex/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andralex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andralex/subscriptions",
"organizations_url": "https://api.github.com/users/andralex/orgs",
"repos_url": "https://api.github.com/users/andralex/repos",
"events_url": "https://api.github.com/users/andralex/events{/privacy}",
"received_events_url": "https://api.github.com/users/andralex/received_events",
"type": "User",
"site_admin": false
},
"parents": [
{
"sha": "19445fc71e8aabdbd42f0ad8a571a57601a5ff39",
"url": "https://api.github.com/repos/dlang/dub/commits/19445fc71e8aabdbd42f0ad8a571a57601a5ff39",
"html_url": "https://github.com/dlang/dub/commit/19445fc71e8aabdbd42f0ad8a571a57601a5ff39"
}
]
}
]
6 changes: 3 additions & 3 deletions source/dlangbot/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void cronDaily(string[] repositories, CronConfig config)

void handlePR(string action, PullRequest* _pr)
{
import std.algorithm : among, any;
import std.algorithm : among, any, canFind;
import vibe.core.core : setTimer;
import dlangbot.warnings : checkForWarnings, UserMessage;
import std.format : format;
Expand Down Expand Up @@ -277,7 +277,7 @@ void handlePR(string action, PullRequest* _pr)

// When a PR is opened or updated mentioning some Bugzilla issues,
// post a link to the PR as an issue comment.
if (runBugzillaUpdates && pr.base.repo.get().owner.login == "dlang" &&
if (runBugzillaUpdates && bugzillaProjectSlugs.canFind(pr.repoSlug) &&
(action == "opened" || action == "synchronize" || action == "ready_for_review"))
{
import std.algorithm.iteration : filter, map;
Expand Down Expand Up @@ -323,7 +323,7 @@ void handlePR(string action, PullRequest* _pr)

// When a PR is merged, update Bugzilla issues
// (leave a comment with a link to the PR, and close them appropriately).
if (runBugzillaUpdates && pr.base.repo.get().owner.login == "dlang" &&
if (runBugzillaUpdates && bugzillaProjectSlugs.canFind(pr.repoSlug) &&
action == "merged")
{
import std.algorithm.iteration : filter, map;
Expand Down
5 changes: 5 additions & 0 deletions source/dlangbot/bugzilla.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import vibe.inet.webform : urlEncode;

shared string bugzillaURL = "https://issues.dlang.org";

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


import std.algorithm, std.conv, std.range, std.string;
import std.exception : enforce;
import std.format : format;
Expand Down
Loading