Repository navigation
migrate: a default --map from the tier catalog - #160
Merged
Merged
Conversation
"replaces": ["ubuntu-latest", "ubuntu-24.04"] records which runs-on labels a tier takes over, for firerunner migrate to build its map from (#158). The daemon ignores it, and older daemons decode it as an unknown field, so a catalog that sets it still runs everywhere. Validation, without regard to ASCII case as GitHub matches labels: a plain label, replaced by one tier at most, never self-hosted, and never a name or label a tier answers to, which would move a migrated job on again. config check shows each tier's replaces. Signed-off-by: Lawrence Lin <deduce@gmail.com>
With --catalog FILE and no --map, each label a tier replaces maps to that tier's name; --map adds to that map or overrides it, label by label, without regard to case. Every target must still be a tier's name or label. A catalog that sets no replaces, with no --map, is a usage error that says what to add. Closes #158 Signed-off-by: Lawrence Lin <deduce@gmail.com>
From the review of #160: - validateTiers checked replaces, so a mistake in data only migrate reads (self-hosted, a label listed twice) would stop the daemon at its next restart. CheckCatalog, which config check and migrate use, now checks it; the daemon neither uses nor checks it. - Labels fold ASCII case only, as GitHub and internal/migrate do: strings.ToLower also folded the Kelvin sign into k. - A tier that replaces labels must have a name migrate can write as a runs-on label (not "true", not "fr small"), so config check catches what migrate would refuse. - A label listed twice in one tier gets its own message. Signed-off-by: Lawrence Lin <deduce@gmail.com>
From the review of #160: catalogMap deleted every key matching an explicit one, including another explicit key that differed only in case, so `--map Ubuntu-22.04=a --map ubuntu-22.04=b` kept one at random instead of being refused. It now drops only the catalog's own entries, and Validate refuses the pair as without --catalog. `--map X=X` keeps label X where it runs, the one way to leave a replaced label alone for one repository. Usage spells out both forms. Signed-off-by: Lawrence Lin <deduce@gmail.com>
Contributor
Author
|
Independent review (a fresh reviewer agent, given only the diff). It confirmed that no existing catalog is newly refused. Its findings are addressed in 51ccd5c and 9d24ad7:
Lower-confidence notes:
Every new rule is mutation-checked and CAUGHT. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #158.
A new optional tier field,
replaces. It lists the GitHub-hostedruns-onlabels a tier takes over, e.g.["ubuntu-latest", "ubuntu-24.04"].firerunner migrate --catalog FILEmaps each of these labels to the tier's name, so--mapis no longer needed. When--mapis given, it adds labels to that map or overrides them one by one, ignoring case.Validation. It runs in the daemon's catalog validation, so
config checkapplies it too. Labels are compared ignoring ASCII case, as GitHub compares them. Each entry:self-hosted;Compatibility. The daemon ignores the field. Older daemons decode it as an unknown field, so a catalog that sets it still loads everywhere.
config checklists each tier'sreplaces.Docs.
examples/tiers.jsonsets it onfirerunner-ubuntu. The README andconfig.example.envdescribe it.Tests
CheckCatalogapplies them.replaces.--catalogalone gives the same report as the explicit--mapit implies.CheckCatalog, every validation rule, case-insensitive overrides and the target check.Live dry run on the e2e repository (2026-11-04). With
--catalog examples/tiers.jsonalone, migrate maps bothubuntu-24.04andubuntu-latesttofirerunner-ubuntuand writes nothing. Opening and updating the PR is unchanged from #157 and was tested live there.