GMA-736: Restore Pistache CI and production deployment evidence mapping #1191

Open
gmackie wants to merge 4 commits from bob/GMA-736-restore-pistache-ci-and-production-deployment-evid into main
Owner

Repository: https://git.forgegraf.com/gmackie/ForgeGraph
Goal: Restore ForgeGraph delivery evidence for the enrolled Pistache application.
Observed: forge ci status reports idle/no runs and deploy create production --ref 2ddcb93c2a3befb3932de912768ab8a131ab89c9 sees CI none, while Forgejo commit statuses show active/passing main CI. forge deploy history --stage production is empty despite the application's existing CI-driven labnuc receiver deployment history.
Scope: Diagnose app/repository/commit mapping and ingest production deployment evidence from the supported labnuc receiver. Do not bypass green-CI checks or manufacture deployment records.
Acceptance: CLI CI evidence matches Forgejo for this commit; production target resolves to labnuc; deployment ID, artifact and health evidence are traceable; GMA-733 can complete only after verified delivery.
Delivery target: ForgeGraph production integration. Cross-project dependency: Pistache GMA-733 (https://tasks.gmac.io/gmacko/issue/GMA-733), PR gmackie/pistache#108.

Refs: GMA-736

Repository: https://git.forgegraf.com/gmackie/ForgeGraph Goal: Restore ForgeGraph delivery evidence for the enrolled Pistache application. Observed: forge ci status reports idle/no runs and deploy create production --ref 2ddcb93c2a3befb3932de912768ab8a131ab89c9 sees CI none, while Forgejo commit statuses show active/passing main CI. forge deploy history --stage production is empty despite the application's existing CI-driven labnuc receiver deployment history. Scope: Diagnose app/repository/commit mapping and ingest production deployment evidence from the supported labnuc receiver. Do not bypass green-CI checks or manufacture deployment records. Acceptance: CLI CI evidence matches Forgejo for this commit; production target resolves to labnuc; deployment ID, artifact and health evidence are traceable; GMA-733 can complete only after verified delivery. Delivery target: ForgeGraph production integration. Cross-project dependency: Pistache GMA-733 (https://tasks.gmac.io/gmacko/issue/GMA-733), PR https://git.forgegraf.com/gmackie/pistache/pulls/108. Refs: GMA-736
Restore Pistache CI and labnuc delivery evidence mapping
All checks were successful
Preview / deploy (pull_request) Has been skipped
Preview / cleanup (pull_request) Has been skipped
Preview / e2e (pull_request) Has been skipped
CI / superseded (pull_request) Successful in 2s
Preview / release (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 21s
CI / storybook (pull_request) Successful in 1m35s
CI / unit-api (pull_request) Successful in 2m13s
CI / database-d1 (pull_request) Has been skipped
CI / web-build (pull_request) Successful in 2m38s
CI / unit-web (pull_request) Successful in 2m55s
CI / checks (pull_request) Successful in 3m1s
CI / go (pull_request) Successful in 47s
CI / database (pull_request) Successful in 3m39s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 34s
35e99f9617
Refs: GMA-736
bob-reviewer requested changes 2026-11-20 04:07:02 +00:00
Dismissed
bob-reviewer left a comment

[P1] Do not interpret a server-capped status page as complete history (packages/api/src/lib/forgejo-api.ts:1793). getCommitStatusEvidence requests limit=100, then returns whenever batch.length < 100. The actual git.forgegraf.com /api/v1/settings/api response reports max_response_items=50, so a capped first page is treated as the entire history even when more pages exist. A commit with enough status updates can have a failed/pending context whose latest observation is on page 2; importing only green contexts from page 1 lets evaluateCIBuilds report pass. Follow provider pagination metadata or continue until an empty page (retaining the bounded-history refusal), and add a regression test with a 50-item first page and a failed/pending context on page 2 despite requesting 100. The existing test only simulates a full 100-item page and misses the production cap.

The documented historical/current delivery distinction and explicit administrative receipt workflow are clear. Four receiver collector tests passed when executed from the reviewed commit in memory. Required bob-check was attempted but typecheck/lint/test/build could not start because dependencies are absent (turbo: not found); no source changes or commits were made.

[P1] Do not interpret a server-capped status page as complete history (packages/api/src/lib/forgejo-api.ts:1793). getCommitStatusEvidence requests limit=100, then returns whenever batch.length < 100. The actual git.forgegraf.com /api/v1/settings/api response reports max_response_items=50, so a capped first page is treated as the entire history even when more pages exist. A commit with enough status updates can have a failed/pending context whose latest observation is on page 2; importing only green contexts from page 1 lets evaluateCIBuilds report pass. Follow provider pagination metadata or continue until an empty page (retaining the bounded-history refusal), and add a regression test with a 50-item first page and a failed/pending context on page 2 despite requesting 100. The existing test only simulates a full 100-item page and misses the production cap. The documented historical/current delivery distinction and explicit administrative receipt workflow are clear. Four receiver collector tests passed when executed from the reviewed commit in memory. Required bob-check was attempted but typecheck/lint/test/build could not start because dependencies are absent (turbo: not found); no source changes or commits were made.
gmackie referenced this pull request from a commit 2026-11-20 04:18:41 +00:00
fix: resolve merge blockers for #1191
All checks were successful
Preview / deploy (pull_request) Has been skipped
Preview / cleanup (pull_request) Has been skipped
CI / superseded (pull_request) Successful in 2s
Preview / e2e (pull_request) Has been skipped
Preview / release (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 16s
CI / storybook (pull_request) Successful in 1m40s
CI / database-d1 (pull_request) Has been skipped
CI / unit-api (pull_request) Successful in 2m20s
CI / database (pull_request) Successful in 2m29s
CI / unit-web (pull_request) Successful in 2m57s
CI / checks (pull_request) Successful in 3m7s
CI / web-build (pull_request) Successful in 3m55s
CI / go (pull_request) Successful in 3m5s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 35s
cbaf08c367
bob-reviewer requested changes 2026-11-20 04:22:14 +00:00
Dismissed
bob-reviewer left a comment

Request changes: [P1] Verify the actual Actions job before importing green evidence (packages/api/src/lib/forgejo-ci-evidence.ts:25-37; packages/api/src/lib/forgejo-api.ts:getCommitStatusEvidence).

The check only validates the caller-controlled commit status target_url's origin/path. It never loads the referenced run/job to verify existence, commit SHA, or result. A custom success status pointing to a nonexistent job or a passing run for another commit is therefore persisted as passed for input.sha; when this is the missing evidence, the existing CI gate returns pass. I reproduced normalization plus evaluateCIBuilds accepting /o/r/actions/runs/999999999/jobs/0 and returning pass. Reading the status from the authenticated host does not establish that it was produced by that Actions job. Resolve the referenced run/job through trusted provider data, bind it to the requested repository and SHA, and validate the observed job result before writing builds. Add regression cases for nonexistent jobs, wrong-commit runs, and status/job-result disagreement.

The receiver repair documentation distinguishes current delivery from the unproven historical deployment and keeps GMA-733 separately gated. Validation limitation: bob-check attempted typecheck/lint/test/build but all were blocked by missing dependencies (turbo: not found); no full-suite success is claimed. Review only; no source changes.

Request changes: [P1] Verify the actual Actions job before importing green evidence (packages/api/src/lib/forgejo-ci-evidence.ts:25-37; packages/api/src/lib/forgejo-api.ts:getCommitStatusEvidence). The check only validates the caller-controlled commit status target_url's origin/path. It never loads the referenced run/job to verify existence, commit SHA, or result. A custom success status pointing to a nonexistent job or a passing run for another commit is therefore persisted as passed for input.sha; when this is the missing evidence, the existing CI gate returns pass. I reproduced normalization plus evaluateCIBuilds accepting /o/r/actions/runs/999999999/jobs/0 and returning pass. Reading the status from the authenticated host does not establish that it was produced by that Actions job. Resolve the referenced run/job through trusted provider data, bind it to the requested repository and SHA, and validate the observed job result before writing builds. Add regression cases for nonexistent jobs, wrong-commit runs, and status/job-result disagreement. The receiver repair documentation distinguishes current delivery from the unproven historical deployment and keeps GMA-733 separately gated. Validation limitation: bob-check attempted typecheck/lint/test/build but all were blocked by missing dependencies (turbo: not found); no full-suite success is claimed. Review only; no source changes.
gmackie referenced this pull request from a commit 2026-11-20 04:39:52 +00:00
fix: resolve merge blockers for #1191
All checks were successful
Preview / deploy (pull_request) Has been skipped
Preview / cleanup (pull_request) Has been skipped
CI / superseded (pull_request) Successful in 2s
Preview / e2e (pull_request) Has been skipped
Preview / release (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 15s
CI / storybook (pull_request) Successful in 1m33s
CI / database-d1 (pull_request) Has been skipped
CI / unit-api (pull_request) Successful in 2m23s
CI / database (pull_request) Successful in 2m39s
CI / checks (pull_request) Successful in 3m6s
CI / unit-web (pull_request) Successful in 3m16s
CI / web-build (pull_request) Successful in 3m53s
CI / go (pull_request) Successful in 3m4s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 34s
a88e5053b5
bob-reviewer requested changes 2026-11-20 04:44:29 +00:00
Dismissed
bob-reviewer left a comment

[P2] Reconciled non-green jobs never converge through normal CI completion (apps/web/src/app/api/fg/ci/reconcile/route.ts:98-126; packages/api/src/lib/forgejo-ci-evidence.ts:57). Applying reconciliation during a running job persists a running forgejo-status: build with a synthetic status: run ID. The normal /api/fg/ci/report completion path writes forgejo: with the provider run ID, so it cannot update this row. evaluateCIBuilds deduplicates only by exact pipelineName: even after the workflow passes, the imported running row keeps the gate pending indefinitely. A reconciled failed job similarly keeps a subsequently successful rerun blocked. Please integrate imported observations into the completion/reconciliation lifecycle so newer authoritative completion supersedes them without another manual repair. Add regression coverage for reconcile-running -> normal-success and reconcile-failed -> successful-rerun through the actual gate evaluator.

The explicit host job verification, administrative authorization, and distinction between current receiver evidence and unavailable historical delivery proof are good safeguards. Verification limitation: bob-check could not execute checks because this review checkout lacks node_modules (turbo: not found); checkout HEAD also differs from the reviewed head, so assessment is based on the fetched PR diff and surrounding code. No source changes made.

[P2] Reconciled non-green jobs never converge through normal CI completion (apps/web/src/app/api/fg/ci/reconcile/route.ts:98-126; packages/api/src/lib/forgejo-ci-evidence.ts:57). Applying reconciliation during a running job persists a running forgejo-status:<context> build with a synthetic status: run ID. The normal /api/fg/ci/report completion path writes forgejo:<workflow> with the provider run ID, so it cannot update this row. evaluateCIBuilds deduplicates only by exact pipelineName: even after the workflow passes, the imported running row keeps the gate pending indefinitely. A reconciled failed job similarly keeps a subsequently successful rerun blocked. Please integrate imported observations into the completion/reconciliation lifecycle so newer authoritative completion supersedes them without another manual repair. Add regression coverage for reconcile-running -> normal-success and reconcile-failed -> successful-rerun through the actual gate evaluator. The explicit host job verification, administrative authorization, and distinction between current receiver evidence and unavailable historical delivery proof are good safeguards. Verification limitation: bob-check could not execute checks because this review checkout lacks node_modules (turbo: not found); checkout HEAD also differs from the reviewed head, so assessment is based on the fetched PR diff and surrounding code. No source changes made.
gmackie referenced this pull request from a commit 2026-11-20 05:01:44 +00:00
fix: resolve merge blockers for #1191
Some checks failed
Preview / deploy (pull_request) Has been skipped
Preview / cleanup (pull_request) Has been skipped
CI / superseded (pull_request) Successful in 2s
Preview / e2e (pull_request) Has been skipped
Preview / release (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 18s
CI / unit-api (pull_request) Successful in 41s
CI / database-d1 (pull_request) Has been skipped
CI / storybook (pull_request) Successful in 1m6s
CI / go (pull_request) Successful in 41s
CI / checks (pull_request) Successful in 2m11s
CI / database (pull_request) Successful in 2m12s
CI / unit-web (pull_request) Failing after 2m36s
forgegraph/ci CI failed
CI / ci (pull_request) Failing after 36s
CI / web-build (pull_request) Successful in 3m48s
886053de10
bob-reviewer left a comment

[P1] Refresh drops newly observed CI contexts and can return a false green gate (apps/web/src/lib/refresh-reconciled-ci.ts:34-36). The refresh iterates imported rows, rather than the full verified evidence returned by Forgejo. If reconciliation initially imports job A and another workflow/job B subsequently reports pending or failure for the same SHA, refresh verifies B but silently discards it because no stored row exists. Both GET /api/fg/ci/gate and checkCIStatus then evaluate only A and can return pass, violating the green-CI requirement. Persist newly discovered verified contexts atomically with the existing updates, or fail closed until they are reconciled. Add regression coverage for new pending and failed contexts after the initial import.

Validation: reproduced against this head's actual refresh and evaluateCIBuilds functions with mocked database/provider boundaries: provider A=passed, new B=failed => stored gate=pass. Reviewed the reconciliation, provider job validation, receiver collection/registration and surrounding gate/receipt logic. bob-check attempted typecheck/lint/test/build but all were blocked by missing dependencies (turbo: not found); the checkout is not the PR head, so no full head-suite pass is claimed. No tracked files changed.

[P1] Refresh drops newly observed CI contexts and can return a false green gate (apps/web/src/lib/refresh-reconciled-ci.ts:34-36). The refresh iterates imported rows, rather than the full verified evidence returned by Forgejo. If reconciliation initially imports job A and another workflow/job B subsequently reports pending or failure for the same SHA, refresh verifies B but silently discards it because no stored row exists. Both GET /api/fg/ci/gate and checkCIStatus then evaluate only A and can return pass, violating the green-CI requirement. Persist newly discovered verified contexts atomically with the existing updates, or fail closed until they are reconciled. Add regression coverage for new pending and failed contexts after the initial import. Validation: reproduced against this head's actual refresh and evaluateCIBuilds functions with mocked database/provider boundaries: provider A=passed, new B=failed => stored gate=pass. Reviewed the reconciliation, provider job validation, receiver collection/registration and surrounding gate/receipt logic. bob-check attempted typecheck/lint/test/build but all were blocked by missing dependencies (turbo: not found); the checkout is not the PR head, so no full head-suite pass is claimed. No tracked files changed.
Some checks failed
Preview / deploy (pull_request) Has been skipped
Preview / cleanup (pull_request) Has been skipped
CI / superseded (pull_request) Successful in 2s
Preview / e2e (pull_request) Has been skipped
Preview / release (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 18s
Required
Details
CI / unit-api (pull_request) Successful in 41s
CI / database-d1 (pull_request) Has been skipped
CI / storybook (pull_request) Successful in 1m6s
CI / go (pull_request) Successful in 41s
CI / checks (pull_request) Successful in 2m11s
CI / database (pull_request) Successful in 2m12s
CI / unit-web (pull_request) Failing after 2m36s
forgegraph/ci CI failed
CI / ci (pull_request) Failing after 36s
Required
Details
CI / web-build (pull_request) Successful in 3m48s
This pull request has changes conflicting with the target branch.
  • apps/web/src/app/api/fg/ci/report/route.database.test.ts
  • apps/web/src/lib/auto-deploy.ts
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin bob/GMA-736-restore-pistache-ci-and-production-deployment-evid:bob/GMA-736-restore-pistache-ci-and-production-deployment-evid
git switch bob/GMA-736-restore-pistache-ci-and-production-deployment-evid
Sign in to join this conversation.
No description provided.