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 ability to get the list of associated PRs for commit #987

Merged
merged 1 commit into from Aug 20, 2020

Conversation

@dmitrykiselev27
Copy link
Contributor

@dmitrykiselev27 dmitrykiselev27 commented Mar 12, 2020

Use application/vnd.github.groot-preview+json request header to get the list of associated PRs for commit because the endpoint is in preview

@dmitrykiselev27 dmitrykiselev27 force-pushed the dmitrykiselev27:associated_prs branch from 7a4d025 to a901bce Apr 21, 2020
@omgjlk
omgjlk approved these changes Aug 12, 2020
Copy link
Collaborator

@omgjlk omgjlk left a comment

This looks good! I think there's a missing unit test though. If you add that in I think this will be good to go!

@omgjlk
Copy link
Collaborator

@omgjlk omgjlk commented Aug 12, 2020

Oh and you'll need to add yourself as an author. See https://github.com/sigmavirus24/github3.py/blob/master/CONTRIBUTING.rst

@dmitrykiselev27 dmitrykiselev27 force-pushed the dmitrykiselev27:associated_prs branch from a901bce to 5f4d933 Aug 19, 2020
@opendev-zuul
Copy link

@opendev-zuul opendev-zuul bot commented Aug 19, 2020

Build failed (third-party-check pipeline) integration testing on
OpenDev. For information on how to proceed, see
https://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing

@dmitrykiselev27 dmitrykiselev27 force-pushed the dmitrykiselev27:associated_prs branch from 5f4d933 to 77378b9 Aug 19, 2020
@opendev-zuul
Copy link

@opendev-zuul opendev-zuul bot commented Aug 19, 2020

Build failed (third-party-check pipeline) integration testing on
OpenDev. For information on how to proceed, see
https://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing

@@ -139,6 +144,24 @@ def comments(self, number=-1, etag=None):
url = self._build_url("comments", base_url=self._api)
return self._iter(int(number), url, RepoComment, etag=etag)

def associated_prs(self):

This comment has been minimized.

@sigmavirus24

sigmavirus24 Aug 19, 2020
Owner

I'm pretty sure we always want to ensure the user can pass a number here. Even if we can't pass that to the API, we can provide that functionality and this would be one odd method out.

Further, we prefer full names, so this should be associated_pull_requests

@dmitrykiselev27 dmitrykiselev27 force-pushed the dmitrykiselev27:associated_prs branch from 77378b9 to 5db011b Aug 20, 2020
@opendev-zuul
Copy link

@opendev-zuul opendev-zuul bot commented Aug 20, 2020

Build failed (third-party-check pipeline) integration testing on
OpenDev. For information on how to proceed, see
https://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing

@dmitrykiselev27
Copy link
Contributor Author

@dmitrykiselev27 dmitrykiselev27 commented Aug 20, 2020

@omgjlk @sigmavirus24 thanks for the feedback.
I've added missing unit test, changed method name to associated_pull_requests, and added missing parameters.
Also, the branch is up-to-date with master.

@sigmavirus24
Copy link
Owner

@sigmavirus24 sigmavirus24 commented Aug 20, 2020

I'm happy to merge this. Would you be willing to fix the issues in CI around linting?

tests/integration/test_repos_repo.py:979:17: E741 ambiguous variable name 'l'
use application/vnd.github.groot-preview+json request header
to get the list of associated PRs for commit because the endpoint
is in preview
@dmitrykiselev27 dmitrykiselev27 force-pushed the dmitrykiselev27:associated_prs branch from 5db011b to 94d76e3 Aug 20, 2020
@opendev-zuul
Copy link

@opendev-zuul opendev-zuul bot commented Aug 20, 2020

Build failed (third-party-check pipeline) integration testing on
OpenDev. For information on how to proceed, see
https://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing

@sigmavirus24 sigmavirus24 merged commit 197173b into sigmavirus24:master Aug 20, 2020
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
openstack/third-party-check third-party-check status: failure
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.