Skip to content

Record the confirmed label-name case behaviour (GH-16) - #54

Merged
Ilyes512 merged 1 commit into
mainfrom
docs/GH-16-label-case-findings
Aug 8, 2026
Merged

Ilyes512 merged 1 commit into
mainfrom
docs/GH-16-label-case-findings

Conversation

@Ilyes512

@Ilyes512 Ilyes512 commented Aug 8, 2026

Copy link
Copy Markdown
Member

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:

  • 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.
  • Casing drift is still a real state. A repo holding bug while config asks for Bug is
    entirely possible, and is repaired by a single PATCH new_name that preserves the label id and
    every 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.name as a genuine update, and
Action already carries NewName. This change explains why those are correct rather than
leaving them as unexplained assumptions.

Changes

  • § GitHub API surface — new ### Label names are case-insensitively unique subsection with the
    four 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).
  • § Validation — the "needs empirical confirmation" caveat becomes a confirmed rule. Adds that
    ErrInvalidRename compares from case-insensitively, so bug → Bug is rejected as a rename
    entry — deliberate, since step 5 converges casing without one.
  • § Reconciliation → Ordering — notes the one place a rename genuinely can collide: PATCH
    rejects a new_name matching an existing label in any casing. Step 1's to does not exist guard
    has to be case-insensitive to keep that unreachable.
  • § Steps — step 1's guard annotated as case-insensitive.
  • § Open questions — question 1 removed, remainder renumbered 1–5, with an "Answered" pointer.

Notes for review

  • Docs-only; no code changed, so no tests were added. task checkall is green.
  • The spike ran against this repository rather than a scratch repo (gh repo create was
    unavailable), using zz-spike-16-prefixed labels that were deleted immediately afterwards. The
    label set was snapshotted before and verified after.
  • I did not tick anything in Spike: confirm GitHub rejects case-variant label names in one repository #16's Done-when — it has none; its Scope boxes are all ticked and
    its Output (the findings comment) is posted.

Closes #16

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.
@Ilyes512
Ilyes512 merged commit 6ad4ea7 into main Aug 8, 2026
5 checks passed
@Ilyes512
Ilyes512 deleted the docs/GH-16-label-case-findings branch August 8, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spike: confirm GitHub rejects case-variant label names in one repository

1 participant