Repository navigation
fix(release): retry notarization submit/wait on transport failures and name the resume command - #157116
Conversation
|
🦞👀 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: blocked before merge. Reviewed September 24, 2026, 9:37 AM ET / 13:37 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds submit and wait recovery to macOS notarization, prints a release-workflow resume command, updates release guidance and tests, and drains codesign output during the smoke-signature check. Merge readiness⛔ Blocked before merge - 2 items remain Current main still exits after a transient notarization wait failure, and the merged packaging checkpoint work does not add retries. The patch has focused boundary tests, but the requested signed Apple-service verification remains outstanding. Priority: P2 Review scores
Verification
How this fits togetherMac release packaging signs the app and DMG, then sends each artifact to Apple's notary service. The notarization helper records submission IDs in a checkpoint and returns accepted artifacts to the release workflow. flowchart LR
A[Signed app and DMG] --> B[Mac packaging]
B --> C[Notarization helper]
C --> D{Apple response}
D -->|Transient failure| E[Retry or recover submission]
E --> D
D -->|Accepted| F[Checkpoint and release artifacts]
D -->|Rejected| G[Notary log and failure]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +179, Docs +1, Other +75. Total +255 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep recovery in the notarization helper and verify a signed preflight in which one Apple submission ID survives a transient failure through acceptance or checkpointed resume. Do we have a high-confidence way to reproduce the issue? Yes. Current main's one-shot wait path exits on the reported transport failure, and the PR identifies a specific failed release run; this read-only review did not rerun notarization. Is this the best way to solve the issue? Yes, provisionally. The existing notarization helper is the narrow owner for retries and checkpoint reuse, but its Apple-service response assumptions still need signed validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1a3853e933a9. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
cb61418 to
e775ab0
Compare
* commit '9ccfc7d1bea21e34da48edbd54afd2e1be57db40': (89 commits) fix(exec): avoid gateway stalls during background task writes (#157177) test(cli): isolate preaction title setter state fix(test): synchronize Git backoff cancellation readiness (#157315) fix: validate Codex model references in Docker (#157175) fix(state): tolerate brief WAL coordinator contention (#157121) fix: unblock conversations after recovery preparation fails (#157214) test(telegram): avoid wall-clock pacing in HTTP conformance (#157281) fix: keep independent database work responsive under load (#157230) refactor(sqlite): centralize WAL checkpoint execution (#157263) improve(android): show tool outcomes in collapsed work (#156950) fix: remove tracked release scratch blocking source capture (#157308) test(update): remove legacy probe stream ordering race fix: preserve steering across reconnects and show queued input (#157135) fix(ui): keep typing focus when the GitHub reader opens (#157202) fix(ios): keep screenshot logs outside capture evidence test(codex): await startup teardown in lifecycle fixtures chore(ui): refresh control ui locales (#157311) refactor(memory): deslop memory plugins (#156867) refactor(test): share CLI diagnostics fixture setup (#157201) fix(release): retry notarization submit/wait on transport failures and name the resume command (#157116) ...
…d name the resume command (openclaw#157116) * fix(release): retry notarization transport failures * fix(release): reconcile history from notarization upload start * fix(release): retry unavailable notarization history before resubmitting * fix(release): retain unknown state for malformed notarization history * fix(release): drain codesign output in smoke signature check
What Problem This Solves
Fixes macOS release preflights failing when Apple's notarization transport briefly drops after a successful submission. In release-ops run 35959639128, arm64 job 107505754436,
submit --no-waithad already checkpointed the submission ID beforenotarytool waitfailed withNSURLErrorDomain -1009 "The Internet connection appears to be offline". The script treated the missing verdict as fatal even though the network recovered eight seconds later.Refs #156861
User Impact
Checkpointed macOS packaging now survives transient submit/wait failures automatically. If the wait budget expires, operators get the existing Apple submission ID, checkpoint path, and a copyable
openclaw-macos-publish.ymlresume dispatch with the run, attempt, architecture variant, tag, and exact source SHA. Apple rejection still fails immediately and prints the notary log. Known IDs remain authoritative after submit errors, preserving the existing checkpoint contract; this does not add a protocol to resume an incomplete archive upload.No new configuration, environment, CLI, dependency, or checkpoint-schema surface is added. The separate release workflow change is outside this PR.
Why This Change Was Made
The notarization script owns recovery; callers continue consuming its checkpoint and terminal result. The initial production delta was +77/−12 lines. The review fix for unavailable history adds nine lines, making the final production delta +86/−12 lines (net +74) in
scripts/notarize-mac-artifact.sh.app.zipcannot adopt each other's submissions. A failed history lookup, malformed entry, or invalid JSON response retries history within the existing budget without another upload. The existing checkpoint writer persists the recovered ID before waiting.Accepted,Invalid, orRejectedJSON is terminal; transport errors, timeouts, malformed JSON, missing status, andIn Progressremain retryable. The shared loop backs off from 5 seconds to a 60-second cap within a 30-minute budget, logging ID and elapsed time.Evidence
The fake-notarytool tests exercise the actual shell entry point in
test/scripts/notarize-mac-artifact.test.ts:retries non-terminal wait responses "transport" on the checkpointed idretries non-terminal wait responses "In Progress" on the checkpointed idexhausts the wait budget with an actionable resume command and resumes the same idadopts a recent matching history entry after losing the submit responseretries submit when history is empty(also old history and different names)retains Apple's terminal rejection without publishing accepted output or resubmittingAdditional cases cover malformed/missing status, a returned ID with unsuccessful submit exit, exhausted submit attempts, standalone rejection logs, checkpoint tampering, and stapling recovery. Tests replace
dateandsleepthrough the existing isolatedPATHfixture; there are no real backoff sleeps or production test-only options.tbx_01m393yvjmf9nq4q7pey1cxbsh:pnpm test test/scripts/notarize-mac-artifact.test.ts --maxWorkers=1passed 33/33 three times, with 2.806 / 2.830 / 2.689 seconds of test time and 3.58 / 3.29 / 3.14 seconds of Vitest wall time. The same unchanged DMG test took 59.396 seconds on a contended Mac and 155–190 ms on the first Testbox run.git diff --checkand Bash syntax validation passed.autoreview --mode branch --base origin/main --max-priority P2: scoped-clean, no accepted/actionable findings. Complete Testboxcheck:changed: passed, exit 0, including root typecheck, lint, ratchets, dead-export checks and all three mapped macOS CI test commands. The complete proof command finished in 9m26.567s on Testbox allocation 35968109541. It usedCI=1 OPENCLAW_TESTBOX=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 pnpm check:changed --base 0fa428d6f6de2261c89fee1c7ea97d7282f2e3f6 -- scripts/notarize-mac-artifact.sh test/scripts/notarize-mac-artifact.test.ts docs/reference/RELEASING.mdto bind checks to the branch merge base.This is deterministic shell/API-boundary proof with a fake Apple service; no live notarization or release was dispatched.
macOS CI follow-up
Rebased onto main
9e007615ece5, including the checkpoint split in #157117. The failures in CI run 36000111723, job 107635046524 (macos-node-2), were at the initial fixture setup (failed.status), before the auditor was changed or the resume path ran. The old fixture expected one transientnotarytool waitfailure to abort packaging; the retry change correctly recovered it. Main commit4ed527d970ba032f4e860257915080924bcabad0already changes that setup to a non-retryable stapling interruption. The two re-audit tests and all their refusal assertions remain unchanged from main; they verify rejection/missing auditor, nonzero exit, and no additional submissions.The first full macOS run exposed an additional smoke-signature flake:
codesign --display --verbose=4 | grep -Fxqlet grep close the pipe after its match, making codesign exit with SIGPIPE underpipefail. A real ad-hoc Mach-O probe reproduced codesign exit 141 with grep exit 0 in 23/40 runs. The packaging owner now drains output withgrep -Fx ... >/dev/null, preserving both exact signature matching and genuine producer failures. The same probe passed 40/40 afterward. This repair adds two production lines and removes one; no test assertions were changed.Validation on macOS:
pnpm test test/scripts/package-mac-dist.test.tspassed 27/27 three times, with Vitest wall times 53.31s / 40.15s / 41.13s (wrapper wall 55.27s / 41.24s / 42.20s). Bash syntax andgit diff --checkpassed. Both the focused pre-commit review and freshautoreview --mode branch --base origin/main --max-priority P2are scoped-clean. A supplemental Linux Testbox allocation was unavailable: Blacksmith returned HTTP 429 while fetching its workflow, before providing a lease receipt; no additional remote sibling-test result is claimed for this follow-up. Auto-merge remains off for coordinator verification of the new macOS job.