1.4.1: read runs-on: in its mapping form - #13
Merged
Merged
Conversation
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>
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.
Fixes #12.
runs-on:also takes a mapping, and the scanner only ever read the text thatfollowed the key. A job like this one produced no labels at all:
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-latestmigration laneeither. 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 shapesruns-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]forindentation,
([^\r\n]*)for the value, no.*), and there is a linear-time guardcase 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
--labelmatching and themigration lane treat them as the set a runner has to carry.
409 tests pass. Reverting only
src/detect.mjsfails exactly the 7 new behaviourtests, 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