Record the confirmed label-name case behaviour (GH-16) - #54
Merged
Merged
Conversation
The spike in #16 settled open question 1 against the live API. The answer is two-sided, and only recording half of it would be misleading: - A repository can never hold two labels differing only by case. POST rejects the variant with 422 already_exists, so matching remote labels case-insensitively is unambiguous and needs no tie-break. - Casing drift is still a real state. A repo holding `bug` while the config asks for `Bug` is repaired by PATCH new_name in one call, preserving the label id and its issue/PR associations. Also pins down the one place a rename can collide: PATCH rejects a new_name matching an existing label in any casing with the same 422, so step 1's `to does not exist` guard has to be case-insensitive. A case-only drift can never collide, since the only label its target matches is the one being renamed. Validation gains the matching note: ErrInvalidRename compares `from` case-insensitively too, which rejects `bug` -> `Bug` as a rename entry. That is deliberate — step 5 already converges casing without one.
This was referenced Aug 8, 2026
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.
Records the outcome of the #16 spike in
docs/design.md, and retires open question 1.The findings comment has
the full request/response log. The short version is that the answer is two-sided, and writing
down only the first half would have been actively misleading:
POSTrejects the variant with422 already_exists. So matching remote labels case-insensitively is unambiguous.bugwhile config asks forBugisentirely possible, and is repaired by a single
PATCH new_namethat preserves the labelidandevery issue/PR association. The two facts do not collapse into "casing never differs".
The design was already right about this — step 5 treats
m.name != d.nameas a genuine update, andActionalready carriesNewName. This change explains why those are correct rather thanleaving them as unexplained assumptions.
Changes
### Label names are case-insensitively uniquesubsection with thefour observed behaviours and their consequences, including the rule that requests address a label
by its observed name with the desired spelling in
new_name(keeps the ETag cache honest).ErrInvalidRenamecomparesfromcase-insensitively, sobug→Bugis rejected as a renameentry — deliberate, since step 5 converges casing without one.
PATCHrejects a
new_namematching an existing label in any casing. Step 1'sto does not existguardhas to be case-insensitive to keep that unreachable.
Notes for review
task checkallis green.gh repo createwasunavailable), using
zz-spike-16-prefixed labels that were deleted immediately afterwards. Thelabel set was snapshotted before and verified after.
its Output (the findings comment) is posted.
Closes #16