Skip to content

fix(phase4): set the default keychain for the macOS runner job - #78

Merged
gitcommit90 merged 2 commits into
mainfrom
fix/macos-runner-default-keychain
Aug 5, 2026
Merged

fix(phase4): set the default keychain for the macOS runner job#78
gitcommit90 merged 2 commits into
mainfrom
fix/macos-runner-default-keychain

Conversation

@gitcommit90

@gitcommit90 gitcommit90 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

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

  • Bug Fixes
    • Improved macOS runner setup by configuring and unlocking the login keychain when the required credentials are available.
    • Helps validated jobs access keychain-protected resources reliably.

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>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@gitcommit90, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 87305d33-fca2-4736-b332-25eb8db72a1e

📥 Commits

Reviewing files that changed from the base of the PR and between 369eccd and 553e9ac.

📒 Files selected for processing (1)
  • ops/platform-acceptance/linux.sh
📝 Walkthrough

Walkthrough

The 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.

Changes

Runner keychain preparation

Layer / File(s) Summary
Configure and unlock the login keychain
ops/platform-acceptance/runner-job-started.sh
The script configures the macOS login keychain as the search and default keychain, adjusts its settings, and unlocks it with the local password file. Each operation can fail without stopping the script.

Estimated code review effort: 3 (Moderate) | ~15 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem and solution but omits most required template sections, including change type, release notes, acceptance ledger, and verification checklist. Complete the template sections and record the change type, release-note status, acceptance evidence, verification results, and post-merge items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: setting the default keychain for the macOS runner job.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/macos-runner-default-keychain

Comment @coderabbitai help to get the list of available commands.

…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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b6c17eb and 369eccd.

📒 Files selected for processing (1)
  • ops/platform-acceptance/runner-job-started.sh

Comment on lines +46 to +49
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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`.

@gitcommit90
gitcommit90 merged commit 3f359b3 into main Aug 5, 2026
6 checks passed
@gitcommit90
gitcommit90 deleted the fix/macos-runner-default-keychain branch August 5, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant