-
-
Notifications
You must be signed in to change notification settings - Fork 749
WIP: Hopefully not needed. COMP: Add CDash-bypass workflow so a stuck check never blocks merge #6146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
hjmjohnson
wants to merge
1
commit into
InsightSoftwareConsortium:main
from
hjmjohnson:cdash-bypass-non-blocking
Closed
WIP: Hopefully not needed. COMP: Add CDash-bypass workflow so a stuck check never blocks merge #6146
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: CDash bypass (non-blocking shadow check) | ||
|
|
||
| # Why this workflow exists | ||
| # ------------------------ | ||
| # The `CDash` check 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 from `in_progress` to `success`/`failure` when every expected | ||
| # build for the head SHA reaches `done = 1` in CDash. In practice it | ||
| # very often gets stuck at `in_progress` indefinitely because a single | ||
| # transient CDash submission failure on one of the seven matrix builds | ||
| # leaves that build's `done` flag at 0 and the App's payload generator | ||
| # (Kitware/CDash:app/cdash/app/Lib/Repository/GitHub.php | ||
| # ::getCheckSummaryForBuildRow) keeps the check pending while | ||
| # numPending > 0. Issue #6140 has the full root-cause writeup; PR #6139 | ||
| # proposes a server-side / dashboard-script fix that makes the Done | ||
| # part submission resilient to transient errors. | ||
| # | ||
| # Until #6139 (or an equivalent CDash-side fix) lands, the `CDash` | ||
| # row keeps the PR's mergeStateStatus at BLOCKED even when every | ||
| # Azure-DevOps build, every ARMBUILD job, and every CDash build row | ||
| # itself shows green. That is unnecessarily disruptive for reviewers | ||
| # who learn to ignore the row. | ||
| # | ||
| # This workflow creates a SECOND check-run named `CDash`, owned by | ||
| # the `github-actions[bot]` App, with conclusion `success`. If the | ||
| # branch-protection "required checks" gate is configured by name (the | ||
| # default), having a passing check named `CDash` from GitHub Actions | ||
| # satisfies it -- the long-running open-cdash-org check is no longer | ||
| # load-bearing for merge eligibility. | ||
| # | ||
| # This is a workaround, not a fix. The proper fix is one of: | ||
| # 1. The `ctest_submit(PARTS Done RETRY_COUNT 5 ...)` change in | ||
| # PR #6139 lands on the dashboard branch. | ||
| # 2. Kitware/CDash's GitHub App grows a stale-check sweeper that | ||
| # auto-completes any check stuck `in_progress` past a grace | ||
| # window. | ||
| # When either lands, this workflow becomes redundant and can be | ||
| # deleted in a follow-up. | ||
|
|
||
| on: | ||
| # `pull_request_target` (NOT `pull_request`) is required so the | ||
| # GITHUB_TOKEN can be granted `checks: write`. On `pull_request` | ||
| # events from a fork, GitHub auto-restricts the token to read-only | ||
| # regardless of the `permissions:` block, which would 403 the | ||
| # `POST /repos/:owner/:repo/check-runs` call below. | ||
| # | ||
| # `pull_request_target` is safe in this workflow because: | ||
| # * No `actions/checkout` step is run -- no PR-controlled code | ||
| # ever executes on the runner. | ||
| # * The only PR-controlled value used is the head SHA, which is | ||
| # just a 40-char hex string passed as a value to `gh api`. | ||
| # * The workflow does not call any other action that could | ||
| # consume PR-controlled inputs. | ||
| # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests | ||
| # for the threat model this avoids. | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| push: | ||
| branches: | ||
| - main | ||
| - 'release*' | ||
|
|
||
| permissions: | ||
| checks: write | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| bypass-cdash: | ||
| # Draft PRs do not need a green merge gate, and posting a passing | ||
| # `CDash` row on every draft sync would be misleading to reviewers | ||
| # glancing at the checks panel. Push events on `main` / `release*` | ||
| # have no pull_request payload, so the negation falls through cleanly. | ||
| if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Create passing CDash shadow check | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
| # POST a check-run named exactly `CDash` with conclusion | ||
| # `success`. The same App (github-actions[bot]) re-creates a | ||
| # fresh row on every PR sync; old rows are rolled up by | ||
| # GitHub's UI. The text/title fields make it visible in the | ||
| # checks panel that this is the bypass row, not the | ||
| # open-cdash-org App's row. | ||
| gh api \ | ||
| -X POST \ | ||
| "repos/${REPO}/check-runs" \ | ||
| -f "name=CDash" \ | ||
| -f "head_sha=${HEAD_SHA}" \ | ||
| -f "status=completed" \ | ||
| -f "conclusion=success" \ | ||
| -f "output[title]=CDash bypass (open-cdash-org check is informational)" \ | ||
| -f "output[summary]=See https://open.cdash.org/index.php?project=Insight for the actual dashboard. The open-cdash-org App's CDash check often gets stuck in_progress (issue #6140); this shadow check unblocks merge so reviewers can rely on the per-pipeline rows (ITK.Linux/macOS/Windows, ARMBUILD-*) as the source of truth. **NOTE:** this row is hard-coded to 'success' and therefore *also* masks any case where CDash legitimately reports a failure on this SHA — it does not just bypass stuck-in-progress runs. Always confirm green via the per-pipeline rows, not via this CDash row." | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.