Githawk: Support Security Vulnerability notifications

Created on 27 Apr 2018  路  3Comments  路  Source: GitHawkApp/GitHawk

They break the app now, not showing the full list containing any or more of these type of notifications (ref. https://github.com/GitHawkApp/GitHawk/issues/1449#issuecomment-384928051)

Is this something we can be more lenient about in the future? These "corner case" notifications have broken the app before, like with organization invitations (which we just ignore at the moment).

馃悰 bug

Most helpful comment

Here鈥檚 some JSON for you:

/repos/:slug/notifications

{
  "id": "328706116",
  "unread": false,
  "reason": "security_alert",
  "updated_at": "2018-04-26T15:25:17Z",
  "last_read_at": "2018-04-27T00:34:20Z",
  "subject": {
    "title": "Potential security vulnerability found in the hoek dependency",
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "latest_comment_url": "https://api.github.com/repos/j-f1/eslint-docs",
    "type": "RepositoryVulnerabilityAlert"
  },
  "repository": {
    "id": 100884355,
    "name": "eslint-docs",
    "full_name": "j-f1/eslint-docs",
    "owner": {
      "login": "j-f1",
      "id": 25517624,
      "avatar_url": "https://avatars2.githubusercontent.com/u/25517624?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/j-f1",
      "html_url": "https://github.com/j-f1",
      "followers_url": "https://api.github.com/users/j-f1/followers",
      "following_url": "https://api.github.com/users/j-f1/following{/other_user}",
      "gists_url": "https://api.github.com/users/j-f1/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/j-f1/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/j-f1/subscriptions",
      "organizations_url": "https://api.github.com/users/j-f1/orgs",
      "repos_url": "https://api.github.com/users/j-f1/repos",
      "events_url": "https://api.github.com/users/j-f1/events{/privacy}",
      "received_events_url": "https://api.github.com/users/j-f1/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/j-f1/eslint-docs",
    "description": "Keep your rule names and descriptions up-to-date across your repo",
    "fork": false,
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "forks_url": "https://api.github.com/repos/j-f1/eslint-docs/forks",
    "keys_url": "https://api.github.com/repos/j-f1/eslint-docs/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/j-f1/eslint-docs/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/j-f1/eslint-docs/teams",
    "hooks_url": "https://api.github.com/repos/j-f1/eslint-docs/hooks",
    "issue_events_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/events{/number}",
    "events_url": "https://api.github.com/repos/j-f1/eslint-docs/events",
    "assignees_url": "https://api.github.com/repos/j-f1/eslint-docs/assignees{/user}",
    "branches_url": "https://api.github.com/repos/j-f1/eslint-docs/branches{/branch}",
    "tags_url": "https://api.github.com/repos/j-f1/eslint-docs/tags",
    "blobs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/j-f1/eslint-docs/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/j-f1/eslint-docs/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/j-f1/eslint-docs/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/j-f1/eslint-docs/languages",
    "stargazers_url": "https://api.github.com/repos/j-f1/eslint-docs/stargazers",
    "contributors_url": "https://api.github.com/repos/j-f1/eslint-docs/contributors",
    "subscribers_url": "https://api.github.com/repos/j-f1/eslint-docs/subscribers",
    "subscription_url": "https://api.github.com/repos/j-f1/eslint-docs/subscription",
    "commits_url": "https://api.github.com/repos/j-f1/eslint-docs/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/j-f1/eslint-docs/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/j-f1/eslint-docs/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/j-f1/eslint-docs/contents/{+path}",
    "compare_url": "https://api.github.com/repos/j-f1/eslint-docs/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/j-f1/eslint-docs/merges",
    "archive_url": "https://api.github.com/repos/j-f1/eslint-docs/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/j-f1/eslint-docs/downloads",
    "issues_url": "https://api.github.com/repos/j-f1/eslint-docs/issues{/number}",
    "pulls_url": "https://api.github.com/repos/j-f1/eslint-docs/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/j-f1/eslint-docs/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/j-f1/eslint-docs/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/j-f1/eslint-docs/labels{/name}",
    "releases_url": "https://api.github.com/repos/j-f1/eslint-docs/releases{/id}",
    "deployments_url": "https://api.github.com/repos/j-f1/eslint-docs/deployments"
  },
  "url": "https://api.github.com/notifications/threads/328706116",
  "subscription_url": "https://api.github.com/notifications/threads/328706116/subscription"
}

/notifications/threads/:id

{
  "id": "328706116",
  "unread": false,
  "reason": "security_alert",
  "updated_at": "2018-04-26T15:25:17Z",
  "last_read_at": null,
  "subject": {
    "title": "Potential security vulnerability found in the hoek dependency",
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "latest_comment_url": "https://api.github.com/repos/j-f1/eslint-docs",
    "type": "RepositoryVulnerabilityAlert"
  },
  "repository": {
    "id": 100884355,
    "name": "eslint-docs",
    "full_name": "j-f1/eslint-docs",
    "owner": {
      "login": "j-f1",
      "id": 25517624,
      "avatar_url": "https://avatars2.githubusercontent.com/u/25517624?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/j-f1",
      "html_url": "https://github.com/j-f1",
      "followers_url": "https://api.github.com/users/j-f1/followers",
      "following_url": "https://api.github.com/users/j-f1/following{/other_user}",
      "gists_url": "https://api.github.com/users/j-f1/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/j-f1/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/j-f1/subscriptions",
      "organizations_url": "https://api.github.com/users/j-f1/orgs",
      "repos_url": "https://api.github.com/users/j-f1/repos",
      "events_url": "https://api.github.com/users/j-f1/events{/privacy}",
      "received_events_url": "https://api.github.com/users/j-f1/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/j-f1/eslint-docs",
    "description": "Keep your rule names and descriptions up-to-date across your repo",
    "fork": false,
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "forks_url": "https://api.github.com/repos/j-f1/eslint-docs/forks",
    "keys_url": "https://api.github.com/repos/j-f1/eslint-docs/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/j-f1/eslint-docs/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/j-f1/eslint-docs/teams",
    "hooks_url": "https://api.github.com/repos/j-f1/eslint-docs/hooks",
    "issue_events_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/events{/number}",
    "events_url": "https://api.github.com/repos/j-f1/eslint-docs/events",
    "assignees_url": "https://api.github.com/repos/j-f1/eslint-docs/assignees{/user}",
    "branches_url": "https://api.github.com/repos/j-f1/eslint-docs/branches{/branch}",
    "tags_url": "https://api.github.com/repos/j-f1/eslint-docs/tags",
    "blobs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/j-f1/eslint-docs/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/j-f1/eslint-docs/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/j-f1/eslint-docs/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/j-f1/eslint-docs/languages",
    "stargazers_url": "https://api.github.com/repos/j-f1/eslint-docs/stargazers",
    "contributors_url": "https://api.github.com/repos/j-f1/eslint-docs/contributors",
    "subscribers_url": "https://api.github.com/repos/j-f1/eslint-docs/subscribers",
    "subscription_url": "https://api.github.com/repos/j-f1/eslint-docs/subscription",
    "commits_url": "https://api.github.com/repos/j-f1/eslint-docs/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/j-f1/eslint-docs/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/j-f1/eslint-docs/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/j-f1/eslint-docs/contents/{+path}",
    "compare_url": "https://api.github.com/repos/j-f1/eslint-docs/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/j-f1/eslint-docs/merges",
    "archive_url": "https://api.github.com/repos/j-f1/eslint-docs/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/j-f1/eslint-docs/downloads",
    "issues_url": "https://api.github.com/repos/j-f1/eslint-docs/issues{/number}",
    "pulls_url": "https://api.github.com/repos/j-f1/eslint-docs/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/j-f1/eslint-docs/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/j-f1/eslint-docs/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/j-f1/eslint-docs/labels{/name}",
    "releases_url": "https://api.github.com/repos/j-f1/eslint-docs/releases{/id}",
    "deployments_url": "https://api.github.com/repos/j-f1/eslint-docs/deployments"
  },
  "url": "https://api.github.com/notifications/threads/328706116",
  "subscription_url": "https://api.github.com/notifications/threads/328706116/subscription"
}

All 3 comments

@BasThomas I鈥檓 down to ignore but maybe we can handle the error internally and log it? Then we can detect breaking stuff.

I think we can just update the notification model to fallback on unknown notification types?

Sent with GitHawk

Yeah, should definitely log.

Here鈥檚 some JSON for you:

/repos/:slug/notifications

{
  "id": "328706116",
  "unread": false,
  "reason": "security_alert",
  "updated_at": "2018-04-26T15:25:17Z",
  "last_read_at": "2018-04-27T00:34:20Z",
  "subject": {
    "title": "Potential security vulnerability found in the hoek dependency",
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "latest_comment_url": "https://api.github.com/repos/j-f1/eslint-docs",
    "type": "RepositoryVulnerabilityAlert"
  },
  "repository": {
    "id": 100884355,
    "name": "eslint-docs",
    "full_name": "j-f1/eslint-docs",
    "owner": {
      "login": "j-f1",
      "id": 25517624,
      "avatar_url": "https://avatars2.githubusercontent.com/u/25517624?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/j-f1",
      "html_url": "https://github.com/j-f1",
      "followers_url": "https://api.github.com/users/j-f1/followers",
      "following_url": "https://api.github.com/users/j-f1/following{/other_user}",
      "gists_url": "https://api.github.com/users/j-f1/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/j-f1/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/j-f1/subscriptions",
      "organizations_url": "https://api.github.com/users/j-f1/orgs",
      "repos_url": "https://api.github.com/users/j-f1/repos",
      "events_url": "https://api.github.com/users/j-f1/events{/privacy}",
      "received_events_url": "https://api.github.com/users/j-f1/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/j-f1/eslint-docs",
    "description": "Keep your rule names and descriptions up-to-date across your repo",
    "fork": false,
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "forks_url": "https://api.github.com/repos/j-f1/eslint-docs/forks",
    "keys_url": "https://api.github.com/repos/j-f1/eslint-docs/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/j-f1/eslint-docs/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/j-f1/eslint-docs/teams",
    "hooks_url": "https://api.github.com/repos/j-f1/eslint-docs/hooks",
    "issue_events_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/events{/number}",
    "events_url": "https://api.github.com/repos/j-f1/eslint-docs/events",
    "assignees_url": "https://api.github.com/repos/j-f1/eslint-docs/assignees{/user}",
    "branches_url": "https://api.github.com/repos/j-f1/eslint-docs/branches{/branch}",
    "tags_url": "https://api.github.com/repos/j-f1/eslint-docs/tags",
    "blobs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/j-f1/eslint-docs/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/j-f1/eslint-docs/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/j-f1/eslint-docs/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/j-f1/eslint-docs/languages",
    "stargazers_url": "https://api.github.com/repos/j-f1/eslint-docs/stargazers",
    "contributors_url": "https://api.github.com/repos/j-f1/eslint-docs/contributors",
    "subscribers_url": "https://api.github.com/repos/j-f1/eslint-docs/subscribers",
    "subscription_url": "https://api.github.com/repos/j-f1/eslint-docs/subscription",
    "commits_url": "https://api.github.com/repos/j-f1/eslint-docs/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/j-f1/eslint-docs/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/j-f1/eslint-docs/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/j-f1/eslint-docs/contents/{+path}",
    "compare_url": "https://api.github.com/repos/j-f1/eslint-docs/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/j-f1/eslint-docs/merges",
    "archive_url": "https://api.github.com/repos/j-f1/eslint-docs/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/j-f1/eslint-docs/downloads",
    "issues_url": "https://api.github.com/repos/j-f1/eslint-docs/issues{/number}",
    "pulls_url": "https://api.github.com/repos/j-f1/eslint-docs/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/j-f1/eslint-docs/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/j-f1/eslint-docs/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/j-f1/eslint-docs/labels{/name}",
    "releases_url": "https://api.github.com/repos/j-f1/eslint-docs/releases{/id}",
    "deployments_url": "https://api.github.com/repos/j-f1/eslint-docs/deployments"
  },
  "url": "https://api.github.com/notifications/threads/328706116",
  "subscription_url": "https://api.github.com/notifications/threads/328706116/subscription"
}

/notifications/threads/:id

{
  "id": "328706116",
  "unread": false,
  "reason": "security_alert",
  "updated_at": "2018-04-26T15:25:17Z",
  "last_read_at": null,
  "subject": {
    "title": "Potential security vulnerability found in the hoek dependency",
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "latest_comment_url": "https://api.github.com/repos/j-f1/eslint-docs",
    "type": "RepositoryVulnerabilityAlert"
  },
  "repository": {
    "id": 100884355,
    "name": "eslint-docs",
    "full_name": "j-f1/eslint-docs",
    "owner": {
      "login": "j-f1",
      "id": 25517624,
      "avatar_url": "https://avatars2.githubusercontent.com/u/25517624?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/j-f1",
      "html_url": "https://github.com/j-f1",
      "followers_url": "https://api.github.com/users/j-f1/followers",
      "following_url": "https://api.github.com/users/j-f1/following{/other_user}",
      "gists_url": "https://api.github.com/users/j-f1/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/j-f1/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/j-f1/subscriptions",
      "organizations_url": "https://api.github.com/users/j-f1/orgs",
      "repos_url": "https://api.github.com/users/j-f1/repos",
      "events_url": "https://api.github.com/users/j-f1/events{/privacy}",
      "received_events_url": "https://api.github.com/users/j-f1/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/j-f1/eslint-docs",
    "description": "Keep your rule names and descriptions up-to-date across your repo",
    "fork": false,
    "url": "https://api.github.com/repos/j-f1/eslint-docs",
    "forks_url": "https://api.github.com/repos/j-f1/eslint-docs/forks",
    "keys_url": "https://api.github.com/repos/j-f1/eslint-docs/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/j-f1/eslint-docs/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/j-f1/eslint-docs/teams",
    "hooks_url": "https://api.github.com/repos/j-f1/eslint-docs/hooks",
    "issue_events_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/events{/number}",
    "events_url": "https://api.github.com/repos/j-f1/eslint-docs/events",
    "assignees_url": "https://api.github.com/repos/j-f1/eslint-docs/assignees{/user}",
    "branches_url": "https://api.github.com/repos/j-f1/eslint-docs/branches{/branch}",
    "tags_url": "https://api.github.com/repos/j-f1/eslint-docs/tags",
    "blobs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/j-f1/eslint-docs/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/j-f1/eslint-docs/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/j-f1/eslint-docs/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/j-f1/eslint-docs/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/j-f1/eslint-docs/languages",
    "stargazers_url": "https://api.github.com/repos/j-f1/eslint-docs/stargazers",
    "contributors_url": "https://api.github.com/repos/j-f1/eslint-docs/contributors",
    "subscribers_url": "https://api.github.com/repos/j-f1/eslint-docs/subscribers",
    "subscription_url": "https://api.github.com/repos/j-f1/eslint-docs/subscription",
    "commits_url": "https://api.github.com/repos/j-f1/eslint-docs/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/j-f1/eslint-docs/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/j-f1/eslint-docs/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/j-f1/eslint-docs/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/j-f1/eslint-docs/contents/{+path}",
    "compare_url": "https://api.github.com/repos/j-f1/eslint-docs/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/j-f1/eslint-docs/merges",
    "archive_url": "https://api.github.com/repos/j-f1/eslint-docs/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/j-f1/eslint-docs/downloads",
    "issues_url": "https://api.github.com/repos/j-f1/eslint-docs/issues{/number}",
    "pulls_url": "https://api.github.com/repos/j-f1/eslint-docs/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/j-f1/eslint-docs/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/j-f1/eslint-docs/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/j-f1/eslint-docs/labels{/name}",
    "releases_url": "https://api.github.com/repos/j-f1/eslint-docs/releases{/id}",
    "deployments_url": "https://api.github.com/repos/j-f1/eslint-docs/deployments"
  },
  "url": "https://api.github.com/notifications/threads/328706116",
  "subscription_url": "https://api.github.com/notifications/threads/328706116/subscription"
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnystrom picture rnystrom  路  3Comments

rnystrom picture rnystrom  路  3Comments

BasThomas picture BasThomas  路  3Comments

rnystrom picture rnystrom  路  3Comments

rnystrom picture rnystrom  路  3Comments