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

[FEAT]: Requests returning HTTP 410 Gone should not be retried #620

Closed
1 task done
camchenry opened this issue Mar 18, 2025 · 7 comments · Fixed by #621
Closed
1 task done

[FEAT]: Requests returning HTTP 410 Gone should not be retried #620

camchenry opened this issue Mar 18, 2025 · 7 comments · Fixed by #621
Labels
released Type: Feature New feature or request

Comments

@camchenry
Copy link
Contributor

camchenry commented Mar 18, 2025

Describe the need

As part of the Projects (classic) sunset, these REST APIs are returning HTTP 410 to indicate that the APIs are no longer available.

According to the spec for the 410 status code, this is mechanically very similar to HTTP 404 and the recommendation is to even cache the request:

The 410 (Gone) status code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent. If the origin server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) ought to be used instead.
[...]
A 410 response is heuristically cacheable; i.e., unless otherwise indicated by the method definition or explicit cache controls (see Section 4.2.2 of [CACHING]).

https://www.rfc-editor.org/rfc/rfc9110.html#name-410-gone

Based on this information, I believe that requests which return a 410 status code should not be retried, as the server has indicated future requests will also return a 410 temporarily or permanently. This saves on unnecessary network requests, which helps ensure that clients are better able to stay under the API rate limits.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@camchenry camchenry added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Mar 18, 2025
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Mar 18, 2025
@wolfy1339 wolfy1339 removed the Status: Triage This is being looked at and prioritized label Mar 18, 2025
@wolfy1339
Copy link
Member

Thanks for pointing this out, it's a simple one-line fix for this.

A PR for this is welcome!

However please do note that we are currently unable to release any new versions of Octokit packages because GitHub recently clamped down on security and enabled 2FA on our bot token that is used for publishing NPM releases from GitHub actions.

@camchenry camchenry mentioned this issue Mar 18, 2025
4 tasks
@camchenry
Copy link
Contributor Author

@wolfy1339 Thanks! I've opened a PR to resolve this issue: #621

However please do note that we are currently unable to release any new versions of Octokit packages because GitHub recently clamped down on security and enabled 2FA on our bot token that is used for publishing NPM releases from GitHub actions.

Is this something you're actively working on right now? No rush for this feature, but I think it would be a good one to include eventually. Let me know if there's anything I can do to help.

@wolfy1339
Copy link
Member

It's out of my hands, I am only a community maintainer and not a GitHub employee. I did raise this issue with a GitHub employee who is on the Octokit team, and they said they would look into it.
I don't have any contacts at GitHub myself to resolve this.

It especially sucks because we sign our releases using provenance, and that can only be done from CI

🤷‍♂ Here we are...

@camchenry
Copy link
Contributor Author

camchenry commented Mar 18, 2025

@wolfy1339 Do you have all the details on what the exact problem is? Is there an issue that you could point me to? (And if not, would you mind creating one?) I work at GitHub and I would like to help you escalate this. Thank you for helping to maintain Octokit, and apologies for any inconvenience here 🙇

@wolfy1339
Copy link
Member

I created octokit/octokit.js#2829 to track this

@github-project-automation github-project-automation bot moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Active Mar 18, 2025
Copy link

🎉 This issue has been resolved in version 7.2.0 🎉

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: Feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants