~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

Unscoped exclusive labels coexist, and a failed retarget changes nothing

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:fix/client-quirks

What changes

Unscoped exclusive labels no longer rival each other. A new Label::rivals holds 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 scope None, which compared equal, so putting blocked on an item took urgent off. The web page already worked this way.

A retarget that fails changes nothing. retarget checks the head (that the caller wrote the pull, and that the branch exists) before it writes the new base. Before, --base X --head Y from 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 queue and knotless uses update show a commit ID shorter than 12 characters whole, rather than panicking. The gateway's is_sha accepts SHA-256 IDs as push.rs does, and push.rs now 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_sha are 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 --exclusive on 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 or defineLabel.

How it was checked

New unit tests: exclusive_labels_rival_within_a_scope and a_short_commit_is_shown_whole, plus 64-hex cases in the gateway's is_sha test. 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 into stable later in the test would fail. Nothing was built here: CI runs the tests.

Shortcomings

--exclusive is still accepted on a label with no scope, where it does nothing.

🤖 Generated with Claude Code

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: rivals is used the same way in forge::labelled, forge::label and the triager. Only the new unit test for rivals covers the rule itself.
  • retarget: the base-branch existence check still runs first. The head is then validated by new_head, and the state record is written only after that succeeds. The pull record is updated last. A failed --base X --head Y now 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 invalid fallbacks with errors. Three or more bad files accumulate one line each. An earlier workflow that is valid, or genuinely named invalid, 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.
Merged as 64f7358
Merging this pull closed these issues