Skip to content

ci: add an all-required summary check for pull requests - #567

Open
BunsDev wants to merge 10 commits into
mainfrom
ci/all-required-summary
Open

BunsDev wants to merge 10 commits into
mainfrom
ci/all-required-summary

Conversation

@BunsDev

@BunsDev BunsDev commented Nov 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds .github/workflows/all-required.yml: one check, all-required, that reports on every pull request and is green only when every other workflow run and check on the PR head passed. "Fully green" becomes one status instead of a count (15 checks for a full Rust PR, 14 installer-only, 13 CI-only).
  • No existing workflow, job, step or trigger changes.

Context

  • Related issue/user request: goal sweep v5, item C5 (one required summary check in CI). There is no issue for it.
  • Scope: one new workflow file.
  • Non-goals: making it a branch-protection rule (a maintainer step, described below); changing any path filter; covering commit statuses such as the Vercel docs preview.

Why this design

All 15 workflows that run on pull_request are path-filtered (rust-ci, tui-tests, installer, windows-installer, marketplace, npm-install, npm-launcher, npm-packaging, published-release-smoke, release-candidate, release-marker, release-note, release-version, version-stamp, viewer). A docs-only PR triggers none of them. CodeQL default setup also runs on PR heads as a dynamic workflow.

  • Option (a), an all-required job inside each workflow that needs: its jobs: needs: stops at the workflow boundary, so it would give 15 summary checks, not one. Worse, a path-filtered workflow never reports, and a required check that never reports blocks the PR forever. Making it report would mean removing the path filters from existing workflows, which changes their triggers.
  • workflow_run: a run started by workflow_run is attached to the default branch, not the PR head, so its result does not appear on the PR, and it never fires on a PR where nothing else ran.
  • Chosen: option (b), one workflow on pull_request with no path filter, so it reports on every PR. Its job polls the Actions runs API and the check-runs API for github.event.pull_request.head.sha:
    • It counts only the latest run of each workflow on that SHA (a superseded or re-opened duplicate does not count), and only check runs from those runs' check suites; check runs from other apps (the code-scanning CodeQL check) count by latest per name. Its own workflow is excluded.
    • It fails as soon as any counted run or check ends failure, cancelled, timed_out, stale, action_required or startup_failure.
    • It passes once every counted run and check is completed (success, skipped or neutral) and the set is unchanged across two polls. When nothing else was triggered it passes after about a minute.
    • It needs only actions: read and checks: read, so it also works for fork PRs. It uses gh and jq from the runner image; no action is used, so nothing new needs pinning.
    • It polls every 60 seconds (two API calls per poll) to stay well inside the GITHUB_TOKEN limit of 1,000 requests per hour per repository when several PRs run at once. A failed API call is retried at the next poll rather than failing the check. The job times out after 120 minutes.

Limits:

  • After re-running a failed job in another workflow, re-run all-required too (gh run rerun <run id>, or "Re-run all jobs" on its run). It waits for the re-run to finish. A new push does this automatically.
  • Commit statuses (the Vercel docs preview) are not counted.
  • The code-scanning CodeQL check is created by GitHub after an analysis upload; the job counts it when it exists. Keep it as its own required check if it must always gate.

Changes

  • .github/workflows/all-required.yml: new.

Making it required (maintainer step)

main has no branch protection or ruleset today. After this merges:

  1. Settings, Rules, Rulesets, New branch ruleset. Name it, set Enforcement to Active, add the target "Include default branch".
  2. Enable "Require status checks to pass", add the check all-required with the source GitHub Actions. It is offered once it has run on a PR, which this PR does.
  3. Leave other rules as wanted and save.

Because the workflow has no path filter, every PR gets the status, so requiring it cannot leave a PR waiting for a check that never runs. No per-job check needs to be required alongside it. The same ruleset with the CLI:

gh api -X POST repos/OpenCoven/coven-code/rulesets --input - <<'JSON'
{"name": "main: all-required", "target": "branch", "enforcement": "active",
 "conditions": {"ref_name": {"include": ["~DEFAULT_BRANCH"], "exclude": []}},
 "rules": [{"type": "required_status_checks", "parameters": {
   "strict_required_status_checks_policy": false,
   "required_status_checks": [{"context": "all-required", "integration_id": 15368}]}}]}
JSON

integration_id 15368 is the GitHub Actions app. Agents can then read one status: gh api repos/OpenCoven/coven-code/commits/<head>/check-runs?check_name=all-required --jq '.check_runs[0].conclusion'.

Validation

  • git diff --check: clean.
  • actionlint .github/workflows/all-required.yml (with shellcheck): clean.
  • cargo fmt --all: N/A, no Rust change.
  • cargo check --workspace: N/A, no Rust change.
  • cargo clippy --workspace --all-targets -- -D warnings: N/A, no Rust change.
  • cargo test --workspace: N/A, no Rust change.
  • Targeted/manual checks: live runs on this PR, listed under Evidence.
  • Not run: local cargo gates (no Rust change). This PR changes only .github/workflows/all-required.yml, which matches no other workflow's path filter, so Rust CI and the TUI suite do not run on it.

PR Readiness

  • Diff is limited to the intended files.
  • Generated files were not edited by hand.
  • User-facing docs/help were updated or are not needed (the workflow's header comment documents it; the branch-protection step is above).
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risks or follow-up work are listed above.

Evidence

Runs on this PR are recorded here as they finish.

Every pull_request workflow in this repository is path-filtered, so a
full Rust PR shows 15 checks, an installer-only PR 14 and a CI-only PR
13, and agents decide "fully green" by counting. `needs:` cannot reach
across workflows.

all-required.yml has no path filter, so it reports on every pull
request. Its one job waits for every other workflow run on the PR head
(latest run per workflow, CodeQL default setup included) and every
check run from another app, fails as soon as one ends failed,
cancelled, timed out, stale, action_required or startup_failure, and
passes once all have completed and the set is unchanged across two
polls. No existing workflow changes.
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 19, 2026 10:37am UTC

Request Review

From review: take the latest run per workflow and event, so a manual
dispatch on the branch cannot hide the pull_request run; take check
runs per check suite and job name; wait 90 s before confirming a
completed set, so a late code-scanning update is seen; flatten names
before printing them; and say in the header that the result is final
for its run, that commit statuses are not read, and that a PR editing
this file changes the gate.
From the second review: accept only a numeric workflow id for the
self-exclusion lookup, since gh prints an HTTP error body to stdout;
treat any completed conclusion other than success, skipped or neutral
as a failure; give up after ten failed polls in a row instead of
waiting for the job timeout; tolerate a null name; poll every 90 s to
spare the shared GITHUB_TOKEN budget; and run with -e explicitly.
From the third review: while a workflow is running again, a failed job
from its earlier attempt counts as pending, because a re-run job that
waits on `needs:` gets its new check run only when it is queued; and
pull_request runs that belong to another PR with the same head commit
are left out.
From the fourth review: a run's pull_requests lists every open PR with
that head, so the filter could not tell two such PRs apart, and a
closed PR's runs list none. Say instead that PRs with the same head
share runs.
From the final-head review: when a poll fails and the rate_limit
endpoint reports no requests left, sleep until the reset instead of
counting the poll towards the ten-error limit, so a burst of pull
requests cannot turn every waiting check red.

This branch was successfully deployed

1 active deployment
Preview — 291a674e Deployed Nov 19, 2026 by vercel[bot]
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