Skip to content

feat: start the workflow of a label by workflow_dispatch - #151

Merged
ocots merged 7 commits into
mainfrom
feat/149-label-dispatch
Nov 11, 2026
Merged

ocots merged 7 commits into
mainfrom
feat/149-label-dispatch

Conversation

@ocots

@ocots ocots commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Closes #149.

Problem

Every label added to a pull request created a run of each heavy workflow of a package (CI, Documentation, Breakage), all jobs skipped. The run in progress was not cancelled, but it was hidden on the PR page behind the latest, skipped one, and each label left ~30 skipped jobs in the Checks.

Change

The heavy workflows no longer listen to pull_request: a label dispatches them by workflow_dispatch, one run per label. Runs started by different labels accumulate, and adding a label never cancels a run started by another (this is what made #148 unacceptable).

  • label-dispatch.yml (reusable, called by a package's Labels.yml): on labeled, dispatches the workflow of the added label only; on synchronize / reopened, the workflow of every label present. Nothing for a closed PR or a fork.
  • scripts/label-dispatch/{plan,test}.sh + label-dispatch-tests.yml: the mapping label → workflow and its tests.
  • ci.yml, documentation.yml, breakage-suite.yml, breakage.yml: a workflow_dispatch with the input pr counts as a run of that PR (concurrency group and cancellation by a newer push, breakage base/baseline/comment read through the API, documentation preview via GITHUB_EVENT_NAME=pull_request / GITHUB_REF=refs/pull/<pr>/merge).
  • pr-status.yml: a dispatched run is not in the Checks tab nor in the checks list of the PR (found on the pilot). It posts a commit status instead (CI / kkt, Documentation, Breakage / packages, and Documentation / preview linking to previews/PR<n>/), which is in the merge box.
  • Docs: docs/workflows/label-dispatch.md, labels.md, superseded-runs.md, README.md.

Backward compatible: nothing changes for a package until its callers move.

Verified on the pilot (CTFlows.jl#518)

  • Labels accumulate: documentation, breakage and CI (GitHub and kkt) run side by side, none cancels another.
  • A push restarts each labelled workflow once and cancels its previous run; two pushes in a row leave one run.
  • bug dispatches nothing.
  • Documentation with documentation push preview: previews/PR518 is deployed from a dispatched run; both statuses are posted.
  • run ci kkt-runner: CI kkt #518 starts on the self-hosted runner.

Behaviour changes for a package that moves

  • A dispatched run tests the head of the branch, not the merge commit of the PR.
  • The runs are not in the Checks tab: the commit statuses replace them. Check names change: review the branch protection.
  • A package whose default token is read-only gives statuses: write to the job that calls the workflows.

Not verified

  • Pull requests from a fork (skipped for now).
  • The preview URL is built as https://<owner>.org/<repository>/previews/PR<n>/.

Merging

The pilot's callers (CTFlows.jl#518) point to the branch of this PR, and the pilot calls pr-status.yml@main: its runs started after this commit fail until this PR is merged. After the merge, the callers of each package use @main and Labels.yml loses its ctactions_ref.

actionlint passes on all workflows; bash scripts/label-dispatch/test.sh: 10 tests pass.

🤖 Generated with Claude Code

ocots and others added 7 commits November 10, 2026 22:43
…tch (#149)

A label no longer creates a run of every heavy workflow of a package: label-dispatch.yml
dispatches only the workflow of the label just added, so the runs of different labels
accumulate on the pull request and none cancels another.

- label-dispatch.yml (reusable) and scripts/label-dispatch/{plan,test}.sh: the mapping
  label -> workflow, tested by label-dispatch-tests.yml
- ci, documentation, breakage-suite, breakage: a workflow_dispatch with the input `pr`
  counts as a run of that pull request (concurrency group, baseline, comment, preview)
- docs/workflows/label-dispatch.md, labels.md, superseded-runs.md, README.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t repo

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
….yml)

A workflow_dispatch run is attached to the head commit but absent from the checks of the
pull request: nothing there tells that a label started something. ci, documentation and
breakage-suite post a pending status at the start and the final one at the end, one
context per workflow ('CI / kkt', 'Documentation', 'Breakage / packages').

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Documenter posts the link to a preview only for a pull_request event; a dispatched run has
none. pr-status.yml adds '<context> / preview' with the link when the preview was deployed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eview

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ocots
ocots merged commit 562dc86 into main Nov 11, 2026
5 checks passed
@ocots
ocots deleted the feat/149-label-dispatch branch November 11, 2026 11:49
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.

Label-triggered workflows: accumulate runs instead of hiding/cancelling them (label → workflow_dispatch)

1 participant