Skip to content

Conversation

jahands
Copy link
Contributor

@jahands jahands commented Jul 3, 2023

451 is returned when a resource has been restricted for legal reasons. Retrying this status needlessly wastes API quota.
Here's an example: https://api.github.com/repos/amusi/Python3

Resolves #448


Behavior

Before the change?

API calls resulting in status code 451 would be retried
*

After the change?

API calls resulting in status code 451 are no longer retried
*

Other information


Additional info

Pull request checklist

  • [ x] Tests for the changes have been added (for bug fixes / features)
  • [ x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • [x ] No

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug
  • Feature/model/API additions: Type: Feature
  • Updates to docs or samples: Type: Documentation
  • Dependencies/code cleanup: Type: Maintenance

@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented label Jul 3, 2023
@jahands
Copy link
Contributor Author

jahands commented Jul 3, 2023

Test failure looks unrelated to these changes (and it passes locally.) Guessing GitHub Actions was just running a bit slower, causing the timing measured here to be off by 9ms

451 is returned when a resource has been restricted for legal reasons.
Retrying this status needlessly wastes API quota
@jahands jahands force-pushed the fix-do-not-retry-451 branch from bb5db36 to ecfdf9c Compare July 3, 2023 18:12
@jahands
Copy link
Contributor Author

jahands commented Jul 3, 2023

Kicked the commit to try to get tests to run again
edit: Oh, that requires approval from a maintainer 🤦

@wolfy1339 wolfy1339 merged commit 7ae9006 into octokit:main Jul 3, 2023
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

🎉 This PR is included in version 5.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG]: Status code 451 (blocked for legal reasons) should not be retried
2 participants