Skip to content

fix(labels): make lib/labels.yml the only canonical label file#471

Merged
ss-o merged 1 commit into
mainfrom
fix/461-single-labels-file
Jul 21, 2026
Merged

fix(labels): make lib/labels.yml the only canonical label file#471
ss-o merged 1 commit into
mainfrom
fix/461-single-labels-file

Conversation

@ss-o

@ss-o ss-o commented Jul 21, 2026

Copy link
Copy Markdown
Member

Closes #461.

The drift

Two canonical label files existed. Every document pointed at one; the tooling read the other.

lib/labels.yml .github/lib/labels.yml
Read by labels-sync.rb yes (DEFAULT_LABELS_FILE) no
Schema Hash: labels, legacy_migrations, sync_policy bare Array — neither block
Labels 32 29 (strict subset, nothing unique)
Referenced by docs 1 line 7 lines, plus a wiki link

Two corrections to the issue as filed

  • It is not a silent failure in both directions. Pointing the script at .github/lib/labels.yml hard-errorslabels file must contain a mapping — because the schema is incompatible. The genuinely silent path is narrower and is the one that matters: a maintainer follows runbooks/labels.md, edits the .github copy, runs the script with defaults, and the edit is ignored with no error.
  • The mode note is wrong. Root is 0644, not 0600; the .github copy was 0664. No permission change was needed.

Consumer audit (step 1 of the issue)

Swept every file with a label-related path across all 86 active repositories via the trees + contents API — not code search, which is unreliable here.

No automation anywhere in the organization reads either file. Findings:

  • 33 repositories carry .github/workflows/sync-labels.yml, but they call z-shell/.github/.github/workflows/sync-labels.yml@main, which does not exist (404). They never read the label file. Tracked separately.
  • z-shell/src/scripts/sync-labels.sh does not reference it.
  • The only external reference is a documentation link in z-shell/wiki, repointed in a separate PR.

Why delete rather than symlink

The issue offered a symlink. That would be worse: GitHub's raw endpoint returns a symlink's target path as text rather than file contents, so any raw-URL consumer would silently receive ../../lib/labels.yml instead of YAML. A clean removal with repointed references fails loudly instead.

Verification

Check Result
labels-sync.rb resolves its default file 32 labels, 31 migrations, 4 policy keys
test-labels-dry-run.sh passes
../lib/labels.yml resolves from .github/README.md OK
Stale references remaining none

Closes #461.

Two canonical label files existed and had diverged. Every document
pointed at .github/lib/labels.yml; scripts/labels-sync.rb reads
lib/labels.yml. A maintainer following runbooks/labels.md edited the
copy the tooling never reads, and nothing reported the mistake.

The two were not equal authorities. Root holds 32 labels plus the
legacy_migrations and sync_policy blocks; the .github copy was a bare
YAML array of 29 labels with neither block, a strict subset and an
incompatible schema — labels-sync.rb rejects it outright with 'labels
file must contain a mapping'. It also still described meta:org-tracked
in terms of the retired GitHub Projects tracker.

Removes the stale copy and repoints all seven references. The .github
README link needed ../lib/labels.yml, being relative to .github/.

A consumer audit found no automation reading either file anywhere in the
organization; the only external reference is a documentation link in
z-shell/wiki, repointed separately. The 33 repositories carrying
sync-labels.yml call a reusable workflow that does not exist and never
read the label file; that is tracked on its own.
Copilot AI review requested due to automatic review settings July 21, 2026 23:22
@ss-o
ss-o requested a review from a team as a code owner July 21, 2026 23:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR eliminates label-definition drift by removing the stale .github/lib/labels.yml file and repointing all in-repo documentation to the single canonical label source at lib/labels.yml, matching what scripts/labels-sync.rb already consumes by default.

Changes:

  • Update runbooks and agent instructions to reference lib/labels.yml as the sole source of truth.
  • Fix .github/README.md to link to the root canonical label file.
  • Delete the stale .github/lib/labels.yml file to prevent future silent mis-edits.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runbooks/triage.md Updates triage instructions to reference the canonical lib/labels.yml.
runbooks/labels.md Updates label maintenance runbook to use lib/labels.yml consistently.
AGENTS.md Repoints agent guidance to the canonical label source.
.github/README.md Fixes label-file references/linking from within the .github/ directory.
.github/lib/labels.yml Removes the stale duplicate label-definition file.

ss-o added a commit to z-shell/wiki that referenced this pull request Jul 21, 2026
…#802)

The page linked z-shell/.github/.github/lib/labels.yml, a stale duplicate
removed in z-shell/.github#471. The canonical file, and the one
labels-sync.rb reads, is lib/labels.yml at that repository's root.

Supports z-shell/.github#461.
@ss-o
ss-o merged commit 7854191 into main Jul 21, 2026
5 checks passed
@ss-o
ss-o deleted the fix/461-single-labels-file branch July 21, 2026 23:25
ss-o added a commit to z-shell/wiki that referenced this pull request Jul 22, 2026
main links to z-shell/.github/.github/lib/labels.yml, which became a 404
when that duplicate was removed in z-shell/.github#471. The corrected
link already exists on next via #802, but main requires branches to be
up to date and its required Trunk Check fails on this 404, so the
promotion that would carry the fix is blocked by the fix's absence.

Applies the same one-line correction directly to main to break that
deadlock. Identical to the change already on next, so the branches
converge cleanly.

Co-authored-by: Sall <ss-o@users.noreply.github.com>
ss-o added a commit to z-shell/wiki that referenced this pull request Jul 22, 2026
* docs(zsh-lint): add generated-reference markers (#755)

docs(zsh-lint): add generated-reference markers and seed content

Re-add the {/* zsh-lint:generated:start/end */} markers to the Zsh Lint
ecosystem page so the wiki-docs-sync pipeline from z-shell/zsh-lint has a
region to inject into. Seed the region with the current generated Go
reference so the first automated sync is a no-op rather than a failure.

The marked region is machine-managed — do not hand-edit; it is regenerated
from the repo's Go doc comments.

Co-authored-by: Salvydas Lukosius <ss-o@users.noreply.github.com>

* docs(zsh-lint): sync generated reference (#756)

docs(zsh-lint): sync generated reference from zsh-lint

* ci(trunk): fix duplicate Trunk Check context blocking PRs (#759)

ci(trunk): rename workflow/job to Trunk Code Quality to fix duplicate check context

The workflow and job were both named 'Trunk Check', colliding with the check
that trunk-io/trunk-action posts (also 'Trunk Check'). Two identically-named
check-runs confuse strict branch protection (required context 'Trunk Check'),
leaving PRs stuck in BLOCKED even when all checks pass. Renaming to the
org-conventional 'Trunk Code Quality' (matching other repos) leaves the
action's 'Trunk Check' as the sole required context. Fixes #757.

Co-authored-by: Salvydas Lukosius <ss-o@users.noreply.github.com>

* docs(packages): drop removed Zsh 5.1.1/5.2.4 from version list

The zsh package no longer ships 5.1.1 or 5.2.4 as selectable profiles
(z-shell/zsh#14). Remove the two stale 'zi pack' examples so the usage page
matches the available manifest profiles.

* docs(zsh-lint): move tool documentation into community

* docs(zsh-lint): normalize generated reference indentation

* ci(workflows): enforce concurrency and permissions rules

* ci(workflows): enforce top-level policy blocks

* chore(repo): reconcile main content into next

* docs(community): align project metadata with Linear

* docs(contributing): point the label source of truth at lib/labels.yml (#802)

The page linked z-shell/.github/.github/lib/labels.yml, a stale duplicate
removed in z-shell/.github#471. The canonical file, and the one
labels-sync.rb reads, is lib/labels.yml at that repository's root.

Supports z-shell/.github#461.

---------

Co-authored-by: Salvydas Lukosius <ss-o@users.noreply.github.com>
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.

Two labels.yml files have drifted; docs cite the stale one

2 participants