Repository navigation
chore: a label gate that fails in both directions, and the sync that never synced - #232
Merged
Merged
Conversation
…never synced .github/labels.yml is a hand-maintained description of state held on GitHub, and nothing compared the two — so they had drifted by nine labels. #190 catalogued eight and concluded the file "is applied by nothing." Two of its premises needed correcting before anything could be fixed: The file *was* applied by something. .github/scripts/sync-labels.sh parsed it with a bash regex requiring `- name: "..."` — double quotes — and the file has used single quotes or bare scalars since it was written. The loop matched 0 of 78 entries, then printed "Label sync complete!" and exited 0. A silent success is worse than an absence: every log it ever produced was indistinguishable from a working sync. And a paths:-filtered sync job, which #190 proposed, would have caught none of the nine. Every drift originated on GitHub — two labels created in the web UI, one invented by `gh issue create --label`, one created by Dependabot, six defaults never deleted — and none of those events touches the file. Verified with `git log -S` against the exact `- name:` form of each, not assumed. So the gate runs unconditionally and compares both directions. Only one direction is intuitive, which is the point: all nine existed on GitHub and were absent from the file, none the other way, so a create-from-file sync is green on every one of them. That is the failure mode #190's own acceptance criteria name, and its specified test is the one that was run — `gh label create zz-drift-probe` without touching the file, gate fails naming it, probe deleted, gate passes. - internal/config/labels_test.go — the fifth mechanical gate. Names, colors, and descriptions, both directions; plus an offline test holding dependabot.yml's labels: blocks to the file, which is the seam that left 46 Dependabot PRs unmerged when `automerge` was named there and defined nowhere. - sync-labels.sh — parses instead of pattern-matching, dry-run unless --apply, refuses a partial parse, edits existing labels (color and description drift is invisible to a create-only sync), and reports extras without ever deleting one. - labels.yml — the three missing labels, each with its provenance recorded. - CI — its own job, because a failure names an action outside the codebase. The API half skips when gh cannot authenticate, so the job greps its own output for that skip: `go test` exits 0 either way, and a skipped gate reports success. - CLAUDE.md — four descriptions of a GitHub repository that does not exist: a transcribed label table missing 10 of 22 area: labels, six milestones of which five are closed, an /orgs/ project URL that 404s for a user account, and a GOPRIVATE block for repositories that are all public. Closes #190
scttfrdmn
enabled auto-merge (squash)
August 3, 2026 01:43
Two findings from the blocking lint gate on the previous commit. `noctx` is right for a better reason than the rule states: an unresponsive API would leave `gh` blocked until `go test`'s own 20-minute deadline, which kills the whole package and reports it as a panic — a network call that did not answer, presented as a broken test suite. 30 s against the 0.3–0.5 s this takes when the API is reachable. `misspell` wants `labeled`.
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 #190.
Three of #190's four claims needed correcting before they could be fixed, and the corrections are the interesting part.
The file was not "applied by nothing" — it was applied by something that reported success
.github/scripts/sync-labels.shparsedlabels.ymlwith a bash regex requiring- name: "..."— double quotes. The file has used single quotes (66 entries) or bare scalars (12) for its entire history, so the loop matched 0 of 78, and the script then printed✅ Label sync complete!and exited 0.That is worse than the absence #190 diagnosed. An absent sync is a gap someone eventually notices; a sync that reports success is indistinguishable from a working one in every log it has ever produced. It is also why the fix is a parser and not a better regex — all three YAML scalar forms are legal, all three are in this file, and a pattern written against one is blind to the other two.
A
paths:filter would have caught zero of the nine drifts#190 proposed a sync job triggered when
.github/labels.ymlchanges. Measured rather than assumed:git log -Sfor the exact- name:form of all nine returns nothing for any of them. Each was created on GitHub — two by hand in the web UI, one invented bygh issue create --label(which is howarea: ci-cdarrived with a null description and default grey), one by Dependabot, six defaults never deleted — and none of those events touches the file. A job keyed on the file changing never runs, so the drift it exists to prevent is exactly the drift it cannot see.So the gate runs unconditionally.
Both directions, because only one is intuitive
Nine labels existed on GitHub and were absent from the file. None the other way. A create-from-file sync is therefore green on all nine — it has nothing to create. That is the failure mode #190's acceptance criteria call out, and its specified test is the one that was run:
Two smaller corrections: milestones #7–#10 were already closed, and the drift is nine labels, not eight —
javawas created by Dependabot on the first maven PR aftersdks/javagained an ecosystem entry, i.e. it grew by one while the issue sat open.What is here
internal/config/labels_test.godependabot.yml'slabels:blocks to the file — the seam that left 46 Dependabot PRs unmerged whenautomergewas named there and defined nowhere.github/scripts/sync-labels.sh--apply; refuses a partial parse; edits existing labels, since color/description drift is invisible to a create-only sync; reports extras with the command to remove each and never deletes one.github/labels.yml.github/workflows/ci.ymlghcannot authenticate, so the job greps its own output for that skip:go testexits 0 either way, and a skipped gate reports successCLAUDE.mdCLAUDE.mdheld a transcribed label table with 12 of the 22area:labels, six milestones of which five are closed, an/orgs/scttfrdmn/projectsURL that 404s becausescttfrdmnis a user account, and aGOPRIVATE/GONOSUMDBblock for repositories that are all public (verified by fetching[email protected]with both variables explicitly empty). Each is now a pointer to the authority rather than a copy of it, because a transcribed list is a claim with no way to be told it is stale.Applied to GitHub, outside this diff
enhancementlabel relabelledtype: enhancement, then the six duplicate defaults deleted —bug,enhancement,documentation,duplicate,invalid,wontfix, each shadowed by atype:/resolution:equivalent. Each confirmed at 0 issues and 0 PRs first.good first issue,help wanted, andquestionare kept; they collide with nothing.Verification