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

New activity events not being deserialized correctly #1251

Closed
shiftkey opened this issue Apr 7, 2016 · 5 comments
Closed

New activity events not being deserialized correctly #1251

shiftkey opened this issue Apr 7, 2016 · 5 comments
Labels
Type: Bug Something isn't working as documented

Comments

@shiftkey
Copy link
Member

shiftkey commented Apr 7, 2016

Found while testing #1240 - the lack of type on these is why the test is failing due to us incorrectly deserializing the payload:

@shiftkey
Copy link
Member Author

Here's some example events that I've found which break our current code for parsing activities...

  • A subscription event:
{
  "id": 691197253,
  "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/events\/691197253",
  "actor": {
    "login": "ryangribble",
    "id": 5425163,
    "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/5425163?v=3",
    "gravatar_id": "",
    "url": "https:\/\/api.github.com\/users\/ryangribble",
    "html_url": "https:\/\/github.com\/ryangribble",
    "followers_url": "https:\/\/api.github.com\/users\/ryangribble\/followers",
    "following_url": "https:\/\/api.github.com\/users\/ryangribble\/following{\/other_user}",
    "gists_url": "https:\/\/api.github.com\/users\/ryangribble\/gists{\/gist_id}",
    "starred_url": "https:\/\/api.github.com\/users\/ryangribble\/starred{\/owner}{\/repo}",
    "subscriptions_url": "https:\/\/api.github.com\/users\/ryangribble\/subscriptions",
    "organizations_url": "https:\/\/api.github.com\/users\/ryangribble\/orgs",
    "repos_url": "https:\/\/api.github.com\/users\/ryangribble\/repos",
    "events_url": "https:\/\/api.github.com\/users\/ryangribble\/events{\/privacy}",
    "received_events_url": "https:\/\/api.github.com\/users\/ryangribble\/received_events",
    "type": "User",
    "site_admin": false
  },
  "event": "subscribed",
  "commit_id": null,
  "commit_url": null,
  "created_at": "2016-06-14T00:31:49Z",
  "issue": {
    "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377",
    "repository_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net",
    "labels_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377\/labels{\/name}",
    "comments_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377\/comments",
    "events_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377\/events",
    "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377",
    "id": 160073758,
    "number": 1377,
    "title": "v0.20 - Probably Australian",
    "user": {
      "login": "shiftkey",
      "id": 359239,
      "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/359239?v=3",
      "gravatar_id": "",
      "url": "https:\/\/api.github.com\/users\/shiftkey",
      "html_url": "https:\/\/github.com\/shiftkey",
      "followers_url": "https:\/\/api.github.com\/users\/shiftkey\/followers",
      "following_url": "https:\/\/api.github.com\/users\/shiftkey\/following{\/other_user}",
      "gists_url": "https:\/\/api.github.com\/users\/shiftkey\/gists{\/gist_id}",
      "starred_url": "https:\/\/api.github.com\/users\/shiftkey\/starred{\/owner}{\/repo}",
      "subscriptions_url": "https:\/\/api.github.com\/users\/shiftkey\/subscriptions",
      "organizations_url": "https:\/\/api.github.com\/users\/shiftkey\/orgs",
      "repos_url": "https:\/\/api.github.com\/users\/shiftkey\/repos",
      "events_url": "https:\/\/api.github.com\/users\/shiftkey\/events{\/privacy}",
      "received_events_url": "https:\/\/api.github.com\/users\/shiftkey\/received_events",
      "type": "User",
      "site_admin": true
    },
    "labels": [

    ],
    "state": "open",
    "locked": false,
    "assignee": null,
    "milestone": null,
    "comments": 0,
    "created_at": "2016-06-14T00:31:49Z",
    "updated_at": "2016-06-14T01:37:00Z",
    "closed_at": null,
    "pull_request": {
      "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/pulls\/1377",
      "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377",
      "diff_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377.diff",
      "patch_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377.patch"
    },
    "body": "- [x] release notes\r\n- [x] version bump\r\n- [ ] integration tests all pass\r\n- [ ] :thumbsup: from @Haacked or @ryangribble \r\n- [ ] tag and publish to NuGet\r\n- [ ] :shipit:"
  }
}
  • A mentioned event:
{
  "id": 691197252,
  "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/events\/691197252",
  "actor": {
    "login": "ryangribble",
    "id": 5425163,
    "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/5425163?v=3",
    "gravatar_id": "",
    "url": "https:\/\/api.github.com\/users\/ryangribble",
    "html_url": "https:\/\/github.com\/ryangribble",
    "followers_url": "https:\/\/api.github.com\/users\/ryangribble\/followers",
    "following_url": "https:\/\/api.github.com\/users\/ryangribble\/following{\/other_user}",
    "gists_url": "https:\/\/api.github.com\/users\/ryangribble\/gists{\/gist_id}",
    "starred_url": "https:\/\/api.github.com\/users\/ryangribble\/starred{\/owner}{\/repo}",
    "subscriptions_url": "https:\/\/api.github.com\/users\/ryangribble\/subscriptions",
    "organizations_url": "https:\/\/api.github.com\/users\/ryangribble\/orgs",
    "repos_url": "https:\/\/api.github.com\/users\/ryangribble\/repos",
    "events_url": "https:\/\/api.github.com\/users\/ryangribble\/events{\/privacy}",
    "received_events_url": "https:\/\/api.github.com\/users\/ryangribble\/received_events",
    "type": "User",
    "site_admin": false
  },
  "event": "mentioned",
  "commit_id": null,
  "commit_url": null,
  "created_at": "2016-06-14T00:31:49Z",
  "issue": {
    "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377",
    "repository_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net",
    "labels_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377\/labels{\/name}",
    "comments_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377\/comments",
    "events_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1377\/events",
    "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377",
    "id": 160073758,
    "number": 1377,
    "title": "v0.20 - Probably Australian",
    "user": {
      "login": "shiftkey",
      "id": 359239,
      "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/359239?v=3",
      "gravatar_id": "",
      "url": "https:\/\/api.github.com\/users\/shiftkey",
      "html_url": "https:\/\/github.com\/shiftkey",
      "followers_url": "https:\/\/api.github.com\/users\/shiftkey\/followers",
      "following_url": "https:\/\/api.github.com\/users\/shiftkey\/following{\/other_user}",
      "gists_url": "https:\/\/api.github.com\/users\/shiftkey\/gists{\/gist_id}",
      "starred_url": "https:\/\/api.github.com\/users\/shiftkey\/starred{\/owner}{\/repo}",
      "subscriptions_url": "https:\/\/api.github.com\/users\/shiftkey\/subscriptions",
      "organizations_url": "https:\/\/api.github.com\/users\/shiftkey\/orgs",
      "repos_url": "https:\/\/api.github.com\/users\/shiftkey\/repos",
      "events_url": "https:\/\/api.github.com\/users\/shiftkey\/events{\/privacy}",
      "received_events_url": "https:\/\/api.github.com\/users\/shiftkey\/received_events",
      "type": "User",
      "site_admin": true
    },
    "labels": [

    ],
    "state": "open",
    "locked": false,
    "assignee": null,
    "milestone": null,
    "comments": 0,
    "created_at": "2016-06-14T00:31:49Z",
    "updated_at": "2016-06-14T01:37:00Z",
    "closed_at": null,
    "pull_request": {
      "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/pulls\/1377",
      "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377",
      "diff_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377.diff",
      "patch_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1377.patch"
    },
    "body": "- [x] release notes\r\n- [x] version bump\r\n- [ ] integration tests all pass\r\n- [ ] :thumbsup: from @Haacked or @ryangribble \r\n- [ ] tag and publish to NuGet\r\n- [ ] :shipit:"
  }
}
  • A head ref deleted (associated with a PR?):
{
  "id": 691192852,
  "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/events\/691192852",
  "actor": {
    "login": "shiftkey",
    "id": 359239,
    "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/359239?v=3",
    "gravatar_id": "",
    "url": "https:\/\/api.github.com\/users\/shiftkey",
    "html_url": "https:\/\/github.com\/shiftkey",
    "followers_url": "https:\/\/api.github.com\/users\/shiftkey\/followers",
    "following_url": "https:\/\/api.github.com\/users\/shiftkey\/following{\/other_user}",
    "gists_url": "https:\/\/api.github.com\/users\/shiftkey\/gists{\/gist_id}",
    "starred_url": "https:\/\/api.github.com\/users\/shiftkey\/starred{\/owner}{\/repo}",
    "subscriptions_url": "https:\/\/api.github.com\/users\/shiftkey\/subscriptions",
    "organizations_url": "https:\/\/api.github.com\/users\/shiftkey\/orgs",
    "repos_url": "https:\/\/api.github.com\/users\/shiftkey\/repos",
    "events_url": "https:\/\/api.github.com\/users\/shiftkey\/events{\/privacy}",
    "received_events_url": "https:\/\/api.github.com\/users\/shiftkey\/received_events",
    "type": "User",
    "site_admin": true
  },
  "event": "head_ref_deleted",
  "commit_id": null,
  "commit_url": null,
  "created_at": "2016-06-14T00:24:31Z",
  "issue": {
    "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376",
    "repository_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net",
    "labels_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376\/labels{\/name}",
    "comments_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376\/comments",
    "events_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376\/events",
    "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376",
    "id": 160071899,
    "number": 1376,
    "title": "lock to an earlier version of mono",
    "user": {
      "login": "shiftkey",
      "id": 359239,
      "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/359239?v=3",
      "gravatar_id": "",
      "url": "https:\/\/api.github.com\/users\/shiftkey",
      "html_url": "https:\/\/github.com\/shiftkey",
      "followers_url": "https:\/\/api.github.com\/users\/shiftkey\/followers",
      "following_url": "https:\/\/api.github.com\/users\/shiftkey\/following{\/other_user}",
      "gists_url": "https:\/\/api.github.com\/users\/shiftkey\/gists{\/gist_id}",
      "starred_url": "https:\/\/api.github.com\/users\/shiftkey\/starred{\/owner}{\/repo}",
      "subscriptions_url": "https:\/\/api.github.com\/users\/shiftkey\/subscriptions",
      "organizations_url": "https:\/\/api.github.com\/users\/shiftkey\/orgs",
      "repos_url": "https:\/\/api.github.com\/users\/shiftkey\/repos",
      "events_url": "https:\/\/api.github.com\/users\/shiftkey\/events{\/privacy}",
      "received_events_url": "https:\/\/api.github.com\/users\/shiftkey\/received_events",
      "type": "User",
      "site_admin": true
    },
    "labels": [

    ],
    "state": "closed",
    "locked": false,
    "assignee": null,
    "milestone": null,
    "comments": 0,
    "created_at": "2016-06-14T00:12:21Z",
    "updated_at": "2016-06-14T00:24:29Z",
    "closed_at": "2016-06-14T00:24:29Z",
    "pull_request": {
      "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/pulls\/1376",
      "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376",
      "diff_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376.diff",
      "patch_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376.patch"
    },
    "body": "Travis is currently in an interesting spot where `latest` means it'll use Mono **4.4.0** when building and testing on OS X, and **4.2.3** when building and testing on Linux.\r\n\r\nUnfortunately this means the OS X builds are exhibiting some strange behaviour:\r\n\r\n - a [wall of Chinese text](https:\/\/twitter.com\/shiftkey\/status\/742500043769274369) in the `BuildMono` step\r\n - `* Assertion at metadata.c:3643, condition 'ptr' not met` when running the PCL tests\r\n\r\nExample build output: https:\/\/travis-ci.org\/octokit\/octokit.net\/jobs\/137385011\r\n\r\nI found the flag to force a specific version of Mono for both platforms, and that seems to do the trick here.\r\n\r\n@dampir @ErikSchierboom @shaggygi @alfhenrik @maddin2016 I think you're all encountering this on your PRs, feel free to merge `master` or cherry-pick this commit into your branch after I confirm this resolves the issue."
  }
}
  • A PR has been closed (this one was merged):
{
  "id": 691192839,
  "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/events\/691192839",
  "actor": {
    "login": "shiftkey",
    "id": 359239,
    "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/359239?v=3",
    "gravatar_id": "",
    "url": "https:\/\/api.github.com\/users\/shiftkey",
    "html_url": "https:\/\/github.com\/shiftkey",
    "followers_url": "https:\/\/api.github.com\/users\/shiftkey\/followers",
    "following_url": "https:\/\/api.github.com\/users\/shiftkey\/following{\/other_user}",
    "gists_url": "https:\/\/api.github.com\/users\/shiftkey\/gists{\/gist_id}",
    "starred_url": "https:\/\/api.github.com\/users\/shiftkey\/starred{\/owner}{\/repo}",
    "subscriptions_url": "https:\/\/api.github.com\/users\/shiftkey\/subscriptions",
    "organizations_url": "https:\/\/api.github.com\/users\/shiftkey\/orgs",
    "repos_url": "https:\/\/api.github.com\/users\/shiftkey\/repos",
    "events_url": "https:\/\/api.github.com\/users\/shiftkey\/events{\/privacy}",
    "received_events_url": "https:\/\/api.github.com\/users\/shiftkey\/received_events",
    "type": "User",
    "site_admin": true
  },
  "event": "closed",
  "commit_id": null,
  "commit_url": null,
  "created_at": "2016-06-14T00:24:29Z",
  "issue": {
    "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376",
    "repository_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net",
    "labels_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376\/labels{\/name}",
    "comments_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376\/comments",
    "events_url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/issues\/1376\/events",
    "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376",
    "id": 160071899,
    "number": 1376,
    "title": "lock to an earlier version of mono",
    "user": {
      "login": "shiftkey",
      "id": 359239,
      "avatar_url": "https:\/\/avatars.githubusercontent.com\/u\/359239?v=3",
      "gravatar_id": "",
      "url": "https:\/\/api.github.com\/users\/shiftkey",
      "html_url": "https:\/\/github.com\/shiftkey",
      "followers_url": "https:\/\/api.github.com\/users\/shiftkey\/followers",
      "following_url": "https:\/\/api.github.com\/users\/shiftkey\/following{\/other_user}",
      "gists_url": "https:\/\/api.github.com\/users\/shiftkey\/gists{\/gist_id}",
      "starred_url": "https:\/\/api.github.com\/users\/shiftkey\/starred{\/owner}{\/repo}",
      "subscriptions_url": "https:\/\/api.github.com\/users\/shiftkey\/subscriptions",
      "organizations_url": "https:\/\/api.github.com\/users\/shiftkey\/orgs",
      "repos_url": "https:\/\/api.github.com\/users\/shiftkey\/repos",
      "events_url": "https:\/\/api.github.com\/users\/shiftkey\/events{\/privacy}",
      "received_events_url": "https:\/\/api.github.com\/users\/shiftkey\/received_events",
      "type": "User",
      "site_admin": true
    },
    "labels": [

    ],
    "state": "closed",
    "locked": false,
    "assignee": null,
    "milestone": null,
    "comments": 0,
    "created_at": "2016-06-14T00:12:21Z",
    "updated_at": "2016-06-14T00:24:29Z",
    "closed_at": "2016-06-14T00:24:29Z",
    "pull_request": {
      "url": "https:\/\/api.github.com\/repos\/octokit\/octokit.net\/pulls\/1376",
      "html_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376",
      "diff_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376.diff",
      "patch_url": "https:\/\/github.com\/octokit\/octokit.net\/pull\/1376.patch"
    },
    "body": "Travis is currently in an interesting spot where `latest` means it'll use Mono **4.4.0** when building and testing on OS X, and **4.2.3** when building and testing on Linux.\r\n\r\nUnfortunately this means the OS X builds are exhibiting some strange behaviour:\r\n\r\n - a [wall of Chinese text](https:\/\/twitter.com\/shiftkey\/status\/742500043769274369) in the `BuildMono` step\r\n - `* Assertion at metadata.c:3643, condition 'ptr' not met` when running the PCL tests\r\n\r\nExample build output: https:\/\/travis-ci.org\/octokit\/octokit.net\/jobs\/137385011\r\n\r\nI found the flag to force a specific version of Mono for both platforms, and that seems to do the trick here.\r\n\r\n@dampir @ErikSchierboom @shaggygi @alfhenrik @maddin2016 I think you're all encountering this on your PRs, feel free to merge `master` or cherry-pick this commit into your branch after I confirm this resolves the issue."
  }
}

@shiftkey
Copy link
Member Author

I think we need to review and/or revamp this area of the code - there's lots of values here that don't seem to be deserializing correctly even after you hack around the missing field that triggers the crash, so perhaps we need to rethink how to go about this...

@shiftkey
Copy link
Member Author

shiftkey commented Oct 4, 2016

I've disabled the integration tests around this code in 0f90d20 - if someone wants to start digging into this, I'd look at getting those running again.

@ryangribble
Copy link
Contributor

Just as an FYI I tried unskipping the tests originally skipped in #1374 (that issue was closed in favour of this issue)... and found that they are now passing. Not sure if that is ALL the impacted tests that are being talked about here, or just some...

See 2f0ca4a for the tests that have been unskipped

@ryangribble
Copy link
Contributor

I've been digging into the Events/Activity area recently and found that #1490 fixed the problem that this issue was tracking, so closing it out

@nickfloyd nickfloyd added Type: Bug Something isn't working as documented and removed category: bug labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

3 participants