WIP: Hopefully not needed. COMP: Add CDash-bypass workflow so a stuck check never blocks merge - #6146
Conversation
045679d to
cfdebca
Compare
|
| Filename | Overview |
|---|---|
| .github/workflows/cdash-bypass.yml | New workflow that posts a synthetic passing CDash check-run via gh api to unblock PRs where the real open-cdash-org check is stuck in_progress; uses pull_request_target safely (no checkout, SHA-only PR-controlled value). Two P2 style notes: fires on draft PRs, always-success masking real failures. |
Sequence Diagram
sequenceDiagram
participant Fork as Fork PR / Push
participant GHA as GitHub Actions Runner
participant API as GitHub Check-Runs API
participant BP as Branch Protection Gate
participant CDash as open-cdash-org App
Fork->>GHA: pull_request_target (opened/sync/reopen/ready) or push to main
GHA->>API: POST /repos/{repo}/check-runs name=CDash, conclusion=success
API-->>BP: Passing CDash check from github-actions[bot]
BP-->>Fork: mergeStateStatus unblocked
CDash-->>API: CDash check stuck in_progress
Note over CDash,BP: open-cdash-org row still visible but no longer load-bearing for merge gate
Reviews (1): Last reviewed commit: "COMP: Add CDash-bypass workflow so a stu..." | Re-trigger Greptile
Creates a second `CDash` check-run from `github-actions[bot]` with conclusion `success`, satisfying name-based branch protection while the open-cdash-org App's row sits in `in_progress`. Workaround for InsightSoftwareConsortium#6140; revert when InsightSoftwareConsortium#6139 (or a CDash-side stale-check sweeper) lands. Rationale and the safe-`pull_request_target` review live in the workflow header.
cfdebca to
17c86c5
Compare
|
@dzenanz I'll be honest here. This CDASH flakiness has been frustrating me. My personal opinion is that we should just remove the CDash check completely, its value is much less than the disruption of not having green CI (at least for me :)... I've never used the local CDash report; I have been conditioned to look at the webpage. A better solution would be to fix the upstream CDash code, and I made a 100% agentic coding PR to make a recommendation for how it could be done upstream. |
|
#6139 was merged. What else needs to be done? @zackgalbreath might want to be involved. |
|
I could've sworn I fixed this in #6033 (comment) but I just checked and this setting was off. I just (re-?) enabled it. Please feel free to ping me if you notice any failed or pending statuses from open.cdash.org going forward. |
|
Thanks @zackgalbreath I'll keep an eye on it. It hit me hard this weekend, but hopefully this switch will persist. I know you tried to do it last week, but accidents happen, and we will give it another go 👍 :). |
|
closing. Assuming the missed changes will fix cdash in the future. |
Adds a tiny GitHub Actions workflow that creates a second
CDashcheck-run with conclusionsuccessfrom thegithub-actions[bot]App on every PR / push tomain. When branch protection's required-status list is name-based, this satisfies the merge gate so the open-cdash-org App's flakyin_progressrow is no longer load-bearing.Workaround, not a fix — to be reverted when either #6139 (server/dashboard fix) lands or Kitware/CDash's App gains a stale-check sweeper. References #6140 (root cause), #6137 / #6138 (most recent observed instances).
Why this exists
The
CDashcheck on every PR is created by the open-cdash-org GitHub App when CTest first submits to https://open.cdash.org/, and is meant to flip fromin_progresstosuccess/failurewhen every expected build for the head SHA reachesdone = 1in CDash. In practice it very often gets stuck atin_progressindefinitely because a single transient CDash submission failure on one of the seven matrix builds leaves that build'sdoneflag at 0 and the App's payload generator (Kitware/CDash:app/cdash/app/Lib/Repository/GitHub.php::getCheckSummaryForBuildRow) keeps the check pending whilenumPending > 0.Issue #6140 has the full root-cause writeup; PR #6139 proposes the server-side / dashboard-script fix (
ctest_submit(PARTS Done RETRY_COUNT 5 …)) that makes the Done-part submission resilient to transient errors. Until that lands theCDashrow keeps the PR atmergeStateStatus: BLOCKEDfor hours even when every Azure pipeline and every CDash build row itself shows green.How the workaround works
The workflow:
pull_request_targetopen/sync/reopen/ready and every push tomain/release*.permissions: { checks: write }.gh api -X POST repos/${REPO}/check-runswithname=CDash,head_sha=<PR head>,status=completed,conclusion=success.output.summaryso anyone clicking the row sees that this is a bypass and the per-pipeline rows are the real signal.This creates a second check-run with name
CDash. GitHub's branch-protection rule for "required status checks" is configured by name in the default UI flow, so a passingCDashcheck from any App satisfies the gate. The open-cdash-org App'sin_progressrow is still visible in the UI but no longer blocks merge.If your repo's branch protection is configured to require
CDashfrom the open-cdash-org App specifically (the rare advanced configuration), this workaround does not help — that case requires a repo-admin change to relax the gate or remove the App-pin.Why pull_request_target is safe here
pull_request_targetruns the workflow with the base repo's permissions — includingchecks: write— instead of the read-only token a fork-PR would normally get. That's normally a security concern because PR-controlled code could escalate, but this workflow is safe because:actions/checkoutstep is run — no PR-controlled code ever executes on the runner.gh api.See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ for the threat model this avoids.
Removal plan
This workflow file is deliberately self-documenting about its temporary nature. Delete it (one-line
rm) when either:ctest_submit(PARTS Done RETRY_COUNT 5 ...)change lands on the dashboard branch and the next batch of PRs demonstrates that real CDash completion happens reliably, orin_progresspast a grace window.