fix: verify and retry stapling so --notarize can't falsely report success - #100
Closed
yepzdk-bot wants to merge 1 commit into
Closed
fix: verify and retry stapling so --notarize can't falsely report success#100yepzdk-bot wants to merge 1 commit into
yepzdk-bot wants to merge 1 commit into
Conversation
…cess Stapling previously ran once with output suppressed and no verification, so `stapler staple` exiting 0 without attaching a ticket left apps "notarized" but unstapled while the CLI reported success. Now stapling retries with a backoff (the ticket can lag behind acceptance), confirms the ticket is attached with `xcrun stapler validate` before reporting success, and on exhaustion throws with the stapler's own output plus the manual `xcrun stapler staple` recovery command, stating the app is notarized but not stapled. Spec: WEBWRAP-004 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update/createwith--notarizecould report success even when the notary ticket wasn't actually stapled: stapling ran once with its output suppressed (quiet: true) and no verification, sostapler stapleexiting 0 without attaching a ticket left apps "notarized" but unstapled while the CLI happily reported success.This reworks
AppBuilder.notarizeAndStapleto prevent that silent failure:stapleAttemptstimes, waiting a growingstapleBackoffbetween tries.stapler stapleexits 0, the CLI runsxcrun stapler validateand only reports success if the ticket is genuinely attached.runCapturingAll(notquiet: true), so the stapler's own output is shown rather than suppressed.xcrun stapler staple "<app>"recovery command.Acceptance criteria
xcrun stapler validateto confirm the ticket before reporting success.Testing
Pure logic (
stapleBackoff,notStapledMessage,stapleAttempts) is unit-tested inStaplingTests.swift, following the repo's pure-vs-side-effect split. Thesleep/process orchestration is verified by hand (macOS-only; no Swift toolchain on the CI-less Linux dev host used here).Closes #WEBWRAP-004
🤖 Generated with Claude Code