ci: expose SHA-pinned on-demand Dakota lab validation - #757
mrbobbytables wants to merge 1 commit into
Conversation
Add an on-demand validation contract for projectbluefin/dakota PRs under validation class dakota-bst-qa. Allows review automation and operators to request SHA-bound lab validation via GitHub Actions dispatch without cluster credentials. - Validates PR existence, open state, and live head SHA before admission - Rejects unsupported repo/class, closed PR, malformed SHA, and head mismatch - Dedupes identical active requests and permits explicit terminal rerun - Enforces SHA isolation so evidence from SHA A never applies to SHA B - Reports canonical statuses: unavailable, rejected, queued, running, success, failure, cancelled, timeout - Dispatches existing Dakota BuildStream build and container QA pipeline - Publishes queued, running, and terminal evidence back to GitHub Closes projectbluefin#638 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
hanthor
left a comment
There was a problem hiding this comment.
The dispatch workflow cannot authenticate against projectbluefin/dakota
.github/workflows/dakota-validation-dispatch.yml passes the default installation token:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.event.client_payload.repository || ... || 'projectbluefin/dakota' }}secrets.GITHUB_TOKEN in a projectbluefin/lab workflow run is scoped to projectbluefin/lab only. But scripts/dakota_validation.py writes commit statuses to the target repo:
status_url = f"{api_base}/repos/{repository}/statuses/{sha}" # line 318
...
"Authorization": f"Bearer {token}", # line 328with repository = projectbluefin/dakota. Every dispatch will therefore 403 on the status POST. request also reads --token from GITHUB_TOKEN/GH_TOKEN (lines 677, 694), so the same token is used for the pulls/{n} head-SHA verification at line 432 — that one at least works for a public repo, but the status publish does not.
Confirming there is no cross-repo credential in this repo today:
$ grep -rn "secrets\." .github/workflows/ | sort -u
.github/workflows/derive.yml:67: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
.github/workflows/update-test-results.yml:119: DEPLOY_KEY: ${{ secrets.DASHBOARD_DEPLOY_KEY }}
.github/workflows/update-test-results.yml:52: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
.github/workflows/update-test-results.yml:77: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
So this needs either a new org-scoped PAT / App-token secret wired into the workflow, or a GitHub App token minted in-job. As written, permissions: statuses: write grants write on lab, not on dakota — which is misleading, because the workflow will look correctly permissioned and still fail at runtime.
Please also say in the PR body which secret this is meant to use, since the reviewer cannot see org secrets.
What does check out
Nothing else blocking that I could verify mechanically:
python3 -m pytest tests/unit/on this branch merged intomain: 562 passed, 1 skipped (baseline onmainis 539 passed, 1 skipped), so the 559 lines of newtests/unit/test_dakota_validation.pyall pass and nothing regressed.- The branch merges into
maincleanly.
Smaller notes
${RERUN_FLAG}is expanded unquoted underset -euo pipefail. It works (empty string word-splits to nothing), but--rerunwould read more clearly as an array:RERUN_FLAG=(); [[ "${RERUN}" == "true" ]] && RERUN_FLAG=(--rerun)then"${RERUN_FLAG[@]}".github.event.inputsis the deprecated spelling;inputs.*is the current one forworkflow_dispatch. Not urgent, butactionlintmay start flagging it.- This is 1592 added lines across 8 files with zero PR CI running on it —
lint.yamlandci.ymldo trigger onpull_request, but every run on a fork/bot head in this repo completes withconclusion: action_required(approval gate), so no check has actually executed. Worth calling out thatjust lint/actionlintoutput was run locally before merge, since nobody else can see it.
Generated by Claude Code
Summary
Exposes an on-demand, SHA-bound validation contract for
projectbluefin/dakotapull requests under validation classdakota-bst-qa. This provides review automation (review) and operators with a reliable, bounded mechanism to request lab validation without cluster credentials.Scope & Implementation
.github/workflows/dakota-validation-dispatch.ymlsupportingrepository_dispatch(types:dakota-validation,dakota-bst-qa) andworkflow_dispatchrunning onghost-runners.scripts/dakota_validation.pyto validate requests and query live PR head state before cluster submission. Rejects unsupported repo/class, closed PRs, malformed SHAs, and head mismatches.queuedorrunning) are deduped; explicit terminal rerun (--rerun) is permitted for completed runs.argo/workflow-templates/dakota-bst-qa.yamlto run the existing Dakota BuildStream build and container QA pipelines.unavailable,rejected,queued,running,success,failure,cancelled,timeout) and publishestesting-lab/dakota-bst-qacommit status evidence back to GitHub.dakota-validate-requestanddakota-validate-statusrecipes toJustfile.docs/reference/WORKFLOWS.mdanddocs/skills/dakota-pr-review/SKILL.md.Closes #638
— hive: backend=copilot model=gemini-3.8-flash
🐝 Hive Agent:
contributor| SHA:7c072e4ec