Repository navigation
ci(release): sign and notarize the macOS installer sooner - #6329
Conversation
The release signed and notarized the x64 and arm64 Dashmate installers one after the other: `notarytool submit --wait` for the first package, staple, then the second. Apple processes submissions in parallel, so this cost the whole second notarization on the release's critical path (8.5 + 9.5 min in v5.1.0-dev.4). The action now uploads every package with `notarytool submit` (no --wait), then waits for each submission with `notarytool wait`, and staples once all of them are accepted. The verdict is read from the `status:` line of the report instead of a substring match, and every package's verdict is printed before the step fails. The rehearsal workflow shares the action and gets the same behaviour. Tests: the notarytool stub now gives each package its own submission id and verdict, answers `wait`, and refuses a `wait` once the API key file is gone. New tests cover upload-before-wait ordering, mixed verdicts, a failing wait and a missing package. Test would have caught this in CI: test_should_upload_every_package_before_ waiting_for_any fails against the previous action (call order was submit, staple, submit, staple) ✖ and passes after ✔. 7 of the 18 rehearsal/action tests were red before the change, all 18 pass after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Dashmate installers were built and released by two 4-leg matrix jobs. A job that needs a matrix job waits for all of its legs, so the macOS release leg, which signs and notarizes and is the longest, started only after the slowest Linux build leg. Across the last releases that wait was 0-34 min (5.6 in v5.1.0-dev.4, 24.9 in v5.1.0-dev.3, 33.8 in v5.0.3), mostly Linux legs queued for a GitHub-hosted runner. macOS now has its own build-dashmate-macos and release-dashmate-macos jobs: copies of the Linux jobs with a one-entry matrix, and the macOS release needs only the macOS build. The same `name:` and matrix keys give the jobs the display names GitHub gave the macOS legs before (`Build/Release Dashmate packages (macos, macos-15)`), which the checksums job, scripts/release/sign_dashmate_checksums.sh and the release skill look for, so none of them changes. release-dashmate-checksums now needs and requires all four jobs. The installers are still built only after release-npm: besides publishing, it checks the Tenderdash seed snapshot the installers ship, the tag and the npm tarballs the installers are built from. Tests (.github/scripts/tests/test_dashmate_release_checksums.py): - each macOS job is its Linux job but for the job id, the build it needs and the matrix entry (whole job text, so a step, permission or condition edited or dropped in one copy fails); - the macOS release needs only the macOS build, the Linux one only the Linux build, and every package type has exactly one release leg, package type first in the matrix entry (that order makes the display name); - the checksums job needs and requires exactly the four jobs; - both build jobs still need release-npm; - every Dashmate job declares permissions without id-token (the workflow default grants it for npm trusted publishing). The new tests error or fail against the previous release.yml, and each of these edits makes at least one fail: a changed or dropped step in one copy, dropped permissions, the macOS release needing the Linux build, `os` before `package_type`, the builds needing build-npm, the checksums job missing a job. actionlint (with shellcheck) passes; the full .github/scripts/tests suite passes (146, 2 skipped locally for lack of gpg). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Follow-ups from reviewing the two previous commits: - Fetch `notarytool log` also when `notarytool wait` itself fails, since notarytool may exit non-zero for a package Apple rejected; the rejection reason was lost on that path. - The notarytool stub now prints an earlier status line and can time out with exit 0 and no verdict, or fail `notarytool log`. New tests: the verdict comes from the report's last status line (a substring match or a first-match parser fails it), a wait that times out is a failure, and a log that cannot be fetched does not hide the other packages' verdicts. - Assert the build jobs' `name:`, which sign_dashmate_checksums.sh selects build legs by; renaming them failed no test before. - Compare matrix legs, checksums needs and its condition independent of order, and accept either form of `needs:` in the copy comparison, so harmless reordering does not fail the tests. - Reword the comment shared by both release jobs so it is true for the one-entry macOS matrix as well. Each new or tightened test fails for the edit it targets (dropping the new log call, a first-match or substring status check, `notarytool log` without `|| true`, renamed build jobs) and passes on this commit. actionlint passes; .github/scripts/tests: 149 pass, 2 skipped locally for lack of gpg. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
✅ Final review complete — no blockers (commit c22c16f) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The release workflow starts macOS signing as soon as the macOS build finishes and submits both installers to Apple before waiting for either verdict. SHA256SUMS still requires all four installer build and release jobs to succeed. The 204-test runner-contract suite and NPM release build validation passed; PR Hygiene is pending, and CI did not exercise live Apple notarization.
🟡 5 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: A failed macOS rebuild can replace installers without refreshing SHA256SUMS
Impact: Users verifying an unsigned release can see checksum mismatches if a maintainer reruns the macOS build and it fails before uploading new installers.
.github/workflows/release.yml:687-691
The release can serve freshly signed installers alongside checksums from the previous attempt. The standalone macOS release job still runs when its build fails because it only excludes skipped; the SHA-based download name can then resolve to an earlier attempt's retained artifact. Developer ID signing adds a fresh timestamp, and the release upload replaces same-name assets if no detached signature is attached, but the checksum job skips because the build failed. The old matrix condition let successful siblings publish, but the standalone macOS job has no siblings. Require a successful macOS build and download by the artifact ID returned by that build, failing if the ID is missing. That also binds signing to the intended producer: a run-wide name and a post-signing hash cannot do that.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
🟡 Suggestion: Installer publication safeguards now have to be updated in two jobs
Impact: Release maintainers must edit both job definitions when they change a shared safeguard, and the whole-job parity test also rejects intentional platform-specific differences.
.github/workflows/release.yml:707-726
The separate dependency chains are needed, but they now duplicate the signed-release guard, package admission checks, and checksum recording. The parity test catches drift today, so this is not a current policy bypass. Share the release step list with a YAML anchor and alias, and keep tests for the distinct dependencies, matrix entries, and step ordering. That leaves Linux publishing checkout-free and gives both jobs one definition of the common safeguards.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The diff changes release job dependencies and notarization failure handling, which warrant ordinary review but do not change a critical surface beyond release CI orchestration. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `.github/workflows/release.yml`:
- [SUGGESTION] .github/workflows/release.yml:687-691: A failed macOS rebuild can replace installers without refreshing SHA256SUMS
Impact: Users verifying an unsigned release can see checksum mismatches if a maintainer reruns the macOS build and it fails before uploading new installers.
The release can serve freshly signed installers alongside checksums from the previous attempt. The standalone macOS release job still runs when its build fails because it only excludes `skipped`; the SHA-based download name can then resolve to an earlier attempt's retained artifact. Developer ID signing adds a fresh timestamp, and the release upload replaces same-name assets if no detached signature is attached, but the checksum job skips because the build failed. The old matrix condition let successful siblings publish, but the standalone macOS job has no siblings. Require a successful macOS build and download by the artifact ID returned by that build, failing if the ID is missing. That also binds signing to the intended producer: a run-wide name and a post-signing hash cannot do that.
- [SUGGESTION] .github/workflows/release.yml:707-726: Installer publication safeguards now have to be updated in two jobs
Impact: Release maintainers must edit both job definitions when they change a shared safeguard, and the whole-job parity test also rejects intentional platform-specific differences.
The separate dependency chains are needed, but they now duplicate the signed-release guard, package admission checks, and checksum recording. The parity test catches drift today, so this is not a current policy bypass. Share the release step list with a YAML anchor and alias, and keep tests for the distinct dependencies, matrix entries, and step ordering. That leaves Linux publishing checkout-free and gives both jobs one definition of the common safeguards.
In `.github/actions/macos-sign-notarize/action.yaml`:
- [SUGGESTION] .github/actions/macos-sign-notarize/action.yaml:128-135: Notarization can take two hours to fail when both submissions stay pending
Impact: Release maintainers can wait an extra hour before retrying when Apple leaves both installers pending.
Once the first wait times out, the run cannot publish either installer, but it still gives the second submission a fresh one-hour wait. Uploading both packages first overlaps Apple's processing, not the two client-side timeout windows. The old flow stopped at the first timeout. Wait for both submissions concurrently with separate logs, or give the waits a shared deadline, while keeping the requirement that every package be accepted before stapling.
- [SUGGESTION] .github/actions/macos-sign-notarize/action.yaml:115-123: A later upload failure leaves earlier notarization verdicts unreported
Impact: When the second installer fails to upload, release operators must look up the first submission separately to learn whether Apple accepted it.
The workflow reports the upload error but never collects a verdict for any submission it already created. A failed `submit` or a missing ID exits the step before the wait loop; in the old serial flow, the first verdict had already been reported by then. Report the package and ID of each outstanding submission before exiting, or collect its verdict within a shared deadline. Keep all stapling disabled on any failure, and add a test where one upload succeeds before the next fails.
- [SUGGESTION] .github/actions/macos-sign-notarize/action.yaml:106-117: Unexpected installers are submitted to Apple before any verdict is checked
Impact: If a bad build artifact contains extra signable installers, the release job can spend the team's notarization allowance on them and delay other releases.
An invalid batch can now consume multiple notarization requests before the workflow sees its first rejection. The action requires at least one `.pkg` and submits every package it finds; the previous serial flow stopped at the first rejected verdict. Apple advises limiting notarizations to 75 per day. Validate that the upload set contains exactly the expected x64 and arm64 installers before calling `notarytool`, and test that an extra package results in no submissions.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- The rehearsal's protected-branch check is not a credential boundary — The rehearsal checks its ref inside the workflow and does not use a GitHub environment. This catches accidental dispatches of the checked-in workflow but does not independently restrict credential access if a branch changes the workflow itself. This PR does not change that setup.
- Follow-up: Move the Apple credentials into a protected GitHub environment that admits only approved release tags and rehearsal branches.
| for i in "${!packages[@]}"; do | ||
| pkg="${packages[$i]}" | ||
| log="$RUNNER_TEMP/notarytool_wait_$i.log" | ||
| if ! xcrun notarytool wait "${ids[$i]}" "${notary_auth[@]}" --timeout 1h 2>&1 | tee "$log"; then | ||
| xcrun notarytool log "${ids[$i]}" "${notary_auth[@]}" || true | ||
| echo "::error::notarytool failed for $pkg." | ||
| failed=true | ||
| continue |
There was a problem hiding this comment.
🟡 Suggestion: Notarization can take two hours to fail when both submissions stay pending
Impact: Release maintainers can wait an extra hour before retrying when Apple leaves both installers pending.
Once the first wait times out, the run cannot publish either installer, but it still gives the second submission a fresh one-hour wait. Uploading both packages first overlaps Apple's processing, not the two client-side timeout windows. The old flow stopped at the first timeout. Wait for both submissions concurrently with separate logs, or give the waits a shared deadline, while keeping the requirement that every package be accepted before stapling.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
| for i in "${!packages[@]}"; do | ||
| log="$RUNNER_TEMP/notarytool_submit_$i.log" | ||
| if ! xcrun notarytool submit "${packages[$i]}" "${notary_auth[@]}" 2>&1 | tee "$log"; then | ||
| echo "::error::notarytool failed for ${packages[$i]}." | ||
| exit 1 | ||
| fi | ||
| # notarytool exits 0 when Apple rejects the submission. | ||
| if ! grep -q 'status: Accepted' "$submit_log"; then | ||
| submission_id="$(awk '$1 == "id:" { print $2; exit }' "$submit_log")" | ||
| [ -z "$submission_id" ] || xcrun notarytool log "$submission_id" "${notary_auth[@]}" < /dev/null || true | ||
| id="$(awk '$1 == "id:" { print $2; exit }' "$log")" | ||
| [ -n "$id" ] || { echo "::error::notarytool reported no submission id for ${packages[$i]}."; exit 1; } | ||
| ids+=("$id") |
There was a problem hiding this comment.
🟡 Suggestion: A later upload failure leaves earlier notarization verdicts unreported
Impact: When the second installer fails to upload, release operators must look up the first submission separately to learn whether Apple accepted it.
The workflow reports the upload error but never collects a verdict for any submission it already created. A failed submit or a missing ID exits the step before the wait loop; in the old serial flow, the first verdict had already been reported by then. Report the package and ID of each outstanding submission before exiting, or collect its verdict within a shared deadline. Keep all stapling disabled on any failure, and add a test where one upload succeeds before the next fails.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
| packages=() | ||
| while IFS= read -r -d '' pkg; do | ||
| # stdin is the package list, so keep it away from the tools. | ||
| if ! xcrun notarytool submit "$pkg" "${notary_auth[@]}" --wait --timeout 1h < /dev/null 2>&1 | tee "$submit_log"; then | ||
| echo "::error::notarytool failed for $pkg." | ||
| packages+=("$pkg") | ||
| done < <(find "$PACKAGES_PATH" -type f -name '*.pkg' -print0) | ||
| [ "${#packages[@]}" -gt 0 ] || { echo "::error::No .pkg files found under $PACKAGES_PATH."; exit 1; } | ||
| # Upload every package before waiting for any. Apple notarizes the | ||
| # submissions in parallel, so the waits below take about as long as | ||
| # the slowest package rather than the sum of all of them. | ||
| ids=() | ||
| for i in "${!packages[@]}"; do | ||
| log="$RUNNER_TEMP/notarytool_submit_$i.log" | ||
| if ! xcrun notarytool submit "${packages[$i]}" "${notary_auth[@]}" 2>&1 | tee "$log"; then |
There was a problem hiding this comment.
🟡 Suggestion: Unexpected installers are submitted to Apple before any verdict is checked
Impact: If a bad build artifact contains extra signable installers, the release job can spend the team's notarization allowance on them and delay other releases.
An invalid batch can now consume multiple notarization requests before the workflow sees its first rejection. The action requires at least one .pkg and submits every package it finds; the previous serial flow stopped at the first rejected verdict. Apple advises limiting notarizations to 75 per day. Validate that the upload set contains exactly the expected x64 and arm64 installers before calling notarytool, and test that an extra package results in no submissions.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
|
Bots are done — your move: post |
Brings the 5.1.0 release and everything v5.1-dev gained after #6301: #6345 (5.1.0), #6344, #6338, #6329, #6332, #6331 and #6334 (5.1.0-rc.2). Conflicts, resolved with merge drivers off: - Cargo.toml: GroveDB takes v5.1-dev's tag v7.0.0, which is the commit (5a39eaaf) v5.2-dev already pinned by rev. rust-dashcore keeps v5.2-dev's dev revision f0ddfd45 (0.47.0) instead of tag v0.46.1. The workspace version is 5.1.0. - Cargo.lock: v5.2-dev's lock re-resolved by cargo metadata against the merged manifest. It changes only the 16 GroveDB source lines (rev to tag, same commit) and the 52 workspace crate versions. - CHANGELOG.md: v5.2-dev's [Unreleased] section stays on top, followed by v5.1-dev's 5.1.0 and 5.1.0-rc.2 sections. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
The Dashmate installers are the last release artifacts node operators need, and the macOS one comes out last. Two waits on its path could be avoided:
.pkgfiles (x64, arm64) went throughnotarytool submit --waitand stapling one after the other, although Apple processes submissions in parallel. That took 8.5 + 9.5 min in v5.1.0-dev.4 and 18 min in v5.1.0-rc.1.release-dashmate-packageswas one 4-leg matrix thatneedsthe 4-leg build matrix, and a job that needs a matrix job waits for all of its legs. Over the last releases that wait was 0–34 min (5.6 min in v5.1.0-dev.4, 24.9 in dev.3, 33.8 in v5.0.3), mostly Linux legs queued for a GitHub-hosted runner.Estimate from the job timings of the last 10 release runs (same queues as observed, minus these two waits): the installers would have been published 9–43 min earlier, about 16 min at the median. For example 66 → 51 min in dev.4, 82 → 48 in dev.3, 196 → 153 in v5.0.3.
What was done?
Concurrent notarization (
.github/actions/macos-sign-notarize, also used by the rehearsal workflow):notarytool submitwithout--wait, then each submission is waited for withnotarytool wait <id> --timeout 1h. Packages are stapled only once all of them are accepted.status:line, not from a substring match.notarytool logis fetched for each failure.macOS installer gets its own build → release chain (
release.yml):build-dashmate-macosandrelease-dashmate-macos. Each is a copy of its Linux job with a one-entry matrix, and the macOS release needs only the macOS build.name:and the same matrix key order, so the jobs get the same display names as before:Build/Release Dashmate packages (macos, macos-15). The checksums job,scripts/release/sign_dashmate_checksums.shand the release skill find legs by those names, and none of them changes.release-dashmate-checksumsnow needs all four jobs and requires each of them to succeed.Deliberately not changed: the Dashmate builds still wait for
release-npm.build-npm, it would run whilerelease-npmis still downloadingjs-build. That widens the window in which a job of the run can replace the artifactrelease-npmthen publishes; the Kotlin and Swift builds already overlap it.build-npm.release-npm's own checks matter less. Its Tenderdash seed check only re-validates, offline, the snapshotyarn releasejust generated. It fails only in edge cases: a release published or re-run more than 30 days later, theREUSE_TENDERDASH_SEEDSpath, or a hand-bumped version. If the installers should keep that guard, and the tarball identity check, the follow-up can run both in the build jobs.How Has This Been Tested?
.github/scripts/tests(run bytests.yml): 149 pass. 2 are skipped locally because they needgpg; they are unrelated.Notarization (
test_dashmate_macos_rehearsal.py):wait, and refuses awaitonce the API key file is gone.--waiton submit; mixed verdicts in both orders, with nothing stapled; a timeout that exits 0 without a verdict; the last status line decides; anotarytool logfailure does not hide the other verdicts; a failing wait; no package.Job split (
test_dashmate_release_checksums.py):Copies: each macOS job is its Linux job except for the job id, the build it needs and the matrix entry. The whole job text is compared, so a step, permission or condition changed or dropped in one copy fails.
Needs and legs: the macOS release needs only the macOS build. Every package type has exactly one release leg, with the package type first, which is the order that makes the display name. Both build and release
name:values are asserted.Checksums job: needs and requires exactly the four jobs.
Builds: both still need
release-npm.Permissions: every Dashmate job declares its own permissions without
id-token. The workflow default grants it for npm trusted publishing.Red → green: against the previous
release.yml, the new tests error or fail. Each of these edits also makes at least one fail:oswritten beforepackage_typebuild-npmHarmless reordering of the matrix or
needsdoes not.Lint:
actionlint1.7.12 with shellcheck passes onrelease.ymland the rehearsal workflow, and the notarization script is shellcheck-clean.Not testable before a release:
release.ymlruns only on a published release. GitHub naming a one-entry matrix job… (macos, macos-15)is checked against its parser, not by a run. Two checks are needed:release-dashmate-macos-rehearsal.ymlfromv5.1-devwith run45528761349(v5.1.0-rc.1; its packages are kept until about 2 Dec). It notarizes with the real certificate and notary key and publishes nothing.v5.1-dev: check that the macOS release starts when the macOS build ends, that both notarizations overlap, and that the checksums job and the signing script find all legs. If GitHub named the jobs differently, the checksums job fails closed ("found: none") and nothing is signed.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
c22c16f/self-reviewedgithub(.github/actions/macos-sign-notarize/action.yaml,.github/scripts/tests/test_dashmate_macos_rehearsal.py,.github/scripts/tests/test_dashmate_release_checksums.pyand 2 more) — ktechmidasWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.