Repository navigation
Refuse a Dry Run With No 1Password Account and Skip Root-Refused Secrets Tests as Root - #4258
Conversation
…ets Tests as Root A dry run of the secrets sync with no op account configured no longer runs op account add, which changes local op configuration. It refuses and names that step. The secrets bootstrap and restore script tests that must reach the restore now skip when the runner is root, since both refuse root. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The bootstrap secrets cases that end before the root check run as root again. The dry-run refusal says a dry run adds no account, since it still signs in. The host-setup README says a dry-run stand-up ends at the restore when no account exists. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Without op, the restore script prints the sync command and the stand-up carries on, so the refusal only stops a host with op and no account. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The skip applies to cases that reach the root refusal after argument parsing, not to cases that end before the restore script. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
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 55 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. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified, and the changes address the documented dry-run behavior, root-runner test portability, and related documentation.
No open issues 🎉
What changed in this PR
This PR prevents dry runs from modifying local 1Password configuration when no account exists, makes root-sensitive secret-restore tests portable across runners, and documents the resulting behavior.
Changes:
- Refuse dry runs without a configured 1Password account and provide the
op account addremedy. - Skip tests that cannot reach their intended behavior when executed as root while retaining early-validation and root-refusal coverage.
- Update the relevant documentation.
| File | Description |
|---|---|
| tests/test_secrets_sync.py | Adds coverage for refusing account-less dry runs without enrolling an account. |
| tests/test_restore_secrets.py | Skips Linux sync-dependent restore tests when executed as root. |
| tests/test_bootstrap.py | Skips restore-dependent bootstrap cases on root runners while preserving early-refusal coverage. |
| scripts/secrets_sync.py | Refuses dry runs without a configured 1Password account before attempting enrollment. |
| scripts/README.md | Documents dry-run behavior when no 1Password account is configured. |
| host-setup/README.md | Documents account requirements for secret restoration and dry-run behavior. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4258 +/- ##
========================================
Coverage 78.20% 78.20%
========================================
Files 42 42
Lines 15415 15417 +2
========================================
+ Hits 12055 12057 +2
Misses 3360 3360
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
…trap Secret Restore (#4255) ## Summary Promotes `develop` to `main`. It carries nine changes: - [#4247](#4247): retires the `CLAUDE.md` pointer file, the second half of #4074. The hub's copy and its `spec/files.json` entry are gone, and a `retire` gap records why. The audit now reports a retired path the hub no longer tracks. A copy matching a past hub revision is reported for deletion, and any other copy is reported for the maintainer. It merged on the maintainer's go-ahead after reading its diff, which touches `host-setup/agent-safety/README.md`. - [#4256](#4256): that match compares line endings alone, so a retired copy differing in an action pin or a `needs:` list goes to the maintainer. It answers a Copilot finding on this promotion. - [#4260](#4260): the audit run stamp names the commits it read. HEAD carries `-dirty` where the read paths differ from it, and `main <sha>` is added where the fetched `main` differs. - [#4259](#4259): `pr-review-conduct` states the `pr_review.py` spelling rule once for every call a fleet skill prints. Under a restricted uv cache, a merge or a branch delete is reported to the maintainer as a blocked write. - [#4261](#4261): `validate-task.yml` takes a `test-matrix-file` input, read through the same validation as `test-matrix`. - [#4257](#4257): the pre-commit snippet says to exclude `hub_fetch_run.py` from a repository's own ruff with `force-exclude = true`. The short-form `AUDIT.md` snippet drops its two hub-audit authority sentences. - [#4246](#4246): `bootstrap.sh --secrets` and `bootstrap.ps1 -Secrets` restore named secret buckets, on their own or as a step of a `--host` or `--dev` stand-up. - [#4250](#4250): `host-*` buckets in `scripts/secrets_sync.py` may each hold the same home-relative title. - [#4258](#4258): a dry run with no 1Password account is refused rather than enrolling one, and the root-refused secrets tests skip on a root runner. It answers two CodeRabbit findings on this promotion. Hosts already carry the load-both setting the retirement relies on, from the 2.0.1483 kit. Closes #4074 Closes #4236 Closes #4238 Closes #4239 Closes #4242 Closes #4243 Closes #4248 Closes #4249 🤖 Generated with [Claude Code](https://claude.com/claude-code)
What
secrets_sync.pydry run with noopaccount configured now refuses and namesop account addas the step to run first. It used to enroll an account on a terminal, which changed localopconfiguration.--secretsbootstrap tests and the Linuxrestore-secrets.shtests that must reach the root refusal now skip when the runner is root. Cases that end before that refusal still run as root, as does the dedicated root-refusal test.scripts/README.mdandhost-setup/README.mdstate the no-account dry-run refusal.Answers two CodeRabbit threads on promotion #4255: the
secrets_sync.pydry-run enrollment finding (anchored athost-setup/linux/restore-secrets.sh:99) and the root-runner finding attests/test_bootstrap.py:2221. Merged here, the fix reachesmainthrough that promotion.Verification
Full suite: 4483 tests OK, 12 skipped (4482 before the new test). Three local strict-review passes and one clean final pass over the head, each by a reviewer subagent that read the diff.
Review
No
introducedfinding is open. The one raised by the third pass (a docstring naming the wrong root check) was fixed in the last commit.Pre-existing findings, not filed:
tests/test_secrets_sync.pyas a whole would fail on a real root runner, sincemain()refuses root before most cases patchgeteuid. Class: pre-existing, outside the two findings.🤖 Generated with Claude Code