Skip to content

ci(labels): run the labels-sync test suite on tooling changes#470

Merged
ss-o merged 1 commit into
mainfrom
ci/labels-sync-tests
Jul 21, 2026
Merged

ci(labels): run the labels-sync test suite on tooling changes#470
ss-o merged 1 commit into
mainfrom
ci/labels-sync-tests

Conversation

@ss-o

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

Copy link
Copy Markdown
Member

Closes #469.

Why

No workflow in this repository executes scripts/, so scripts/test-labels-dry-run.sh ran only when someone remembered to. That suite caught two real defects during #466:

  • an in-use legacy label being queued for deletion
  • a migration deleting the legacy label before relabelling the items that carried it

Either would have destroyed label associations across the organization. A third — a race between planning and deletion — was found in review and is now covered too.

An untriggered test suite is the same failure #464 documented: a control that exists in the repo but not in reality.

What

Runs the suite on pushes and pull requests touching scripts/labels-sync.rb, scripts/labels-dry-run.rb, scripts/test-labels-dry-run.sh, or lib/labels.yml.

Permissions

The suite makes read-only preview calls against this repository (it resolves live labels and issues to compute drift), so the job takes contents: read and issues: read and passes GH_TOKEN. It never supplies a --confirm-* flag, and the script refuses every destructive path without one — the guardrail tests in the suite assert exactly that.

Verification

Not assumed to work:

Check Result
YAML parses, permissions as intended pass
Suite passes via the exact CI invocation (sh scripts/test-labels-dry-run.sh from repo root) pass
Same invocation against a deliberately broken script exits 1
Same invocation against the restored script exits 0

actions/checkout is pinned to df4cb1c069e1874edd31b4311f1884172cec0e10, verified against the API as v6.0.3 rather than copied on trust.

Noted, not changed

Two existing workflows in this repo pin that same SHA but comment it # v4, while nine comment it # v6.0.3. The API confirms v6.0.3, so those two comments are stale and misleading. Out of scope here.

Closes #469.

No workflow executed scripts/, so test-labels-dry-run.sh only ran when
someone remembered to invoke it. That suite caught two real defects in
#466 — an in-use legacy label queued for deletion, and a migration
deleting the legacy label before relabelling the items carrying it —
either of which would have destroyed label associations org-wide.

Runs on pushes and pull requests touching the label tooling or
lib/labels.yml. The suite makes read-only preview calls against this
repository, so the job takes contents: read and issues: read and passes
GH_TOKEN; it never supplies a --confirm-* flag, and the script refuses
every destructive path without one.

Verified the job is not a no-op: the same invocation exits 1 against a
deliberately broken script and 0 against the restored one.
@ss-o
ss-o requested a review from a team as a code owner July 21, 2026 23:13
Copilot AI review requested due to automatic review settings July 21, 2026 23:13
@ss-o
ss-o merged commit 8c3eae8 into main Jul 21, 2026
6 checks passed
@ss-o
ss-o deleted the ci/labels-sync-tests branch July 21, 2026 23:14

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

Adds a dedicated GitHub Actions workflow to ensure the label-sync tooling’s dry-run test suite actually runs in CI when the relevant scripts or label definitions change (closing #469).

Changes:

  • Introduces a new labels-sync-test.yml workflow that runs on push/pull_request (path-filtered) and supports workflow_call.
  • Runs sh scripts/test-labels-dry-run.sh with read-only permissions (contents: read, issues: read) and concurrency control.
  • Pins actions/checkout to a full commit SHA.


- name: "🧪 Run labels-sync smoke tests"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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.

ci: run the labels-sync test suite in CI

2 participants