fix(phase4): set the default keychain for the macOS runner job - #78
Conversation
notarytool resolves its credential profile through the session DEFAULT keychain, but a launchd runner job has no default keychain set, so notarization failed with "No Keychain password item found for profile" even though code signing (which uses the search list) succeeded. After the hook's trust validation passes, set the dedicated account's login keychain as the default and search keychain and unlock it, on macOS only. The keychain password is read from a machine-local file owned by the runner account ($HOME/.config/1helm/mac-keychain-password); it is never committed to this repository or exported into the job environment. No sudo, no elevation. Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe runner startup script now prepares the macOS login keychain for trusted jobs. It configures the keychain and unlocks it with the machine-local password when the required files are available. ChangesRunner keychain preparation
Estimated code review effort: 3 (Moderate) | ~15 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…cceptance The retained channel-image verification checked /var/lib/1helm-oci-v1/shared-images/sha256/<digest> without sudo, but install-oci-runtime.sh creates that store root-owned and mode 0700. The ordinary runner user cannot traverse it, so the `[[ -d ... && sha256 ... ]]` assertion always failed after an otherwise successful clean install — the exact silent failure the new ERR trap pinpointed at this line. The adjacent state checks already use sudo; this one was the outlier. Run the directory test and the image digest read under sudo, matching the store's ownership. No product change; acceptance-script only. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ops/platform-acceptance/runner-job-started.sh`:
- Around line 46-49: Remove the `|| true` suppression from the keychain setup
commands in the runner startup hook, especially `security default-keychain` and
`security unlock-keychain`, so failures stop the hook when the required files
exist. Preserve the existing command order and redirection while allowing setup
errors to propagate before invoking `notarytool`.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1341879d-21c0-46cd-a6d6-651bccef8a9f
📒 Files selected for processing (1)
ops/platform-acceptance/runner-job-started.sh
| security list-keychains -d user -s "$kc" /Library/Keychains/System.keychain >/dev/null 2>&1 || true | ||
| security default-keychain -d user -s "$kc" >/dev/null 2>&1 || true | ||
| security set-keychain-settings "$kc" >/dev/null 2>&1 || true | ||
| security unlock-keychain -p "$(cat "$kc_pw_file")" "$kc" >/dev/null 2>&1 || true |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Do not ignore keychain setup failures.
Each security command can fail, but || true makes the hook report success. If default-keychain or unlock-keychain fails, notarytool later fails without identifying the runner configuration error. When both required files exist, let these commands fail the hook or verify their resulting state before continuing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ops/platform-acceptance/runner-job-started.sh` around lines 46 - 49, Remove
the `|| true` suppression from the keychain setup commands in the runner startup
hook, especially `security default-keychain` and `security unlock-keychain`, so
failures stop the hook when the required files exist. Preserve the existing
command order and redirection while allowing setup errors to propagate before
invoking `notarytool`.
notarytool reads its credential profile from the session default keychain, but a launchd runner job has no default keychain set — so notarization failed with 'No Keychain password item found' while code signing (search list) succeeded. The job-started hook, after its trust validation, now sets the dedicated account's login keychain as default+search and unlocks it (macOS only). Password read from a machine-local runner-owned file, never in the repo or job env. No sudo. phase4 tests pass. Hook already deployed to the Mac runner.
Summary by CodeRabbit