Skip to content

1.4.1: read runs-on: in its mapping form - #13

Merged
Booyaka101 merged 2 commits into
mainfrom
runs-on-mapping-form
Sep 20, 2026
Merged

Booyaka101 merged 2 commits into
mainfrom
runs-on-mapping-form

Conversation

@Booyaka101

Copy link
Copy Markdown
Owner

Fixes #12.

runs-on: also takes a mapping, and the scanner only ever read the text that
followed the key. A job like this one produced no labels at all:

runs-on:
  group: default
  labels: [ubuntu-22.04]

So a repo pinning a retiring image behind a runner group was told it had nothing
to migrate, and the same job never appeared in the ubuntu-latest migration lane
either. It has been that way since 1.0.0, so it is a gap rather than a 1.4.0
regression.

labels: is written in the same three shapes runs-on: itself takes, scalar,
flow sequence and block list. Rather than add a fourth copy of those branches, the
read loop is now readTarget, which the mapping branch calls back into. group:
names a pool, not a label, and is the one key whose value must never be read as
one. The new regex follows the existing line-scanner discipline ([ \t] for
indentation, ([^\r\n]*) for the value, no .*), and there is a linear-time guard
case for a labels: key with a CR.

Annotations point at the label where it sits, the same as every other form, and
the labels under one mapping stay one target, so --label matching and the
migration lane treat them as the set a runner has to carry.

409 tests pass. Reverting only src/detect.mjs fails exactly the 7 new behaviour
tests, so they test the fix rather than the shape of it. The difflib clone check
over src/ tops out at 50% on an unrelated 7-line/5-line pair, which is noise:
this change removed duplication rather than adding it.

🤖 Generated with Claude Code

Booyaka101 and others added 2 commits September 20, 2026 21:34
A job on a runner group writes its labels under a mapping, and the scanner
took whatever followed runs-on: as the label text, so the whole job fell out
without a word. A repo pinning a retiring image behind a group was told it had
nothing to migrate. Gap since 1.0.0, not a 1.4.0 regression.

labels: takes the same three shapes runs-on: does, so the read loop is now one
function that recurses for the mapping instead of a fourth copy of the scalar,
flow-sequence and block-list branches. group: names a pool and is never read as
a label. Annotations still point at the label where it sits, and the labels
under one mapping stay one target, which is what --label and the migration lane
need: GitHub only schedules onto a runner carrying every label in the set.

Closes #12

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The extraction left it stacked above readTarget's own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Booyaka101
Booyaka101 merged commit fecd63a into main Sep 20, 2026
11 checks passed
@Booyaka101
Booyaka101 deleted the runs-on-mapping-form branch September 20, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runs-on: in its mapping form (group/labels) is not scanned

1 participant