Try and fetch manifest from astral-sh/setup-uv@main first#739
Try and fetch manifest from astral-sh/setup-uv@main first#739
astral-sh/setup-uv@main first#739Conversation
| "https://raw.githubusercontent.com/astral-sh/setup-uv/main/version-manifest.json"; | ||
|
|
||
| // Cache for manifest entries to avoid re-fetching | ||
| const manifestCache = new Map<string, ManifestEntry[]>(); |
There was a problem hiding this comment.
When would this become useful? We are determining the desired version only once.
| async function getAvailableVersions(githubToken: string): Promise<string[]> { | ||
| core.info("Getting available versions from GitHub API..."); | ||
| async function getAvailableVersions(): Promise<string[]> { | ||
| // 1. Try remote manifest first (no rate limits, always current) |
There was a problem hiding this comment.
This would remove the fallback to GitHub and treat the manifest on the main branch as the source of truth.
The problem with that is that the manifest is manually updated by me merging (automated) PRs. It could be out of date when a new uv version is released and I have not yet merged the PR for it.
Determining the latest version or the greatest matching a version spec would behave differently then a user would expect.
We would first need to this repo to be automatically updated like https://github.com/astral-sh/uv-pre-commit/
The support is already there:
setup-uv/.github/workflows/update-known-versions.yml
Lines 6 to 7 in 9cfd029
This PR makes
setup-uvfetch the version manifests straight fromhttps://raw.githubusercontent.com/astral-sh/setup-uv/main/version-manifest.jsonfirst, before falling back to the locally bundled version of that file.Notably, we no longer use GitHub APIs to fetch version information, which fixes #325.
Note
This is a stopgap to fix #325 and give time to polish something more sophisticated like #737
Test plan
https://github.com/zsol/test-setup-uv/actions/runs/21246431004 runs this branch of the action in various scenarios (shamelessly stolen from @zanieb, thank you :) )