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

Implements pull_request web hook to health checks and client side events #255

Merged
merged 22 commits into from Apr 29, 2016

Conversation

rauhryan
Copy link
Member

@rauhryan rauhryan commented Mar 29, 2016

converts PR into an issue payload and sends up the
event as an issue event.

Seems to work

Closes #231
Closes huboard/huboard#608
Related to huboard/huboard#598

converts PR into an issue payload and sends up the
event as an issue event. 

Seems to work fine

Related to #598
@dahlbyk dahlbyk temporarily deployed to huboard-rails-pr-255 March 29, 2016 00:49 Inactive
@discorick
Copy link
Member

Looking good! You might consider adding an IssueEventJob that handles the PR synchronize action even if its a noop, otherwise those events will throw exceptions.

See here: https://developer.github.com/v3/activity/events/types/#pullrequestevent

@rauhryan
Copy link
Member Author

@discorick are you cool with a simple guard statement

return render json: { message: "Not implemented: `syncronize` event" }
     if payload[:action] == "synchronize"

@dahlbyk dahlbyk temporarily deployed to huboard-rails-pr-255 March 29, 2016 16:02 Inactive
@dahlbyk
Copy link
Member

dahlbyk commented Mar 29, 2016

What is synchronize?

are you cool with a simple guard statement

return render json: { message: "Not implemented: `syncronize` event" }
     if payload[:action] == "synchronize"

What do we do with message?

@rauhryan
Copy link
Member Author

What is synchronize?

I'm not exactly sure, I think GH fires synchronize when you push new code to an existing PR

@rauhryan
Copy link
Member Author

What do we do with message?

Nothing, we just return that to GH and they will display it in the webhooks UI
webhook_-_http___gmail_com

@dahlbyk
Copy link
Member

dahlbyk commented Mar 29, 2016

Nothing, we just return that to GH and they will display it in the webhooks UI

👍


So there's not a 100% overlap between the issue and PR responses. Of particular interest may be the lack of labels:

@rauhryan
Copy link
Member Author

ok, i'll do some deeper testing

might have to adds some hacks to work around this temporarily

@dahlbyk dahlbyk temporarily deployed to huboard-rails April 13, 2016 04:36 Inactive
@dahlbyk
Copy link
Member

dahlbyk commented Apr 13, 2016

So there's not a 100% overlap between the issue and PR responses. Of particular interest may be the lack of labels:

On a random hunch, I found that PR /issues/events payloads do align with issue payloads: https://api.github.com/repos/huboard/huboard-web/issues/events/618652834. I hope you didn't get too far on any hacks, because I'm pretty sure we don't need them.

