Title: GitHub · Where software is built
Open Graph Title: actions/setup-python
X Title: actions/setup-python
Description: Set up your GitHub Actions workflow with a specific version of Python - actions/setup-python
Open Graph Description: Set up your GitHub Actions workflow with a specific version of Python - actions/setup-python
X Description: Set up your GitHub Actions workflow with a specific version of Python - actions/setup-python
Opengraph URL: https://github.com/actions/setup-python
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enhance setup-python Action in GitHub Enterprise Server with Raw API Fallback Mechanism","articleBody":"**Description:**\r\n\r\nIn the context of GitHub Enterprise Server (GHES), it is typical for runners to share the same IP address due to Network Address Translation (NAT). This configuration results in the quick exhaustion of the unauthenticated rate limit (60 requests per hour per IP address) when accessing the `versions-manifest.json` file, leading to failures in the `setup-python` action. The current workaround is to incorporate [a \"github.com\" token into the `setup-python` action](https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#avoiding-rate-limit-issues). Although this solution is functional, it necessitates the creation of an additional github.com token (and technical user) for each repository/team, which is not optimal. Moreover, Pull Requests from forks are not supported due to their lack of access to the secret. \r\n\r\nA potential improvement could be leveraging the `raw` API to retrieve the version-manifest, as it does not impose a rate limit and hence facilitates unrestricted consumption without the need for a token.\r\n\r\n**Justification:**\r\nOur GitHub Enterprise Server has frequently encountered rate limit issues, and the manual token addition method does not scale well. Utilizing the raw API as a fallback could provide an automatic workaround for this issue. If this approach fails, users can still resort to adding a token.\r\n\r\n**Are you willing to submit a PR?**\r\nI have created a fork to verify that the raw API isn't affected by the rate limit and can be used as a fallback solution. (https://github.com/actions/setup-python/compare/main...Shegox:setup-python:raw-access?expand=1)\r\n\r\nThe log extract from the workaround is as follows:\r\n\r\n```\r\n Version 3.10 was not found in the local cache\r\n ##[debug]Getting manifest from actions/python-versions@main\r\n ##[debug]{\"name\":\"HttpClientError\",\"statusCode\":403,\"result\":{\"message\":\"API rate limit exceeded for xx.xx.xx.xx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\"documentation_url\":\"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting\"}}\r\n ##[debug]Fetching via the API failed. Fetching using raw URL.\r\n ##[debug]check 3.13.0-alpha.1 satisfies 3.10\r\n ##[debug]check 3.12.0 satisfies 3.10\r\n ##[debug]check 3.12.0-rc.3 satisfies 3.10\r\n ##[debug]check 3.12.0-rc.2 satisfies 3.10\r\n ##[debug]check 3.12.0-rc.1 satisfies 3.10\r\n```\r\n\r\nI am prepared to submit a PR incorporating the proposed changes. \r\nBefore proposing this PR I wanted to check if that would be accepted or if there are other ideas to overcome this?\r\n\r\n**Related Issues**\r\n\r\n- https://github.com/actions/setup-python/issues/683\r\n- https://github.com/actions/setup-python/issues/638\r\n- https://github.com/actions/setup-python/issues/666\r\n- https://github.com/actions/setup-python/pull/316\r\n- #720 ","author":{"url":"https://github.com/Shegox","@type":"Person","name":"Shegox"},"datePublished":"2023-10-31T12:57:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/756/setup-python/issues/756"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:4af3e0d4-5e31-8005-b28a-f5478f5e804b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B258:87E17:1E6941A:2847E6D:696AFE8B |
| html-safe-nonce | 019e71b8d9ad2336cae4751bf32be6bf52682140f5fdae8def36a2c8ecccf67a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjU4Ojg3RTE3OjFFNjk0MUE6Mjg0N0U2RDo2OTZBRkU4QiIsInZpc2l0b3JfaWQiOiIxMDkyMjE2ODAyNjg1NzA5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3cd86c1cbd827394fecf69d6de2874a6e8fad403da770c68a3a1972f8b46997b |
| hovercard-subject-tag | repository:192625525 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/actions/setup-python/issues/756 |
| twitter:image | https://opengraph.githubassets.com/0ba871f0b442af9d2998e8d0b4f505e600f01ecb2251cacb678c1a6627a049fd/actions/setup-python |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0ba871f0b442af9d2998e8d0b4f505e600f01ecb2251cacb678c1a6627a049fd/actions/setup-python |
| og:image:alt | Set up your GitHub Actions workflow with a specific version of Python - actions/setup-python |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-cache |
| go-import | github.com/actions/setup-python git https://github.com/actions/setup-python.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 192625525 |
| octolytics-dimension-repository_nwo | actions/setup-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 192625525 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width