-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add pull requests #48
Conversation
ref #46 |
Sorry for not looking at this sooner, trying it out now - pull request looks great! |
"mergeable": null, | ||
"rebaseable": null, | ||
"mergeable_state": "unknown", | ||
"merged_by": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running this should create a merged_by
column on the pull_requests
table which is a foreign key to the users
table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice eye. This is a little misleading. The merged by field is only available for specified PRs (singular), which is how I generated this. There are a different set of keys when requesting PRs (plural) via the API. Happy to modify the payload here, but merged_by is not included. For reference, here is a gist of what the first PR from the pull-requests request looks like.
tests/test_pull_requests.py
Outdated
'mergeable': None, | ||
'rebaseable': None, | ||
'mergeable_state': 'unknown', | ||
'merged_by': '{"login": "simonw", "id": 9599, "node_id": "MDQ6VXNlcjk1OTk=", "avatar_url": "https://avatars0.githubusercontent.com/u/9599?v=4", "gravatar_id": "", "url": "https://api.github.com/users/simonw", "html_url": "https://github.com/simonw", "followers_url": "https://api.github.com/users/simonw/followers", "following_url": "https://api.github.com/users/simonw/following{/other_user}", "gists_url": "https://api.github.com/users/simonw/gists{/gist_id}", "starred_url": "https://api.github.com/users/simonw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonw/subscriptions", "organizations_url": "https://api.github.com/users/simonw/orgs", "repos_url": "https://api.github.com/users/simonw/repos", "events_url": "https://api.github.com/users/simonw/events{/privacy}", "received_events_url": "https://api.github.com/users/simonw/received_events", "type": "User", "site_admin": false}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above - this should be 9599, an integer reference to the row in the users table.
4f33b85
to
3a0d5c4
Compare
Also fixed a bug with --issue and --pull-request introduced in fa5aa9e
ref #46
Issues don't have merge information on them, which means that PRs need to be pulled separately.
Did my best to mimic the API of issues.