@discorick, any other thoughts on this? It seems solid to me (here's creating/merging a PR that closes another issue):
pr-events

@discorick
Copy link
Member

Hmm, testing the creation of a PR would be an interesting case as well.

@dahlbyk
Copy link
Member

dahlbyk commented Apr 13, 2016

Hmm, testing the creation of a PR would be an interesting case as well.

Note huboard-testing/spooky-octo-pug#24 appearing in Backlog at the beginning of the screen cap.

@discorick
Copy link
Member

Ah, I see, cause of the lack of Toast I missed it.

@dahlbyk
Copy link
Member

dahlbyk commented Apr 13, 2016

Ah, I see, cause of the lack of Toast I missed it.

No toast when normal issues are created, either. Kind of surprised I've never noticed that before.

@rauhryan
Copy link
Member Author

Are y'all sure it doesn't wipe out the labels array when new messages come up?

@dahlbyk
Copy link
Member

dahlbyk commented Apr 13, 2016

Are y'all sure it doesn't wipe out the labels array when new messages come up?

Interesting... So I do see a few unexpected behaviors with labels:

  • Chrome has an issue "label changed" toast that is missing from Firefox
  • Column label changes don't move cards (I seem to recall this is a known issue, but the event data are available so we should fix this)
  • PR label changes fire events (https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/events/625882013), but the changes never reach the browser (and result in lost information if the PR's labels are then edited in HuBoard)

It would be handy if our event payloads included the GitHub event URL, to aid in troubleshooting.

PR payload without other_labels (https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/events/625895527):

[
  {
    "channel": "\/huboard-testing\/spooky-octo-pug",
    "data": {
      "meta": {
        "action": "issue_labeled",
        "timestamp": "2016-04-13T14:48:59Z",
        "correlationId": null,
        "user": {
          "login": "dahlbyk",
          "id": 133987,
          "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/133987?v=3",
          "gravatar_id": "",
          "url": "https:\/\/api.github.com\/users\/dahlbyk",
          "html_url": "https:\/\/github.com\/dahlbyk",
          "followers_url": "https:\/\/api.github.com\/users\/dahlbyk\/followers",
          "following_url": "https:\/\/api.github.com\/users\/dahlbyk\/following{\/other_user}",
          "gists_url": "https:\/\/api.github.com\/users\/dahlbyk\/gists{\/gist_id}",
          "starred_url": "https:\/\/api.github.com\/users\/dahlbyk\/starred{\/owner}{\/repo}",
          "subscriptions_url": "https:\/\/api.github.com\/users\/dahlbyk\/subscriptions",
          "organizations_url": "https:\/\/api.github.com\/users\/dahlbyk\/orgs",
          "repos_url": "https:\/\/api.github.com\/users\/dahlbyk\/repos",
          "events_url": "https:\/\/api.github.com\/users\/dahlbyk\/events{\/privacy}",
          "received_events_url": "https:\/\/api.github.com\/users\/dahlbyk\/received_events",
          "type": "User",
          "site_admin": false
        },
        "identifier": 26,
        "repo_full_name": "huboard-testing\/spooky-octo-pug"
      },
      "payload": {
        "issue": {
          "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/26",
          "id": 66330676,
          "html_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug\/pull\/26",
          "diff_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug\/pull\/26.diff",
          "patch_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug\/pull\/26.patch",
          "issue_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/26",
          "number": 26,
          "state": "open",
          "locked": false,
          "title": "Update README.md",
          "user": {
            "login": "dahlbyk",
            "id": 133987,
            "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/133987?v=3",
            "gravatar_id": "",
            "url": "https:\/\/api.github.com\/users\/dahlbyk",
            "html_url": "https:\/\/github.com\/dahlbyk",
            "followers_url": "https:\/\/api.github.com\/users\/dahlbyk\/followers",
            "following_url": "https:\/\/api.github.com\/users\/dahlbyk\/following{\/other_user}",
            "gists_url": "https:\/\/api.github.com\/users\/dahlbyk\/gists{\/gist_id}",
            "starred_url": "https:\/\/api.github.com\/users\/dahlbyk\/starred{\/owner}{\/repo}",
            "subscriptions_url": "https:\/\/api.github.com\/users\/dahlbyk\/subscriptions",
            "organizations_url": "https:\/\/api.github.com\/users\/dahlbyk\/orgs",
            "repos_url": "https:\/\/api.github.com\/users\/dahlbyk\/repos",
            "events_url": "https:\/\/api.github.com\/users\/dahlbyk\/events{\/privacy}",
            "received_events_url": "https:\/\/api.github.com\/users\/dahlbyk\/received_events",
            "type": "User",
            "site_admin": false
          },
          "body": "Closes #25 \r\n\r\n<!---\r\n@huboard:{\"order\":1.5,\"milestone_order\":26,\"custom_state\":\"\"}\n-->\r\n",
          "created_at": "2016-04-13T14:28:44Z",
          "updated_at": "2016-04-13T14:48:59Z",
          "closed_at": null,
          "merged_at": null,
          "merge_commit_sha": "6182080e9ae4c51afceac87229255601500a45ea",
          "assignee": null,
          "milestone": null,
          "commits_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/26\/commits",
          "review_comments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/26\/comments",
          "review_comment_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/comments{\/number}",
          "comments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/26\/comments",
          "statuses_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/statuses\/7efdd2701a4aa28e9e1e507d0cecf3d10e4d1e30",
          "head": {
            "label": "huboard-testing:dahlbyk-patch-2",
            "ref": "dahlbyk-patch-2",
            "sha": "7efdd2701a4aa28e9e1e507d0cecf3d10e4d1e30",
            "user": {
              "login": "huboard-testing",
              "id": 9469949,
              "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/9469949?v=3",
              "gravatar_id": "",
              "url": "https:\/\/api.github.com\/users\/huboard-testing",
              "html_url": "https:\/\/github.com\/huboard-testing",
              "followers_url": "https:\/\/api.github.com\/users\/huboard-testing\/followers",
              "following_url": "https:\/\/api.github.com\/users\/huboard-testing\/following{\/other_user}",
              "gists_url": "https:\/\/api.github.com\/users\/huboard-testing\/gists{\/gist_id}",
              "starred_url": "https:\/\/api.github.com\/users\/huboard-testing\/starred{\/owner}{\/repo}",
              "subscriptions_url": "https:\/\/api.github.com\/users\/huboard-testing\/subscriptions",
              "organizations_url": "https:\/\/api.github.com\/users\/huboard-testing\/orgs",
              "repos_url": "https:\/\/api.github.com\/users\/huboard-testing\/repos",
              "events_url": "https:\/\/api.github.com\/users\/huboard-testing\/events{\/privacy}",
              "received_events_url": "https:\/\/api.github.com\/users\/huboard-testing\/received_events",
              "type": "Organization",
              "site_admin": false
            },
            "repo": {
              "id": 26025028,
              "name": "spooky-octo-pug",
              "full_name": "huboard-testing\/spooky-octo-pug",
              "owner": {
                "login": "huboard-testing",
                "id": 9469949,
                "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/9469949?v=3",
                "gravatar_id": "",
                "url": "https:\/\/api.github.com\/users\/huboard-testing",
                "html_url": "https:\/\/github.com\/huboard-testing",
                "followers_url": "https:\/\/api.github.com\/users\/huboard-testing\/followers",
                "following_url": "https:\/\/api.github.com\/users\/huboard-testing\/following{\/other_user}",
                "gists_url": "https:\/\/api.github.com\/users\/huboard-testing\/gists{\/gist_id}",
                "starred_url": "https:\/\/api.github.com\/users\/huboard-testing\/starred{\/owner}{\/repo}",
                "subscriptions_url": "https:\/\/api.github.com\/users\/huboard-testing\/subscriptions",
                "organizations_url": "https:\/\/api.github.com\/users\/huboard-testing\/orgs",
                "repos_url": "https:\/\/api.github.com\/users\/huboard-testing\/repos",
                "events_url": "https:\/\/api.github.com\/users\/huboard-testing\/events{\/privacy}",
                "received_events_url": "https:\/\/api.github.com\/users\/huboard-testing\/received_events",
                "type": "Organization",
                "site_admin": false
              },
              "private": false,
              "html_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug",
              "description": "",
              "fork": false,
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug",
              "forks_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/forks",
              "keys_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/keys{\/key_id}",
              "collaborators_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/collaborators{\/collaborator}",
              "teams_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/teams",
              "hooks_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/hooks",
              "issue_events_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/events{\/number}",
              "events_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/events",
              "assignees_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/assignees{\/user}",
              "branches_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/branches{\/branch}",
              "tags_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/tags",
              "blobs_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/blobs{\/sha}",
              "git_tags_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/tags{\/sha}",
              "git_refs_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/refs{\/sha}",
              "trees_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/trees{\/sha}",
              "statuses_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/statuses\/{sha}",
              "languages_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/languages",
              "stargazers_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/stargazers",
              "contributors_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/contributors",
              "subscribers_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/subscribers",
              "subscription_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/subscription",
              "commits_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/commits{\/sha}",
              "git_commits_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/commits{\/sha}",
              "comments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/comments{\/number}",
              "issue_comment_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/comments{\/number}",
              "contents_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/contents\/{+path}",
              "compare_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/compare\/{base}...{head}",
              "merges_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/merges",
              "archive_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/{archive_format}{\/ref}",
              "downloads_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/downloads",
              "issues_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues{\/number}",
              "pulls_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls{\/number}",
              "milestones_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/milestones{\/number}",
              "notifications_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/notifications{?since,all,participating}",
              "labels_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels{\/name}",
              "releases_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/releases{\/id}",
              "deployments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/deployments",
              "created_at": "2014-10-31T16:57:10Z",
              "updated_at": "2016-04-13T04:50:06Z",
              "pushed_at": "2016-04-13T14:28:45Z",
              "git_url": "git:\/\/github.com\/huboard-testing\/spooky-octo-pug.git",
              "ssh_url": "git@github.com:huboard-testing\/spooky-octo-pug.git",
              "clone_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug.git",
              "svn_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug",
              "homepage": null,
              "size": 2,
              "stargazers_count": 0,
              "watchers_count": 0,
              "language": null,
              "has_issues": true,
              "has_downloads": true,
              "has_wiki": true,
              "has_pages": false,
              "forks_count": 0,
              "mirror_url": null,
              "open_issues_count": 5,
              "forks": 0,
              "open_issues": 5,
              "watchers": 0,
              "default_branch": "master"
            }
          },
          "base": {
            "label": "huboard-testing:master",
            "ref": "master",
            "sha": "5068ac2398ee52f4330169487a714ae2b133a3bd",
            "user": {
              "login": "huboard-testing",
              "id": 9469949,
              "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/9469949?v=3",
              "gravatar_id": "",
              "url": "https:\/\/api.github.com\/users\/huboard-testing",
              "html_url": "https:\/\/github.com\/huboard-testing",
              "followers_url": "https:\/\/api.github.com\/users\/huboard-testing\/followers",
              "following_url": "https:\/\/api.github.com\/users\/huboard-testing\/following{\/other_user}",
              "gists_url": "https:\/\/api.github.com\/users\/huboard-testing\/gists{\/gist_id}",
              "starred_url": "https:\/\/api.github.com\/users\/huboard-testing\/starred{\/owner}{\/repo}",
              "subscriptions_url": "https:\/\/api.github.com\/users\/huboard-testing\/subscriptions",
              "organizations_url": "https:\/\/api.github.com\/users\/huboard-testing\/orgs",
              "repos_url": "https:\/\/api.github.com\/users\/huboard-testing\/repos",
              "events_url": "https:\/\/api.github.com\/users\/huboard-testing\/events{\/privacy}",
              "received_events_url": "https:\/\/api.github.com\/users\/huboard-testing\/received_events",
              "type": "Organization",
              "site_admin": false
            },
            "repo": {
              "id": 26025028,
              "name": "spooky-octo-pug",
              "full_name": "huboard-testing\/spooky-octo-pug",
              "owner": {
                "login": "huboard-testing",
                "id": 9469949,
                "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/9469949?v=3",
                "gravatar_id": "",
                "url": "https:\/\/api.github.com\/users\/huboard-testing",
                "html_url": "https:\/\/github.com\/huboard-testing",
                "followers_url": "https:\/\/api.github.com\/users\/huboard-testing\/followers",
                "following_url": "https:\/\/api.github.com\/users\/huboard-testing\/following{\/other_user}",
                "gists_url": "https:\/\/api.github.com\/users\/huboard-testing\/gists{\/gist_id}",
                "starred_url": "https:\/\/api.github.com\/users\/huboard-testing\/starred{\/owner}{\/repo}",
                "subscriptions_url": "https:\/\/api.github.com\/users\/huboard-testing\/subscriptions",
                "organizations_url": "https:\/\/api.github.com\/users\/huboard-testing\/orgs",
                "repos_url": "https:\/\/api.github.com\/users\/huboard-testing\/repos",
                "events_url": "https:\/\/api.github.com\/users\/huboard-testing\/events{\/privacy}",
                "received_events_url": "https:\/\/api.github.com\/users\/huboard-testing\/received_events",
                "type": "Organization",
                "site_admin": false
              },
              "private": false,
              "html_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug",
              "description": "",
              "fork": false,
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug",
              "forks_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/forks",
              "keys_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/keys{\/key_id}",
              "collaborators_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/collaborators{\/collaborator}",
              "teams_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/teams",
              "hooks_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/hooks",
              "issue_events_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/events{\/number}",
              "events_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/events",
              "assignees_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/assignees{\/user}",
              "branches_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/branches{\/branch}",
              "tags_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/tags",
              "blobs_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/blobs{\/sha}",
              "git_tags_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/tags{\/sha}",
              "git_refs_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/refs{\/sha}",
              "trees_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/trees{\/sha}",
              "statuses_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/statuses\/{sha}",
              "languages_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/languages",
              "stargazers_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/stargazers",
              "contributors_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/contributors",
              "subscribers_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/subscribers",
              "subscription_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/subscription",
              "commits_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/commits{\/sha}",
              "git_commits_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/git\/commits{\/sha}",
              "comments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/comments{\/number}",
              "issue_comment_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/comments{\/number}",
              "contents_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/contents\/{+path}",
              "compare_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/compare\/{base}...{head}",
              "merges_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/merges",
              "archive_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/{archive_format}{\/ref}",
              "downloads_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/downloads",
              "issues_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues{\/number}",
              "pulls_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls{\/number}",
              "milestones_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/milestones{\/number}",
              "notifications_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/notifications{?since,all,participating}",
              "labels_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels{\/name}",
              "releases_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/releases{\/id}",
              "deployments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/deployments",
              "created_at": "2014-10-31T16:57:10Z",
              "updated_at": "2016-04-13T04:50:06Z",
              "pushed_at": "2016-04-13T14:28:45Z",
              "git_url": "git:\/\/github.com\/huboard-testing\/spooky-octo-pug.git",
              "ssh_url": "git@github.com:huboard-testing\/spooky-octo-pug.git",
              "clone_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug.git",
              "svn_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug",
              "homepage": null,
              "size": 2,
              "stargazers_count": 0,
              "watchers_count": 0,
              "language": null,
              "has_issues": true,
              "has_downloads": true,
              "has_wiki": true,
              "has_pages": false,
              "forks_count": 0,
              "mirror_url": null,
              "open_issues_count": 5,
              "forks": 0,
              "open_issues": 5,
              "watchers": 0,
              "default_branch": "master"
            }
          },
          "_links": {
            "self": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/26"
            },
            "html": {
              "href": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug\/pull\/26"
            },
            "issue": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/26"
            },
            "comments": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/26\/comments"
            },
            "review_comments": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/26\/comments"
            },
            "review_comment": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/comments{\/number}"
            },
            "commits": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/pulls\/26\/commits"
            },
            "statuses": {
              "href": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/statuses\/7efdd2701a4aa28e9e1e507d0cecf3d10e4d1e30"
            }
          },
          "merged": false,
          "mergeable": true,
          "mergeable_state": "clean",
          "merged_by": null,
          "comments": 0,
          "review_comments": 0,
          "commits": 1,
          "additions": 1,
          "deletions": 1,
          "changed_files": 1,
          "current_state": {
            "name": "__nil__"
          },
          "number_searchable": "26",
          "other_labels": [

          ],
          "_data": {
            "order": 1.5,
            "milestone_order": 26,
            "custom_state": ""
          },
          "repo": {
            "owner": {
              "login": "huboard-testing"
            },
            "name": "spooky-octo-pug",
            "full_name": "huboard-testing\/spooky-octo-pug"
          }
        },
        "actor": {
          "login": "dahlbyk",
          "id": 133987,
          "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/133987?v=3",
          "gravatar_id": "",
          "url": "https:\/\/api.github.com\/users\/dahlbyk",
          "html_url": "https:\/\/github.com\/dahlbyk",
          "followers_url": "https:\/\/api.github.com\/users\/dahlbyk\/followers",
          "following_url": "https:\/\/api.github.com\/users\/dahlbyk\/following{\/other_user}",
          "gists_url": "https:\/\/api.github.com\/users\/dahlbyk\/gists{\/gist_id}",
          "starred_url": "https:\/\/api.github.com\/users\/dahlbyk\/starred{\/owner}{\/repo}",
          "subscriptions_url": "https:\/\/api.github.com\/users\/dahlbyk\/subscriptions",
          "organizations_url": "https:\/\/api.github.com\/users\/dahlbyk\/orgs",
          "repos_url": "https:\/\/api.github.com\/users\/dahlbyk\/repos",
          "events_url": "https:\/\/api.github.com\/users\/dahlbyk\/events{\/privacy}",
          "received_events_url": "https:\/\/api.github.com\/users\/dahlbyk\/received_events",
          "type": "User",
          "site_admin": false
        }
      }
    }
  }
]

Issue payload with other_labels (https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/events/625894602):

[
  {
    "channel": "\/huboard-testing\/spooky-octo-pug",
    "data": {
      "meta": {
        "action": "issue_unlabeled",
        "timestamp": "2016-04-13T14:48:27Z",
        "correlationId": null,
        "user": {
          "login": "dahlbyk",
          "id": 133987,
          "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/133987?v=3",
          "gravatar_id": "",
          "url": "https:\/\/api.github.com\/users\/dahlbyk",
          "html_url": "https:\/\/github.com\/dahlbyk",
          "followers_url": "https:\/\/api.github.com\/users\/dahlbyk\/followers",
          "following_url": "https:\/\/api.github.com\/users\/dahlbyk\/following{\/other_user}",
          "gists_url": "https:\/\/api.github.com\/users\/dahlbyk\/gists{\/gist_id}",
          "starred_url": "https:\/\/api.github.com\/users\/dahlbyk\/starred{\/owner}{\/repo}",
          "subscriptions_url": "https:\/\/api.github.com\/users\/dahlbyk\/subscriptions",
          "organizations_url": "https:\/\/api.github.com\/users\/dahlbyk\/orgs",
          "repos_url": "https:\/\/api.github.com\/users\/dahlbyk\/repos",
          "events_url": "https:\/\/api.github.com\/users\/dahlbyk\/events{\/privacy}",
          "received_events_url": "https:\/\/api.github.com\/users\/dahlbyk\/received_events",
          "type": "User",
          "site_admin": false
        },
        "identifier": 25,
        "repo_full_name": "huboard-testing\/spooky-octo-pug"
      },
      "payload": {
        "issue": {
          "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/25",
          "repository_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug",
          "labels_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/25\/labels{\/name}",
          "comments_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/25\/comments",
          "events_url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/issues\/25\/events",
          "html_url": "https:\/\/github.com\/huboard-testing\/spooky-octo-pug\/issues\/25",
          "id": 147951246,
          "number": 25,
          "title": "Test issue!",
          "user": {
            "login": "dahlbyk",
            "id": 133987,
            "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/133987?v=3",
            "gravatar_id": "",
            "url": "https:\/\/api.github.com\/users\/dahlbyk",
            "html_url": "https:\/\/github.com\/dahlbyk",
            "followers_url": "https:\/\/api.github.com\/users\/dahlbyk\/followers",
            "following_url": "https:\/\/api.github.com\/users\/dahlbyk\/following{\/other_user}",
            "gists_url": "https:\/\/api.github.com\/users\/dahlbyk\/gists{\/gist_id}",
            "starred_url": "https:\/\/api.github.com\/users\/dahlbyk\/starred{\/owner}{\/repo}",
            "subscriptions_url": "https:\/\/api.github.com\/users\/dahlbyk\/subscriptions",
            "organizations_url": "https:\/\/api.github.com\/users\/dahlbyk\/orgs",
            "repos_url": "https:\/\/api.github.com\/users\/dahlbyk\/repos",
            "events_url": "https:\/\/api.github.com\/users\/dahlbyk\/events{\/privacy}",
            "received_events_url": "https:\/\/api.github.com\/users\/dahlbyk\/received_events",
            "type": "User",
            "site_admin": false
          },
          "labels": [
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/1%20-%20Ready",
              "name": "1 - Ready",
              "color": "CCCCCC",
              "index": "1",
              "text": "Ready",
              "wip": 0
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/bug",
              "name": "bug",
              "color": "fc2929"
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/duplicate",
              "name": "duplicate",
              "color": "cccccc"
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/invalid",
              "name": "invalid",
              "color": "e6e6e6"
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/question",
              "name": "question",
              "color": "cc317c"
            }
          ],
          "state": "open",
          "locked": false,
          "assignee": null,
          "milestone": null,
          "comments": 0,
          "created_at": "2016-04-13T05:36:23Z",
          "updated_at": "2016-04-13T14:48:27Z",
          "closed_at": null,
          "body": "",
          "current_state": {
            "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/1%20-%20Ready",
            "name": "1 - Ready",
            "color": "CCCCCC",
            "index": "1",
            "text": "Ready",
            "wip": 0
          },
          "number_searchable": "25",
          "other_labels": [
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/bug",
              "name": "bug",
              "color": "fc2929"
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/duplicate",
              "name": "duplicate",
              "color": "cccccc"
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/invalid",
              "name": "invalid",
              "color": "e6e6e6"
            },
            {
              "url": "https:\/\/api.github.com\/repos\/huboard-testing\/spooky-octo-pug\/labels\/question",
              "name": "question",
              "color": "cc317c"
            }
          ],
          "_data": {
            "order": 25,
            "milestone_order": 25
          },
          "repo": {
            "owner": {
              "login": "huboard-testing"
            },
            "name": "spooky-octo-pug",
            "full_name": "huboard-testing\/spooky-octo-pug"
          }
        },
        "actor": {
          "login": "dahlbyk",
          "id": 133987,
          "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/133987?v=3",
          "gravatar_id": "",
          "url": "https:\/\/api.github.com\/users\/dahlbyk",
          "html_url": "https:\/\/github.com\/dahlbyk",
          "followers_url": "https:\/\/api.github.com\/users\/dahlbyk\/followers",
          "following_url": "https:\/\/api.github.com\/users\/dahlbyk\/following{\/other_user}",
          "gists_url": "https:\/\/api.github.com\/users\/dahlbyk\/gists{\/gist_id}",
          "starred_url": "https:\/\/api.github.com\/users\/dahlbyk\/starred{\/owner}{\/repo}",
          "subscriptions_url": "https:\/\/api.github.com\/users\/dahlbyk\/subscriptions",
          "organizations_url": "https:\/\/api.github.com\/users\/dahlbyk\/orgs",
          "repos_url": "https:\/\/api.github.com\/users\/dahlbyk\/repos",
          "events_url": "https:\/\/api.github.com\/users\/dahlbyk\/events{\/privacy}",
          "received_events_url": "https:\/\/api.github.com\/users\/dahlbyk\/received_events",
          "type": "User",
          "site_admin": false
        }
      }
    }
  }
]

