mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-05-16 13:43:10 -04:00
Three changes from a fresh pre-merge review:
1. **Fix the prerelease-segment heuristic.** The previous rule treated
any semverParser-recognised prerelease segment as 'prerelease' or
(with isNightly) 'nightly'. Too aggressive: ~17 in-tree compilers
use the `-suffix` slot for build flavour, distro revision, git
hash, or vendor codename — not as a release-track signal:
- ocaml4071flambda etc. (`4.07.1-flambda` → flambda is a build flavour)
- gnatarm103/112, gnatriscv64103/112 (`10.3.0-2` → "-2" is the Alire
distro revision)
- cmake-3_29_20240506_g1ea8fa8 (`3.29.20240506-g1ea8fa8` → git hash)
- kvxg750, ckvxg750 (`4.1.0-cd1` → KVX vendor codename)
All were being misclassified as 'prerelease'. Replace the generic
semverParser.prerelease check with an allowlist of recognised
prerelease keywords (rc, beta, alpha, preview, dev, pre, optionally
with digits). Audit confirms the prerelease bucket shrinks from 20
to 3 entries, and all 3 are genuine prereleases (ldcbeta, dxc
1.8.2306-preview, rust beta).
2. **Extract resolveReleaseTrack and backfillReleaseTrack helpers.**
The override-resolution logic (type-check + trim + assert + infer
fallback) and the prediscovered/remote backfill logic were inlined
in compiler-finder.ts in three places. Factor into release-track.ts
so each is unit-testable in isolation and the call sites become
one-liners.
3. **Add override-path and backfill-path tests.** Whitespace-only
override falls back to inference; uppercase rejected; valid
override beats inference; non-string raw values rejected with a
clear message; backfill keeps valid existing track and re-infers
for missing/invalid.
Net: 39 unit tests (was 24), heuristic now correctly classifies all
6,333 in-tree compilers, helpers DRY the call sites in compiler-
finder.ts down from ~25 lines to 2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>