fix: fall back to distribution ID when os-release has no version field - #961
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ca5dccb21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (id) { | ||
| return id; |
There was a problem hiding this comment.
Defer ID-only fallback until both files are checked
If /etc/os-release exists with only ID while /usr/lib/os-release still contains VERSION_ID, VERSION_CODENAME, or BUILD_ID, this return now short-circuits before the second file is inspected. Since getOSNameVersion() feeds the cache key, those images lose the more specific OS version component and can start sharing caches across OS versions; keep the ID-only value as a final fallback after all release files have been tried.
Useful? React with 👍 / 👎.
|
Follow-up on the review point about short-circuiting: the initial commit returned the ID-only fallback inside the per-file loop, so an ID-only 019f04a defers the ID-only fallback until all os-release files have been tried. Re-verified against the compiled function:
|
|
@codex please review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 019f04aa09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
eifinger
left a comment
There was a problem hiding this comment.
Looks good. Thank you!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://github.com/astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | action | major | `v8.3.2` → `v9.0.0` | --- ### Release Notes <details> <summary>astral-sh/setup-uv (https://github.com/astral-sh/setup-uv)</summary> ### [`v9.0.0`](https://github.com/astral-sh/setup-uv/releases/tag/v9.0.0): 🌈 Change `prune-cache` default to `false` [Compare Source](astral-sh/setup-uv@v8.3.2...v9.0.0) #### Changes This release disables the default cache cache pruning to ease the load on the PyPi infrastructure. Since users might experience more GitHub Actions cache usage which might result in higher costs this is marked as a breaking change. To read more on why we did this (now) you can read the detailed analysis and reasoning in [#​967](astral-sh/setup-uv#967) Besides this big breaking change we also have a small bugfix while building caches for linux distributions that behave a big different than the "big ones" and a speed up in version resolution by only reading the version manifest until a matching version is found saving runtime and network bandwith. #### 🚨 Breaking changes - Change `prune-cache` default to `false` [@​charliermarsh](https://github.com/charliermarsh) ([#​967](astral-sh/setup-uv#967)) #### 🐛 Bug fixes - fix: fall back to distribution ID when os-release has no version field [@​cxzhong](https://github.com/cxzhong) ([#​961](astral-sh/setup-uv#961)) #### 🚀 Enhancements - Speed up version client by partial response reads [@​eifinger](https://github.com/eifinger) ([#​807](astral-sh/setup-uv#807)) #### 🧰 Maintenance - chore: update known checksums for 0.11.30 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​968](astral-sh/setup-uv#968)) - chore: update known checksums for 0.11.29 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​960](astral-sh/setup-uv#960)) #### 📚 Documentation - docs: update version references to v8.3.2 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​949](astral-sh/setup-uv#949)) #### ⬆️ Dependency updates - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​970](astral-sh/setup-uv#970)) - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​962](astral-sh/setup-uv#962)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNzMuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.foxden.network/FoxDen/core/pulls/136
#14) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | action | major | `v8.3.2` → `v9.0.0` | --- ### Release Notes <details> <summary>astral-sh/setup-uv (astral-sh/setup-uv)</summary> ### [`v9.0.0`](https://github.com/astral-sh/setup-uv/releases/tag/v9.0.0): 🌈 Change `prune-cache` default to `false` [Compare Source](astral-sh/setup-uv@v8.3.2...v9.0.0) #### Changes This release disables the default cache cache pruning to ease the load on the PyPi infrastructure. Since users might experience more GitHub Actions cache usage which might result in higher costs this is marked as a breaking change. To read more on why we did this (now) you can read the detailed analysis and reasoning in [#​967](astral-sh/setup-uv#967) Besides this big breaking change we also have a small bugfix while building caches for linux distributions that behave a big different than the "big ones" and a speed up in version resolution by only reading the version manifest until a matching version is found saving runtime and network bandwith. #### 🚨 Breaking changes - Change `prune-cache` default to `false` [@​charliermarsh](https://github.com/charliermarsh) ([#​967](astral-sh/setup-uv#967)) #### 🐛 Bug fixes - fix: fall back to distribution ID when os-release has no version field [@​cxzhong](https://github.com/cxzhong) ([#​961](astral-sh/setup-uv#961)) #### 🚀 Enhancements - Speed up version client by partial response reads [@​eifinger](https://github.com/eifinger) ([#​807](astral-sh/setup-uv#807)) #### 🧰 Maintenance - chore: update known checksums for 0.11.30 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​968](astral-sh/setup-uv#968)) - chore: update known checksums for 0.11.29 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​960](astral-sh/setup-uv#960)) #### 📚 Documentation - docs: update version references to v8.3.2 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​949](astral-sh/setup-uv#949)) #### ⬆️ Dependency updates - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​970](astral-sh/setup-uv#970)) - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​962](astral-sh/setup-uv#962)) </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Warsaw) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNzIuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI3Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://git.ajgon.casa/deedee/schemas/pulls/14
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | action | major | `v8.3.2` → `v9.0.0` | --- ### Release Notes <details> <summary>astral-sh/setup-uv (astral-sh/setup-uv)</summary> ### [`v9.0.0`](https://github.com/astral-sh/setup-uv/releases/tag/v9.0.0): 🌈 Change `prune-cache` default to `false` [Compare Source](astral-sh/setup-uv@v8.3.2...v9.0.0) ##### Changes This release disables the default cache cache pruning to ease the load on the PyPi infrastructure. Since users might experience more GitHub Actions cache usage which might result in higher costs this is marked as a breaking change. To read more on why we did this (now) you can read the detailed analysis and reasoning in [#​967](astral-sh/setup-uv#967) Besides this big breaking change we also have a small bugfix while building caches for linux distributions that behave a big different than the "big ones" and a speed up in version resolution by only reading the version manifest until a matching version is found saving runtime and network bandwith. ##### 🚨 Breaking changes - Change `prune-cache` default to `false` [@​charliermarsh](https://github.com/charliermarsh) ([#​967](astral-sh/setup-uv#967)) ##### 🐛 Bug fixes - fix: fall back to distribution ID when os-release has no version field [@​cxzhong](https://github.com/cxzhong) ([#​961](astral-sh/setup-uv#961)) ##### 🚀 Enhancements - Speed up version client by partial response reads [@​eifinger](https://github.com/eifinger) ([#​807](astral-sh/setup-uv#807)) ##### 🧰 Maintenance - chore: update known checksums for 0.11.30 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​968](astral-sh/setup-uv#968)) - chore: update known checksums for 0.11.29 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​960](astral-sh/setup-uv#960)) ##### 📚 Documentation - docs: update version references to v8.3.2 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​949](astral-sh/setup-uv#949)) ##### ⬆️ Dependency updates - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​970](astral-sh/setup-uv#970)) - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​962](astral-sh/setup-uv#962)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNzMuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==-->Reviewed-on: https://git.tainton.uk/repos/pypilot/pulls/468 Reviewed-by: Luke Tainton <luke@tainton.uk> Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | action | major | `v8.3.2` → `v9.0.0` | --- ### Release Notes <details> <summary>astral-sh/setup-uv (astral-sh/setup-uv)</summary> ### [`v9.0.0`](https://github.com/astral-sh/setup-uv/releases/tag/v9.0.0): 🌈 Change `prune-cache` default to `false` [Compare Source](astral-sh/setup-uv@v8.3.2...v9.0.0) ##### Changes This release disables the default cache cache pruning to ease the load on the PyPi infrastructure. Since users might experience more GitHub Actions cache usage which might result in higher costs this is marked as a breaking change. To read more on why we did this (now) you can read the detailed analysis and reasoning in [#​967](astral-sh/setup-uv#967) Besides this big breaking change we also have a small bugfix while building caches for linux distributions that behave a big different than the "big ones" and a speed up in version resolution by only reading the version manifest until a matching version is found saving runtime and network bandwith. ##### 🚨 Breaking changes - Change `prune-cache` default to `false` [@​charliermarsh](https://github.com/charliermarsh) ([#​967](astral-sh/setup-uv#967)) ##### 🐛 Bug fixes - fix: fall back to distribution ID when os-release has no version field [@​cxzhong](https://github.com/cxzhong) ([#​961](astral-sh/setup-uv#961)) ##### 🚀 Enhancements - Speed up version client by partial response reads [@​eifinger](https://github.com/eifinger) ([#​807](astral-sh/setup-uv#807)) ##### 🧰 Maintenance - chore: update known checksums for 0.11.30 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​968](astral-sh/setup-uv#968)) - chore: update known checksums for 0.11.29 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​960](astral-sh/setup-uv#960)) ##### 📚 Documentation - docs: update version references to v8.3.2 @​[github-actions\[bot\]](https://github.com/apps/github-actions) ([#​949](astral-sh/setup-uv#949)) ##### ⬆️ Dependency updates - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​970](astral-sh/setup-uv#970)) - chore(deps): roll up Dependabot updates [@​eifinger](https://github.com/eifinger) ([#​962](astral-sh/setup-uv#962)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNzMuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==-->Reviewed-on: https://git.tainton.uk/repos/labmcp/pulls/17 Reviewed-by: Luke Tainton <luke@tainton.uk> Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk>
Summary
getLinuxOSNameVersion()throwsFailed to determine Linux distribution. Could not read /etc/os-release or /usr/lib/os-releaseon distributions whose os-release is readable but contains no version field at all — noVERSION_ID, noVERSION_CODENAME, noBUILD_ID. The error message is misleading in that case, and the action fails even though the distribution is perfectly identifiable.Void Linux is such a distribution. Its os-release is:
Unlike Arch (fixed by #912 via
BUILD_ID) and debian:unstable (fixed viaVERSION_CODENAME, #773), Void ships onlyID, so both existing fallbacks miss it. This breaks any workflow usingcontainer: ghcr.io/void-linux/void-glibc-fullwith caching enabled — e.g. SageMath's CI started failing after bumping to v8: https://github.com/sagemath/sage/actions/runs/29456228986/job/87489892141 (worked around downstream in sagemath/sage#42547 by injecting a fakeBUILD_IDinto the container's os-release).This PR adds a last-resort fallback: if
IDis present but no version field is, return the plainID(void), following the same reasoning as #912 — a stable cache key for a rolling release is better than crashing. Distributions with a version field are unaffected, and files without even anIDstill raise the existing error.Test Plan
npm run allpasses (build, biome check, package, 83 unit tests).fs.readFileSyncstubbed):void(previously: throw)ID=arch,BUILD_ID=rolling) →arch-rolling(unchanged)ID=ubuntu,VERSION_ID="24.04") →ubuntu-24.04(unchanged)ID→ still throws (unchanged)