@dahlbyk
Copy link
Member

dahlbyk commented Apr 13, 2016

I stand corrected - turns out the PR webhook payload doesn't align with /issues/events. I probably knew that two weeks ago, but didn't write down enough about what I found.

Actual webhook payload for the above PR event includes the added/removed label, but not the current list of all labels. Similarly, creating a PR fires an opened webhook with no label information, plus one or more labeled events with the actual labels. Curiously, HuBoard seems to handle that situation correctly - the new PR appeared on the board in the correct column with the correct other labels. 😕

{
  "action": "labeled",
  "number": 26,
  "pull_request": {
    "url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/26",
    "id": 66330676,
    "html_url": "https://github.com/huboard-testing/spooky-octo-pug/pull/26",
    "diff_url": "https://github.com/huboard-testing/spooky-octo-pug/pull/26.diff",
    "patch_url": "https://github.com/huboard-testing/spooky-octo-pug/pull/26.patch",
    "issue_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/26",
    "number": 26,
    "state": "open",
    "locked": false,
    "title": "Update README.md",
    "user": {
      "login": "dahlbyk",
      "id": 133987,
      "avatar_url": "https://avatars.githubusercontent.com/u/133987?v=3",
      "gravatar_id": "",
      "url": "https://api.github.com/users/dahlbyk",
      "html_url": "https://github.com/dahlbyk",
      "followers_url": "https://api.github.com/users/dahlbyk/followers",
      "following_url": "https://api.github.com/users/dahlbyk/following{/other_user}",
      "gists_url": "https://api.github.com/users/dahlbyk/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/dahlbyk/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/dahlbyk/subscriptions",
      "organizations_url": "https://api.github.com/users/dahlbyk/orgs",
      "repos_url": "https://api.github.com/users/dahlbyk/repos",
      "events_url": "https://api.github.com/users/dahlbyk/events{/privacy}",
      "received_events_url": "https://api.github.com/users/dahlbyk/received_events",
      "type": "User",
      "site_admin": false
    },
    "body": "Closes #25 \r\n\r\n<!---\r\n@huboard:{\"order\":1.5,\"milestone_order\":26,\"custom_state\":\"\"}\n-->\r\n",
    "created_at": "2016-04-13T14:28:44Z",
    "updated_at": "2016-04-13T14:48:59Z",
    "closed_at": null,
    "merged_at": null,
    "merge_commit_sha": "6182080e9ae4c51afceac87229255601500a45ea",
    "assignee": null,
    "milestone": null,
    "commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/26/commits",
    "review_comments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/26/comments",
    "review_comment_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/comments{/number}",
    "comments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/26/comments",
    "statuses_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/statuses/7efdd2701a4aa28e9e1e507d0cecf3d10e4d1e30",
    "head": {
      "label": "huboard-testing:dahlbyk-patch-2",
      "ref": "dahlbyk-patch-2",
      "sha": "7efdd2701a4aa28e9e1e507d0cecf3d10e4d1e30",
      "user": {
        "login": "huboard-testing",
        "id": 9469949,
        "avatar_url": "https://avatars.githubusercontent.com/u/9469949?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/huboard-testing",
        "html_url": "https://github.com/huboard-testing",
        "followers_url": "https://api.github.com/users/huboard-testing/followers",
        "following_url": "https://api.github.com/users/huboard-testing/following{/other_user}",
        "gists_url": "https://api.github.com/users/huboard-testing/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/huboard-testing/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/huboard-testing/subscriptions",
        "organizations_url": "https://api.github.com/users/huboard-testing/orgs",
        "repos_url": "https://api.github.com/users/huboard-testing/repos",
        "events_url": "https://api.github.com/users/huboard-testing/events{/privacy}",
        "received_events_url": "https://api.github.com/users/huboard-testing/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "repo": {
        "id": 26025028,
        "name": "spooky-octo-pug",
        "full_name": "huboard-testing/spooky-octo-pug",
        "owner": {
          "login": "huboard-testing",
          "id": 9469949,
          "avatar_url": "https://avatars.githubusercontent.com/u/9469949?v=3",
          "gravatar_id": "",
          "url": "https://api.github.com/users/huboard-testing",
          "html_url": "https://github.com/huboard-testing",
          "followers_url": "https://api.github.com/users/huboard-testing/followers",
          "following_url": "https://api.github.com/users/huboard-testing/following{/other_user}",
          "gists_url": "https://api.github.com/users/huboard-testing/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/huboard-testing/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/huboard-testing/subscriptions",
          "organizations_url": "https://api.github.com/users/huboard-testing/orgs",
          "repos_url": "https://api.github.com/users/huboard-testing/repos",
          "events_url": "https://api.github.com/users/huboard-testing/events{/privacy}",
          "received_events_url": "https://api.github.com/users/huboard-testing/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/huboard-testing/spooky-octo-pug",
        "description": "",
        "fork": false,
        "url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug",
        "forks_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/forks",
        "keys_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/teams",
        "hooks_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/hooks",
        "issue_events_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/events{/number}",
        "events_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/events",
        "assignees_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/assignees{/user}",
        "branches_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/branches{/branch}",
        "tags_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/tags",
        "blobs_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/languages",
        "stargazers_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/stargazers",
        "contributors_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/contributors",
        "subscribers_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/subscribers",
        "subscription_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/subscription",
        "commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/contents/{+path}",
        "compare_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/merges",
        "archive_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/downloads",
        "issues_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues{/number}",
        "pulls_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/labels{/name}",
        "releases_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/releases{/id}",
        "deployments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/deployments",
        "created_at": "2014-10-31T16:57:10Z",
        "updated_at": "2016-04-13T04:50:06Z",
        "pushed_at": "2016-04-13T14:28:45Z",
        "git_url": "git://github.com/huboard-testing/spooky-octo-pug.git",
        "ssh_url": "git@github.com:huboard-testing/spooky-octo-pug.git",
        "clone_url": "https://github.com/huboard-testing/spooky-octo-pug.git",
        "svn_url": "https://github.com/huboard-testing/spooky-octo-pug",
        "homepage": null,
        "size": 2,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": null,
        "has_issues": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "open_issues_count": 5,
        "forks": 0,
        "open_issues": 5,
        "watchers": 0,
        "default_branch": "master"
      }
    },
    "base": {
      "label": "huboard-testing:master",
      "ref": "master",
      "sha": "5068ac2398ee52f4330169487a714ae2b133a3bd",
      "user": {
        "login": "huboard-testing",
        "id": 9469949,
        "avatar_url": "https://avatars.githubusercontent.com/u/9469949?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/huboard-testing",
        "html_url": "https://github.com/huboard-testing",
        "followers_url": "https://api.github.com/users/huboard-testing/followers",
        "following_url": "https://api.github.com/users/huboard-testing/following{/other_user}",
        "gists_url": "https://api.github.com/users/huboard-testing/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/huboard-testing/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/huboard-testing/subscriptions",
        "organizations_url": "https://api.github.com/users/huboard-testing/orgs",
        "repos_url": "https://api.github.com/users/huboard-testing/repos",
        "events_url": "https://api.github.com/users/huboard-testing/events{/privacy}",
        "received_events_url": "https://api.github.com/users/huboard-testing/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "repo": {
        "id": 26025028,
        "name": "spooky-octo-pug",
        "full_name": "huboard-testing/spooky-octo-pug",
        "owner": {
          "login": "huboard-testing",
          "id": 9469949,
          "avatar_url": "https://avatars.githubusercontent.com/u/9469949?v=3",
          "gravatar_id": "",
          "url": "https://api.github.com/users/huboard-testing",
          "html_url": "https://github.com/huboard-testing",
          "followers_url": "https://api.github.com/users/huboard-testing/followers",
          "following_url": "https://api.github.com/users/huboard-testing/following{/other_user}",
          "gists_url": "https://api.github.com/users/huboard-testing/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/huboard-testing/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/huboard-testing/subscriptions",
          "organizations_url": "https://api.github.com/users/huboard-testing/orgs",
          "repos_url": "https://api.github.com/users/huboard-testing/repos",
          "events_url": "https://api.github.com/users/huboard-testing/events{/privacy}",
          "received_events_url": "https://api.github.com/users/huboard-testing/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/huboard-testing/spooky-octo-pug",
        "description": "",
        "fork": false,
        "url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug",
        "forks_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/forks",
        "keys_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/teams",
        "hooks_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/hooks",
        "issue_events_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/events{/number}",
        "events_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/events",
        "assignees_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/assignees{/user}",
        "branches_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/branches{/branch}",
        "tags_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/tags",
        "blobs_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/languages",
        "stargazers_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/stargazers",
        "contributors_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/contributors",
        "subscribers_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/subscribers",
        "subscription_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/subscription",
        "commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/contents/{+path}",
        "compare_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/merges",
        "archive_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/downloads",
        "issues_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues{/number}",
        "pulls_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/labels{/name}",
        "releases_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/releases{/id}",
        "deployments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/deployments",
        "created_at": "2014-10-31T16:57:10Z",
        "updated_at": "2016-04-13T04:50:06Z",
        "pushed_at": "2016-04-13T14:28:45Z",
        "git_url": "git://github.com/huboard-testing/spooky-octo-pug.git",
        "ssh_url": "git@github.com:huboard-testing/spooky-octo-pug.git",
        "clone_url": "https://github.com/huboard-testing/spooky-octo-pug.git",
        "svn_url": "https://github.com/huboard-testing/spooky-octo-pug",
        "homepage": null,
        "size": 2,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": null,
        "has_issues": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "open_issues_count": 5,
        "forks": 0,
        "open_issues": 5,
        "watchers": 0,
        "default_branch": "master"
      }
    },
    "_links": {
      "self": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/26"
      },
      "html": {
        "href": "https://github.com/huboard-testing/spooky-octo-pug/pull/26"
      },
      "issue": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/26"
      },
      "comments": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/26/comments"
      },
      "review_comments": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/26/comments"
      },
      "review_comment": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/comments{/number}"
      },
      "commits": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls/26/commits"
      },
      "statuses": {
        "href": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/statuses/7efdd2701a4aa28e9e1e507d0cecf3d10e4d1e30"
      }
    },
    "merged": false,
    "mergeable": true,
    "mergeable_state": "clean",
    "merged_by": null,
    "comments": 0,
    "review_comments": 0,
    "commits": 1,
    "additions": 1,
    "deletions": 1,
    "changed_files": 1
  },
  "label": {
    "url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/labels/bug",
    "name": "bug",
    "color": "fc2929"
  },
  "repository": {
    "id": 26025028,
    "name": "spooky-octo-pug",
    "full_name": "huboard-testing/spooky-octo-pug",
    "owner": {
      "login": "huboard-testing",
      "id": 9469949,
      "avatar_url": "https://avatars.githubusercontent.com/u/9469949?v=3",
      "gravatar_id": "",
      "url": "https://api.github.com/users/huboard-testing",
      "html_url": "https://github.com/huboard-testing",
      "followers_url": "https://api.github.com/users/huboard-testing/followers",
      "following_url": "https://api.github.com/users/huboard-testing/following{/other_user}",
      "gists_url": "https://api.github.com/users/huboard-testing/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/huboard-testing/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/huboard-testing/subscriptions",
      "organizations_url": "https://api.github.com/users/huboard-testing/orgs",
      "repos_url": "https://api.github.com/users/huboard-testing/repos",
      "events_url": "https://api.github.com/users/huboard-testing/events{/privacy}",
      "received_events_url": "https://api.github.com/users/huboard-testing/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/huboard-testing/spooky-octo-pug",
    "description": "",
    "fork": false,
    "url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug",
    "forks_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/forks",
    "keys_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/teams",
    "hooks_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/hooks",
    "issue_events_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/events{/number}",
    "events_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/events",
    "assignees_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/assignees{/user}",
    "branches_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/branches{/branch}",
    "tags_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/tags",
    "blobs_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/languages",
    "stargazers_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/stargazers",
    "contributors_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/contributors",
    "subscribers_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/subscribers",
    "subscription_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/subscription",
    "commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/contents/{+path}",
    "compare_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/merges",
    "archive_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/downloads",
    "issues_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/issues{/number}",
    "pulls_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/labels{/name}",
    "releases_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/releases{/id}",
    "deployments_url": "https://api.github.com/repos/huboard-testing/spooky-octo-pug/deployments",
    "created_at": "2014-10-31T16:57:10Z",
    "updated_at": "2016-04-13T04:50:06Z",
    "pushed_at": "2016-04-13T14:28:45Z",
    "git_url": "git://github.com/huboard-testing/spooky-octo-pug.git",
    "ssh_url": "git@github.com:huboard-testing/spooky-octo-pug.git",
    "clone_url": "https://github.com/huboard-testing/spooky-octo-pug.git",
    "svn_url": "https://github.com/huboard-testing/spooky-octo-pug",
    "homepage": null,
    "size": 2,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": null,
    "has_issues": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 0,
    "mirror_url": null,
    "open_issues_count": 5,
    "forks": 0,
    "open_issues": 5,
    "watchers": 0,
    "default_branch": "master"
  },
  "organization": {
    "login": "huboard-testing",
    "id": 9469949,
    "url": "https://api.github.com/orgs/huboard-testing",
    "repos_url": "https://api.github.com/orgs/huboard-testing/repos",
    "events_url": "https://api.github.com/orgs/huboard-testing/events",
    "hooks_url": "https://api.github.com/orgs/huboard-testing/hooks",
    "issues_url": "https://api.github.com/orgs/huboard-testing/issues",
    "members_url": "https://api.github.com/orgs/huboard-testing/members{/member}",
    "public_members_url": "https://api.github.com/orgs/huboard-testing/public_members{/member}",
    "avatar_url": "https://avatars.githubusercontent.com/u/9469949?v=3",
    "description": "Test projects for HuBoard, an open source task management platform built directly on top of your existing GitHub repositories"
  },
  "sender": {
    "login": "dahlbyk",
    "id": 133987,
    "avatar_url": "https://avatars.githubusercontent.com/u/133987?v=3",
    "gravatar_id": "",
    "url": "https://api.github.com/users/dahlbyk",
    "html_url": "https://github.com/dahlbyk",
    "followers_url": "https://api.github.com/users/dahlbyk/followers",
    "following_url": "https://api.github.com/users/dahlbyk/following{/other_user}",
    "gists_url": "https://api.github.com/users/dahlbyk/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/dahlbyk/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/dahlbyk/subscriptions",
    "organizations_url": "https://api.github.com/users/dahlbyk/orgs",
    "repos_url": "https://api.github.com/users/dahlbyk/repos",
    "events_url": "https://api.github.com/users/dahlbyk/events{/privacy}",
    "received_events_url": "https://api.github.com/users/dahlbyk/received_events",
    "type": "User",
    "site_admin": false
  }
}

@discorick
Copy link
Member

@dahlbyk the reason these events work is due to this line: https://github.com/huboard/huboard-web/pull/255/files#diff-a92dfded40042b12657ab3904a649acaR31

The pull_request key is being mapped to the issue key and since that payload matches the signature of an issue all is well.

The label changes missing is a front-end issue, the toast is picking up but the subscriber that actually handles the message is not - @rauhryan I think thats really all there is left to the PR otherwise I am happy to :shipit:

@discorick
Copy link
Member

discorick commented Apr 26, 2016

Just picking this PR and taking it over the finish line. TODO list for Events:

  • assigned
  • unassigned
  • labeled
  • unlabeled
  • opened
  • opened Toast
  • closed
  • reopened

@discorick discorick temporarily deployed to huboard-rails-pr-255 April 26, 2016 17:06 Inactive
@discorick discorick temporarily deployed to huboard-rails-pr-255 April 26, 2016 19:59 Inactive
@discorick discorick temporarily deployed to huboard-rails-pr-255 April 26, 2016 20:42 Inactive
the cache key use the label name to prevent duplicate messages getting published to the client
class_attribute is a safer and cleaner way to allow
subclasses to override properties from class methods
class_attribute is a safer and cleaner way to allow
subclasses to override properties from class methods
to deploy HuBoard in production with sucker_punch
@rauhryan
Copy link
Member Author

@huboard/committers I've tested everything and feel like this is dev complete and ready to deploy

cache_key ->(message) {
label_name = message[:payload][:label] ? message[:payload][:label]['name'] : ""

"#{message[:meta][:action]}.#{message[:meta][:user]["login"]}.#{message[:meta][:identifier]}.#{message[:meta][:timestamp]}.#{ label_name }"
Copy link
Member

Choose a reason for hiding this comment

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

This looks duplicated. Leverage a class method so that we don't screw this up?

Copy link
Member Author

Choose a reason for hiding this comment

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

cache_key is a class method that will override the default _cache_key class_attribute

It's syntactic DSL sugar to override default behavior of the cache key for labels.

So, I think it's already doing what you suggested

it might be confusing because it's not using parenthesis

cache_key(->(message) { "here.derp" })

Copy link
Member

Choose a reason for hiding this comment

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

Are there any issue messages that wouldn't be cached with at least #{message[:meta][:action]}.#{message[:meta][:user]["login"]}.#{message[:meta][:identifier]}.#{message[:meta][:timestamp]}? Could the override just specify a suffix for the key if necessary, to avoid duplicating the action/login/id/timestamp code?

Copy link
Member

Choose a reason for hiding this comment

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

Actual delta at this point is three lines - should definitely extract a
base class to DRY this up.
@rauhryan
Copy link
Member Author

:shipit:

@rauhryan rauhryan merged commit 1b4771d into master Apr 29, 2016
@dahlbyk dahlbyk deleted the rauhryan/pr-close-to-final-column branch April 29, 2016 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants