mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-05-16 14:53:04 -04:00
Adds a structured `releaseTrack: 'stable' | 'nightly' | 'prerelease' | 'experimental'` field on CompilerInfo so consumers can distinguish release tracks that aren't currently separable from the existing isSemVer/isNightly/semver fields. Today every compiler with a non-numeric semver and isNightly=true looks the same from the outside: Rust nightly, Rust beta, gcc snapshot, and gcc's various experimental forks (gcontracts-trunk, gcc-modules-trunk, glambda-p2034-trunk, ...) all share the same shape. Anything that wants to ask "what's the canonical newest build of language X" — a UI badge, the upcoming MCP latestPerMajor knob, etc. — has no way to tell those apart. Implementation: - New `inferReleaseTrack()` heuristic in lib/release-track.ts driven by asSafeVer + the existing isSemVer/isNightly flags. Real semvers with a prerelease segment (e.g. micropython "1.28.0-preview") are flagged prerelease; semvers containing trunk/main and the literal nightly tag go to nightly; bare beta/alpha/rc tags go to prerelease; isNightly with anything else (the c++ experimental forks) goes to experimental; everything else stays stable. - `compiler.releaseTrack=` / `group.releaseTrack=` in .properties as an override for cases the heuristic can't reach from structural fields (e.g. Rust's `rustccggcc-master` where "master" is in the compiler id but not the semver field). - Backfill in loadPrediscovered() so cached discovery JSON written before this field existed doesn't break, and so a hand-edited invalid value gets re-inferred rather than violating the type contract. - 18 tests covering each rule, edge cases (whitespace, mixed case, prerelease segments), and the isReleaseTrack type guard. The field is exposed via /api/compilers under ?fields=all (it's not in the default field set) so external consumers can opt in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>