tool-cache._getOsVersion should improve to detect RHEL compatible Linux distro version.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
tool-cache._getOsVersion() had been using /etc/lsb-release to detect Linux OS versions, but recently, it was improved to use /etc/os-release from systemd : #594
But it used VERSION_ID only, and it does not process Linux distro information.
- Here are contents of
/etc/os-releasefrom various Linux Distros. - RHEL and its compatible distros have compatible ABI if they have same major version, but their
VERSION_IDare different.- CentOS : 8
- RockyLinux : 8.7
IMHO, the purpose of tool-cache._getOsVersion() is to distinguish the ABI of the OS.
So, I propose to improve it as follows.
-
Return
PLATFORM_IDfirst if it is available from/etc/os-release- RHEL based Linux distros provides
PLATFORM_IDwhich OS is compatible.- RHEL 8.x, CentOS 8.x, and Rocky Linux 8.x have same
PLATFORM_ID=platform:el8
- RHEL 8.x, CentOS 8.x, and Rocky Linux 8.x have same
- RHEL based Linux distros provides
-
Return old behavior (
VERSION_IDfrom /etc/os-release) ifPLATFORM_IDis not available.- This can keep compatiblity with current behavior.
Code Snippet
If applicable, add a code snippet to show the api enhancement.
Additional information
Add any other context about the feature here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating tool-cache._getOsVersion() and the existing /etc/os-release parsing. Check how VERSION_ID is currently selected, then verify the result for RHEL-compatible distributions with and without PLATFORM_ID. Done means PLATFORM_ID is preferred when present and VERSION_ID remains the fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- operating-systems, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100