Skip to content

chore(labels): add dry-run label audit script#423

Merged
ss-o merged 2 commits into
mainfrom
chore/label-sync-dry-run
May 22, 2026
Merged

chore(labels): add dry-run label audit script#423
ss-o merged 2 commits into
mainfrom
chore/label-sync-dry-run

Conversation

@ss-o
Copy link
Copy Markdown
Member

@ss-o ss-o commented May 22, 2026

Summary

  • add a read-only scripts/labels-dry-run.rb audit script that consumes lib/labels.yml
  • report missing, mismatched, legacy, and unknown labels without applying changes
  • document the dry-run step and usage examples in runbooks/labels.md

Validation

  • ruby -c scripts/labels-dry-run.rb
  • scripts/labels-dry-run.rb --repo z-shell/.github --include-clean
  • scripts/labels-dry-run.rb --repo z-shell/zi
  • JSON smoke test against z-shell/.github

Notes

  • This does not create, update, migrate, or delete any labels.
  • This does not comment on issues or change issue/PR labels.
  • Unknown local labels are preserved for manual review by design.

Refs #411

Add a read-only Ruby script that consumes lib/labels.yml and reports missing, mismatched, legacy, and unknown labels across one or more repositories. Document the dry-run step in the label maintenance runbook.
@ss-o ss-o requested a review from a team as a code owner May 22, 2026 23:06
Copilot AI review requested due to automatic review settings May 22, 2026 23:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a read-only audit tool to compare the canonical org label set (lib/labels.yml) against live GitHub repos, plus runbook guidance to run the audit before doing any label cleanup/sync work.

Changes:

  • Introduces scripts/labels-dry-run.rb to report missing, mismatched, legacy, and unknown labels without applying mutations.
  • Extends runbooks/labels.md with a “dry-run first” step and usage examples for Markdown/JSON output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/labels-dry-run.rb New Ruby CLI that queries labels via gh and diffs them against lib/labels.yml, outputting Markdown or JSON.
runbooks/labels.md Documents the new dry-run workflow and provides invocation examples.

Comment thread scripts/labels-dry-run.rb
Comment thread scripts/labels-dry-run.rb Outdated
Comment thread runbooks/labels.md Outdated
Comment thread scripts/labels-dry-run.rb
@ss-o
Copy link
Copy Markdown
Member Author

ss-o commented May 22, 2026

@copilot check if conversations resolved

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

@copilot check if conversations resolved

Yes, all four threads are resolved in c0ec437:

  • YAML.safe_load — fixed with permitted_classes: [], permitted_symbols: [], aliases: false + structure validation
  • --all-repos + --repo conflict — errors out when both flags are supplied
  • Angle-bracket placeholder — runbook now uses z-shell/REPO
  • Paginated JSON — replaced with gh_paginated_array using --template to emit one object per line

Copilot finished work on behalf of ss-o May 22, 2026 23:28
@ss-o ss-o merged commit 48e73d6 into main May 22, 2026
5 checks passed
@ss-o ss-o deleted the chore/label-sync-dry-run branch May 22, 2026 23:44
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.

3 participants