Repository navigation
fix: approved fork pull request runs fail restoring a source snapshot that was never captured - #232
Conversation
…ver captured A fork pull request run that waits for approval ends attempt 1 as action_required without running any job, so the approved attempt 2 tried to download an openclaw-source-resolution artifact that never existed (#219). Source capture now decides from run state rather than the attempt number: reuse when the artifact is listed or an earlier attempt ran (or may have run) its upload, and resolve fresh only when no earlier attempt could have uploaded one. The attempt that resolves uploads the snapshot.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe workflow uses artifact and job history to decide whether to capture or reuse its immutable OpenClaw source snapshot. Example: Run 41113043368 reaches attempt 2 after fork approval, while attempt 1 ran zero jobs.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a confirmed contributor-workflow failure still present on main, with no actionable introduced defect found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSource preflight converts workflow context and upstream selection into a validated immutable artifact consumed by package builds and signing authorization. flowchart LR
A[Workflow attempt] --> B[Inspect artifacts and job history]
B --> C[Resolve or reuse snapshot]
C --> D[Validate source and workflow context]
D --> E[Immutable source artifact]
E --> F[Package builds]
E --> G[Signing authorization]
Technical reviewBest possible solution: Use run-state evidence to permit first capture while preserving immutable replay whenever an earlier attempt could have uploaded a snapshot. Do we have a high-confidence way to reproduce the issue? Yes: GitHub confirms the zero-job first attempt and failed approved retry, and current main retains the unconditional later-attempt restoration path. Is this the best way to solve the issue? The focused selector fixes the incorrect attempt-number assumption without duplicating source resolution or weakening immutable replay. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f6dcf00eaf45. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 4:52 PM ET / 20:52 UTC. |
Related: #219
What Problem This Solves
Fixes: the Gateway MSIX GitHub Actions workflow fails with
Artifact not found for name: openclaw-source-resolutionon every fork pull request run that a maintainer approves, so those PRs can never get a green build. #219 is the motivating case: run 41113043368, job "Capture source and validate build route" (124260386771); run 40580386645 failed the same way earlier.User Impact
User impact: approved fork pull requests build and test normally. Reruns of a run that already captured its OpenClaw source still replay that exact snapshot, and still fail closed when it is gone.
Why This Change Was Made
The workflow treated "attempt 1" as "the attempt that captured source". A fork run that waits for approval ends attempt 1 as
action_requiredwithout running any job, so approval creates attempt 2, which tried to replay a snapshot nobody captured. Reruns and close/reopen could not recover it.Source capture now decides from run state instead of the attempt number (
scripts/Get-WorkflowSourceSnapshotMode.ps1):openclaw-source-resolutionartifact (including an expired one), or when any earlier attempt's capture job succeeded, ran its upload step, or left that step in an unknown state; a missing artifact then fails at the existing restore diagnostic;The capture job gains
actions: readto read its own run's jobs and artifacts. It refuses to decide if the current attempt does not list the job under the name the workflow passes, so a job rename cannot silently turn replay into re-resolution. Downstream build and signing jobs already download the run's artifact unconditionally and are unchanged.Get-WorkflowSource.ps1takes only-ReuseSnapshotand does not read the attempt number. The remaining attempt-keyed uses are deliberately per attempt: the cache-proof keys write and read within one attempt, andGet-WorkflowPackageVersion.ps1 -RunAttemptgives each attempt a distinct package version.Evidence
Head:
465e0d3d64fd0aea98903c9397a27644ec229678.Hosted proof ran on
b7a464e9from this upstream branch viaworkflow_dispatch(unsigned).465e0d3dchanges only README text, so the workflow and script under test are the same. Each row quotes the capture job's log.SNAPSHOT_MODE: resolve,Artifact openclaw-source-resolution has been successfully uploaded! ... Artifact ID is 13005376667. Build OpenClaw npm package downloaded that ID, and the whole attempt concludedsuccessSNAPSHOT_MODE: reuse,openclaw-source-resolution (ID: 13007702869, ... sha256:f6096d2b...),Artifact download completed successfully.There was no new uploadsha256:f6096d2b...)GET /actions/artifacts/13005376667returned 404Artifact not found for name: openclaw-source-resolution, thenThe immutable source snapshot artifact 'openclaw-source-resolution' could not be restored for run 41114478067 (attempt 3).... It did not re-resolveThe last row reproduces #125: re-running all jobs drops the earlier attempt's artifacts. This PR keeps that path fail-closed and documents the partial-rerun alternative. It does not change #125.
PR CI on
465e0d3d: 41124625576 passed. In attempt 1, onlyTest MSIX upgrade (Store update · bundle)failed, because WinGet could not install the Store product on the runner (msstoreagreements, exit -2147418110). Re-run failed jobs (attempt 2) passed without re-running capture.No fork run that needed approval was available. A maintainer's fork does not require approval. Instead, the a1-cancelled row reproduces the same input state: an earlier attempt whose capture job never ran a step, with no artifact. The unit suite replays the exact #219 shape: attempt 1 has zero jobs.
Local, on
b7a464e9(re-run for docs on465e0d3d):.\scripts\Test-WorkflowSourceSnapshotMode.Tests.ps1passed (20 checks): approval-gated, cancelled, skipped, and failed-before-upload attempts resolve; listed or expired artifacts, successful captures, and run, failed, cancelled, unfinished, or unrecognized upload steps reuse; a drifted job name and API failures throw..\scripts\Test-OpenClawSource.Tests.ps1passed (75 tests)..\scripts\Test-WorkflowSigningConfiguration.ps1,.\scripts\Test-SigningInputs.Tests.ps1,.\scripts\Test-PackagingRelevance.Tests.ps1, and.\scripts\Test-WorkflowJobResults.Tests.ps1passed..\scripts\Test-DocReferences.ps1reported 0 findings..\scripts\Test-DocReferences.Tests.ps1passed.git diff --checkwas clean.Not run: the .NET quality, xUnit, NativeAOT, MSIX packaging, and upgrade lanes, because no source, package, or signing input changed. The signing-mode
validatejob was not exercised. It already downloads the run's artifact unconditionally and is unchanged.