Skip to content

Export headers in GithubException#1887

Merged
s-t-e-v-e-n-k merged 1 commit intoPyGithub:masterfrom
s-t-e-v-e-n-k:sprinkle-headers-in-exception
Mar 23, 2021
Merged

Export headers in GithubException#1887
s-t-e-v-e-n-k merged 1 commit intoPyGithub:masterfrom
s-t-e-v-e-n-k:sprinkle-headers-in-exception

Conversation

@s-t-e-v-e-n-k
Copy link
Copy Markdown
Collaborator

Since the headers that led to an exception are also useful, firstly pass
them into the constructor, and then export them in a property. Test one
specific use case to make sure of coverage.

Fixes #1814

Since the headers that led to an exception are also useful, firstly pass
them into the constructor, and then export them in a property. Test one
specific use case to make sure of coverage.

Fixes PyGithub#1814
@s-t-e-v-e-n-k s-t-e-v-e-n-k merged commit ddd437a into PyGithub:master Mar 23, 2021
@sbesson
Copy link
Copy Markdown
Contributor

sbesson commented Apr 26, 2021

Hi @s-t-e-v-e-n-k, just came across this as PyGithub 1.55 got released yesterday and our calls to GitHubException constructors started failing. One suggestion: at the moment, this is listed under Bug Fixes & Improvements in https://github.com/PyGithub/PyGithub/blob/v1.55/doc/changes.rst but I suspect it might be worth mentioning in Breaking Changes as well since client code will need to be adjusted to pass an extra field.

@s-t-e-v-e-n-k
Copy link
Copy Markdown
Collaborator Author

Good point, I'll edit the release notes

TomasTomecek added a commit to TomasTomecek/packit-service that referenced this pull request Apr 28, 2021
We need to update how we mock GithubException since 1.55 it now accepts
HTTP headers in form of a positional argument as well:

PyGithub/PyGithub#1887

Kudos @lbarcziova

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
TomasTomecek added a commit to TomasTomecek/packit-service that referenced this pull request Apr 28, 2021
We need to update how we mock GithubException since 1.55 it now accepts
HTTP headers in form of a positional argument as well:

PyGithub/PyGithub#1887

This is implemented with inspect.signature so our tests work for both
versions of pygithub <1.55 and >=1.55 because 1.55 is not in stable
Fedora yet.

Kudos @lbarcziova

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
softwarefactory-project-zuul bot added a commit to packit/packit-service that referenced this pull request Apr 28, 2021
tests: GithubException now accepts also headers

We need to update how we mock GithubException since 1.55 it now accepts
HTTP headers in form of a positional argument as well:
PyGithub/PyGithub#1887
Kudos @lbarcziova

Reviewed-by: None <None>
Reviewed-by: Laura Barcziová <None>
sergeyklay added a commit to sergeyklay/gstore that referenced this pull request Jun 6, 2021
@s-t-e-v-e-n-k s-t-e-v-e-n-k deleted the sprinkle-headers-in-exception branch October 21, 2021 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling hitting abuse detection limits and using Retry-After

2 participants