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

IssueEvent misses important properties #302

Closed
nomeata opened this issue Nov 12, 2017 · 3 comments
Closed

IssueEvent misses important properties #302

nomeata opened this issue Nov 12, 2017 · 3 comments

Comments

@nomeata
Copy link

nomeata commented Nov 12, 2017

Consider

$ curl -u nomeata:TOKEN https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/51/events
[
  {
    "id": 1096640569,
    "url": "https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/events/1096640569",
    "actor": {
      "login": "nomeata",
      "id": 148037,
      "avatar_url": "https://avatars2.githubusercontent.com/u/148037?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/nomeata",
      "html_url": "https://github.com/nomeata",
      "followers_url": "https://api.github.com/users/nomeata/followers",
      "following_url": "https://api.github.com/users/nomeata/following{/other_user}",
      "gists_url": "https://api.github.com/users/nomeata/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/nomeata/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/nomeata/subscriptions",
      "organizations_url": "https://api.github.com/users/nomeata/orgs",
      "repos_url": "https://api.github.com/users/nomeata/repos",
      "events_url": "https://api.github.com/users/nomeata/events{/privacy}",
      "received_events_url": "https://api.github.com/users/nomeata/received_events",
      "type": "User",
      "site_admin": false
    },
    "event": "labeled",
    "commit_id": null,
    "commit_url": null,
    "created_at": "2017-05-25T02:16:56Z",
    "label": {
      "name": "dormant",
      "color": "aadddd"
    }
  }
]

The important information is in the optional label attribute. But github does not include that:

[IssueEvent {issueEventActor = SimpleUser {simpleUserId = Id 148037, simpleUserLogin = N "nomeata", simpleUserAvatarUrl = URL "https://avatars2.githubusercontent.com/u/148037?v=4", simpleUserUrl = URL "https://api.github.com/users/nomeata"}, issueEventType = Labeled, issueEventCommitId = Nothing, issueEventUrl = URL "https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/events/1096640569", issueEventCreatedAt = 2017-05-25 02:16:56 UTC, issueEventId = 1096640569, issueEventIssue = Nothing}]

Is there a way I could get hold of the label using the github bindings?

@phadej
Copy link
Contributor

phadej commented Nov 13, 2017

Especially event types lack many fields, I'm more than happy to merge PRs adding missing fields.

@kvanbere
Copy link

kvanbere commented Dec 2, 2017

Additionally, Repo parses "created_at" as UTCTime but on some of the webhook events they are returned as either UTCTime or Number interchangeably (wth?) so an Aeson parsing error occurs on account of this occasionally.

@phadej
Copy link
Contributor

phadej commented Feb 19, 2018

@nomeata sorry for making you wait for so long. https://hackage.haskell.org/package/github-0.19 has this and #301 fixed.

brendanhay pushed a commit to FormationAI/github that referenced this issue Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants