chore: make labels.yml enforceable and reconcile it with reality - #66
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
labels.yml claimed to be applied by 'gh workflow run label-sync.yml', a workflow that never existed. The manifest had therefore only ever been applied to stella/stella by hand: the other ten active repos carry just the GitHub defaults and are missing 21 labels each. Add the workflow and the script it dispatches, as a reusable workflow a repo opts into. Each run uses the calling repo's own GITHUB_TOKEN, so no credential is stored and a run cannot write outside the repo that invoked it. The manifest is read from this repo, which is public, so fetching it needs no auth either. Default mode is plan, so a run with no arguments reports drift and writes nothing. Pruning is a separate mode and skips any label still applied to an issue or PR, so a repo keeps labels beyond the org baseline. Reconcile the manifest with what is actually in use. pr-lint labels PRs by conventional-commit type, but enhancement, bug, docs, chore, and perf were absent from the manifest, so the labeller auto-created them per repo with arbitrary colors. Declare them. Drop the three priority labels and 'documentation', now covered by org issue fields and by 'docs'.
jan-kubica
force-pushed
the
chore/label-sync
branch
from
August 4, 2026 12:14
6283a95 to
99bae29
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
labels.ymlopened with# Sync to repos using: gh workflow run label-sync.yml. That workflow does not exist in this repository and never has, so the manifest has only ever been applied tostella/stella, by hand.Measured drift before the change:
Ten active repos carry nothing but the GitHub defaults.
Design: no stored credentials
A reusable workflow that a repo opts into with a thin caller, matching
pr-lintandaudit-branch-protection. Each run uses the calling repo's ownGITHUB_TOKENwithissues: write, which is minted per job, expires with it, and cannot reach outside that repository.This deliberately avoids an org-wide dispatcher holding a GitHub App private key. A stored key is a long-lived credential with org-wide write reach, kept to make a convenience feature work; the blast radius of a leak is every repository. Here there is no secret to leak and no way for a run to touch a repo that did not invoke it.
audit-branch-protectionneeds an App because reading org rulesets requires org-level permission. Label sync only ever writes to its own repo, so it does not.The manifest is fetched from this repository, which is public, so that read needs no authentication either. Sparse checkout pulls only
labels.ymland the script.Modes
A
modeinput rather than a boolean, since the choice is not yes/no:plan(default) reports the diff and writes nothingapplycreates missing labels and corrects colors and descriptionsapply-with-pruneadditionally deletes labels absent from the manifestPrune skips any label still applied to an issue or pull request. The manifest is a floor, not a whitelist: repos legitimately carry labels beyond the baseline (
react-doctor: *,📝 docx-editor,agent-feedback), and those must survive. Without that guard a prune run would have stripped roughly 900 label applications fromstella/stellaalone.Opt-in per repo also solves scoping: the manifest still mixes org-wide labels with app-specific ones (
📬 outlook plugin,🧮 table), and pushing those into the Rust package repos would be noise. Splitting the manifest into a baseline plus overlays is the follow-up; until then a repo only gets labels if it asks.Manifest corrections
pr-lint.ymllabels every PR in the org from its conventional-commit type (feat/refactor→enhancement,fix→bug, plusdocs,chore,perf). None of those five were declared, soytanikin/PRConventionalCommitscreated them ad hoc wherever it ran. That is whystella/stellaended up withbugat#747e01anddocsat#3b222f. They are now declared with deliberate colors, and the sync corrects the existing ones in place.Also drops the three priority labels and
documentation, superseded by org issue fields and bydocs. Both are already removed fromstella/stella; declaring the removal stops the sync recreating them.Verification
planrun locally againststella/stella:shellcheckclean. No secrets to provision before merge.Once this is on
main, repos opt in with: