th-9c3f4e: retry the notarization wait, not the submission - #607
Merged
Merged
Conversation
The first 0.2.3 publish failed after a successful upload: notarytool's status poll hit NSURLErrorDomain -1001 while the submission was still In Progress, and `submit --wait` surfaced that as a step failure. Twenty minutes of signed build discarded over a transient GET, with a valid submission id sitting right there in the log. Splitting submit from wait makes the retry target the right thing. Retrying the submission would re-upload a 120MB artifact and start a second queue entry; retrying the wait just asks Apple again about work it is already doing. Also check `notarytool info` for Accepted afterwards — `wait` exiting 0 means Apple finished, not that it approved, and the old code would have stapled straight through a rejection. Relevant because th-9c3f4e doubled the number of notarization round-trips per release (the app now gets its own ticket, not just the DMG), so this flake had twice the surface to land on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 59cdb82 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brentrager
enabled auto-merge (squash)
September 17, 2026 19:14
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.
What happened
The first SmoothFlow 0.2.3 publish (run 35261785786) failed ~16 minutes in, after a successful upload:
Apple accepted the upload and was processing it. A status GET timed out, and because the script used
notarytool submit --wait— which collapses "upload" and "poll until finished" into a single call — that transient failure took down the whole step. Twenty minutes of signed build discarded, with a perfectly valid submission id sitting in the log.Not a logic error in th-9c3f4e, but that change made it twice as likely to bite: stapling the app and the DMG means two notarization round-trips per release instead of one.
The fix
Split submit from wait, so the retry targets the right thing:
waitagainst that id (5 attempts, 30s apart,--timeout 30m). Retrying the submission would re-upload a ~120 MB artifact and open a second queue entry at Apple; retrying the wait just asks again about work already in flight.notarytool infoforAccepted.waitexiting 0 means Apple finished, not that it approved — the old code would have stapled straight through a rejection, andstaplerfailing afterwards is a much worse error message than the notary log. On rejection it now dumpsnotarytool log.Verification
The output parsing is the fragile part, so I checked both
awkextractions against real notarytool output shapes, including the case that matters most:submitoutput (twoid:lines — "Submission ID received" then "Successfully uploaded")d0dc4559-…infowithstatus: AcceptedAcceptedinfowithstatus: InvalidInvalid→ fails the step, dumps the logThe duplicate
id:line insubmitoutput is why the extraction takes the first match and exits rather than the last.🤖 Generated with Claude Code