Skip to content

app/: a cancelled, failed or timed-out GitHub Actions run closes the builds it was sending (workflow_run) - #150

Merged
ndbroadbent merged 1 commit into
mainfrom
workflow-run-closes-builds
Dec 3, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
workflow-run-closes-builds

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

The GitHub App now subscribes to Workflow run. When a run completes with conclusion cancelled, failure or timed_out, its builds that are still receiving are closed at once. Before this, they stayed open until the sweep gave up on them an hour later.

Which builds: CI builds of the repository's linked projects for the run's head_sha, still receiving, whose environment_info.job_url is that run's page (the CLI records https://github.com/<repo>/actions/runs/<id>). Matching the run, not just the commit, matters: a lint workflow failing on the same commit must not close the visual workflow's build while it's still uploading. Builds without a job URL (other CI providers) and finalized builds are left alone.

Each closed build fails as an abandoned one does, with the reason and the run's link: "The CI run sending this build was cancelled, so VisualCI closed it before visualci build finalize: . Re-run the job to send a new build." Its check's title is the part before ", so ". BuildChanged follows, so the check, PR comment and pages update. Delivering the same event twice closes nothing more.

  • app/src/forge/webhooks.rs: ForgeEvent::RunEnded (read from workflow_run completed), handled by…
  • app/src/domain/processing.rs: close_for_ended_run and run_ended_error.
  • app/tests/webhooks.rs: cancelled and timed-out runs close their builds. Another workflow's build on the same commit, a finalized build, a successful run and an in-progress run are left alone. A second delivery closes nothing.
  • docs/deploy.md: notes this next to the sweep.

webhooks, sweep and forge_reports tests, fmt and clippy all pass on docspring-dev.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@ndbroadbent
ndbroadbent force-pushed the workflow-run-closes-builds branch from e160846 to cfa467a Compare December 3, 2026 22:06
@ndbroadbent
ndbroadbent merged commit 1aa64c8 into main Dec 3, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the workflow-run-closes-builds branch December 3, 2026 22:21
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.

1 participant