fix(ci): staging-check dispatches infra staging validation and takes the result as a commit status #10

Open
jfraeys wants to merge 3 commits from jfraeys/fix/staging-check-report into main
Owner

Summary

 staging-check (pull_request)
-  echo INFRA_DISPATCH_TOKEN
-  POST jfraeysd/infra/.../staging-validate.yml/dispatches   # no such user
+  POST jfraeys/infra/.../staging-validate.yml/dispatches
+    + report_repo, report_sha (PR head), report_context=staging/validate
-  find the run, poll status every 10s for up to 25 min
+  return

infra staging-validate `report` job
+  POST commit status staging/validate on the PR head commit

Evidence

  • Before: INFRA_REPO="jfraeysd/infra" — GET /repos/jfraeysd/infra returns user redirect does not exist, so the dispatch could never succeed. The job also printed ${{ secrets.INFRA_DISPATCH_TOKEN }} and held the shared runner while waiting on the run it had dispatched.
    After: not run on a runner yet. Checked: the workflow parses (jobs check, lint, build, staging-check), and the dispatch body built by jq is
    {"ref":"main","inputs":{"app_repo":"jfraeys/coaching-site","app_ref":"feat/x","app_check_extra_vars":"coaching_site_branch=feat/x","report_repo":"jfraeys/coaching-site","report_sha":"abc","report_context":"staging/validate"}}

Merge Danger

Door: two-way

Blast Radius: PR checks

  • The PR's own staging-check job now goes green on a successful dispatch, not on staging passing. The result is the staging/validate status; require that context in branch protection if staging should gate merges.
  • Needs infra's CI_FORGEJO_COMMENT_TOKEN to have commit-status write on this repo, and depends on jfraeys/infra#288 (merged) and #287 (app_base install).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

## Summary ```diff staging-check (pull_request) - echo INFRA_DISPATCH_TOKEN - POST jfraeysd/infra/.../staging-validate.yml/dispatches # no such user + POST jfraeys/infra/.../staging-validate.yml/dispatches + + report_repo, report_sha (PR head), report_context=staging/validate - find the run, poll status every 10s for up to 25 min + return infra staging-validate `report` job + POST commit status staging/validate on the PR head commit ``` ## Evidence - **Before:** `INFRA_REPO="jfraeysd/infra"` — `GET /repos/jfraeysd/infra` returns `user redirect does not exist`, so the dispatch could never succeed. The job also printed `${{ secrets.INFRA_DISPATCH_TOKEN }}` and held the shared runner while waiting on the run it had dispatched. **After:** not run on a runner yet. Checked: the workflow parses (jobs `check, lint, build, staging-check`), and the dispatch body built by `jq` is `{"ref":"main","inputs":{"app_repo":"jfraeys/coaching-site","app_ref":"feat/x","app_check_extra_vars":"coaching_site_branch=feat/x","report_repo":"jfraeys/coaching-site","report_sha":"abc","report_context":"staging/validate"}}` ## Merge Danger **Door:** two-way **Blast Radius:** PR checks - The PR's own `staging-check` job now goes green on a successful dispatch, not on staging passing. The result is the `staging/validate` status; require that context in branch protection if staging should gate merges. - Needs infra's `CI_FORGEJO_COMMENT_TOKEN` to have commit-status write on this repo, and depends on jfraeys/infra#288 (merged) and #287 (`app_base` install). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(ci): staging-check dispatches infra staging validation and takes the result as a commit status
Some checks failed
CI / Test & build (pull_request) Successful in 5m51s
CI / golangci-lint (pull_request) Successful in 2m26s
CI / Build artifacts (pull_request) Successful in 1m52s
CI / Dispatch infra staging validation (pull_request) Has been cancelled
53a17a591b
The job targeted jfraeysd/infra (no such user, so the dispatch 404'd), echoed
INFRA_DISPATCH_TOKEN into the log, and polled for up to 25 minutes on the shared
runner it was waiting for. Dispatch against jfraeys/infra with report_repo/report_sha
and return; infra posts staging/validate on the PR head commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
ci(staging-check): post a pending staging/validate status at dispatch
Some checks are pending
CI / Test & build (pull_request) Successful in 5m50s
CI / golangci-lint (pull_request) Successful in 3m47s
CI / Build artifacts (pull_request) Successful in 2m5s
staging/validate Staging validation dispatched; result arrives when it finishes
CI / Dispatch infra staging validation (pull_request) Successful in 1s
9371d20a9c
A staging run superseded while queued is cancelled before any job starts, so infra's
report job never posts for it; the pending status keeps the PR from showing nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
docs(ci): staging-check's comment names the token infra actually posts the status with
Some checks are pending
CI / Test & build (pull_request) Successful in 7m27s
CI / golangci-lint (pull_request) Successful in 2m29s
CI / Build artifacts (pull_request) Successful in 1m54s
staging/validate Staging validation dispatched; result arrives when it finishes
CI / Dispatch infra staging validation (pull_request) Successful in 1s
05588f9da9
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Some checks are pending
CI / Test & build (pull_request) Successful in 7m27s
CI / golangci-lint (pull_request) Successful in 2m29s
CI / Build artifacts (pull_request) Successful in 1m54s
staging/validate Staging validation dispatched; result arrives when it finishes
CI / Dispatch infra staging validation (pull_request) Successful in 1s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin jfraeys/fix/staging-check-report:jfraeys/fix/staging-check-report
git switch jfraeys/fix/staging-check-report

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff jfraeys/fix/staging-check-report
git switch jfraeys/fix/staging-check-report
git rebase main
git switch main
git merge --ff-only jfraeys/fix/staging-check-report
git switch jfraeys/fix/staging-check-report
git rebase main
git switch main
git merge --no-ff jfraeys/fix/staging-check-report
git switch main
git merge --squash jfraeys/fix/staging-check-report
git switch main
git merge --ff-only jfraeys/fix/staging-check-report
git switch main
git merge jfraeys/fix/staging-check-report
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/coaching-site!10
No description provided.