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

Add pull requests #48

Merged
merged 2 commits into from
Nov 29, 2020
Merged

Add pull requests #48

merged 2 commits into from
Nov 29, 2020

Conversation

adamjonas
Copy link
Contributor

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.

@adamjonas
Copy link
Contributor Author

ref #46

@simonw
Copy link
Collaborator

simonw commented Oct 6, 2020

Sorry for not looking at this sooner, trying it out now - pull request looks great!

"mergeable": null,
"rebaseable": null,
"mergeable_state": "unknown",
"merged_by": {
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

'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}',
Copy link
Collaborator

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.

tests/test_pull_requests.py Outdated Show resolved Hide resolved
@simonw simonw merged commit b37f555 into dogsheep:main Nov 29, 2020
simonw added a commit that referenced this pull request Nov 30, 2020
simonw added a commit that referenced this pull request Nov 30, 2020
Also fixed a bug with --issue and --pull-request introduced in fa5aa9e
simonw added a commit that referenced this pull request Nov 30, 2020
simonw added a commit that referenced this pull request Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants