chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
Unscoped exclusive labels coexist, and a failed retarget changes nothing
Merged Approved
This pull adds Label::rivals so unscoped exclusive labels no longer compete, and it makes retarget check the head before it writes the base. It also lists each badly named workflow's own error, adds an abbrev helper for short commit IDs, and has push.rs use the gateway's is_sha. I found nothing that must change.
- Labels:
rivalsis used the same way inforge::labelled,forge::labeland the triager. Only the new unit test forrivalscovers the rule itself. retarget: the base-branch existence check still runs first. The head is then validated bynew_head, and the state record is written only after that succeeds. The pull record is updated last. A failed--base X --head Ynow leaves the base alone, as the PR says.- Workflows: the new match arm applies only when both the stored workflow and the incoming file are
invalidfallbacks with errors. Three or more bad files accumulate one line each. An earlier workflow that is valid, or genuinely namedinvalid, still gets the duplicate-name message. - Docs and changeset: both are present.
- Checks: I did not read them, and I did not build or run anything.
Some checks were cancelled
1 cancelled, 7 passed, 2 skipped
Merged as 64f7358
Merging this pull closed these issues
- Exclusive labels with no scope displace each other kind/bugarea/cliarea/lexiconsarea/triage
- Two badly named workflows both report a duplicate named invalid kind/bugarea/runner
- A retarget that fails on its head still moves the pull's base kind/bugarea/cli
What changes
Unscoped exclusive labels no longer rival each other. A new
Label::rivalsholds the one rule: two labels compete only when both are exclusive and both are in the same scope. Labelling, reading which labels stand, and the triager's choice all use it. Before, two exclusive labels with no/both had the scopeNone, which compared equal, so puttingblockedon an item tookurgentoff. The web page already worked this way.A retarget that fails changes nothing.
retargetchecks the head (that the caller wrote the pull, and that the branch exists) before it writes the new base. Before,--base X --head Yfrom someone who did not write the pull failed, but the base had already moved to X.Badly named workflows each give their own error. Files whose names are not valid workflow names all fall back to the name
invalid. That one check now lists each file's error, a line apiece. Before, the second file replaced the first file's error with "more than one workflow is named invalid".Smaller fixes.
knotless queueandknotless uses updateshow a commit ID shorter than 12 characters whole, rather than panicking. The gateway'sis_shaaccepts SHA-256 IDs aspush.rsdoes, andpush.rsnow uses that same function.Why
Fixes Exclusive labels with no scope displace each other Fixes Two badly named workflows both report a duplicate named invalid Fixes A retarget that fails on its head still moves the pull's base
The slicing panics and
is_shaare items from Merge queue: quirks in batching and landing and Storage: quirks in push, compaction and mirrors. Both issues have other items, so they stay open.For unscoped exclusive labels, the issue offered two fixes: refuse
--exclusiveon them, or let them rival nothing. This pull lets them rival nothing. It matches what the web page already does, and it needs no change to the CLI, MCP ordefineLabel.How it was checked
New unit tests:
exclusive_labels_rival_within_a_scopeanda_short_commit_is_shown_whole, plus 64-hex cases in the gateway'sis_shatest. The runner's workflow test adds a second badly named file and checks that both errors show. The serve forge test adds a retarget by the owner with--base main --head two, which fails on the head. If that had moved the base, the merge intostablelater in the test would fail. Nothing was built here: CI runs the tests.Shortcomings
--exclusiveis still accepted on a label with no scope, where it does nothing.🤖 Generated with Claude Code