Skip to content

Refuse a Dry Run With No 1Password Account and Skip Root-Refused Secrets Tests as Root - #4258

Merged
ptr727 merged 4 commits into
developfrom
feature/secrets-dryrun-root
Nov 17, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/secrets-dryrun-root

Conversation

@ptr727

@ptr727 ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

  • A secrets_sync.py dry run with no op account configured now refuses and names op account add as the step to run first. It used to enroll an account on a terminal, which changed local op configuration.
  • The --secrets bootstrap tests and the Linux restore-secrets.sh tests 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.md and host-setup/README.md state the no-account dry-run refusal.

Answers two CodeRabbit threads on promotion #4255: the secrets_sync.py dry-run enrollment finding (anchored at host-setup/linux/restore-secrets.sh:99) and the root-runner finding at tests/test_bootstrap.py:2221. Merged here, the fix reaches main through 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 introduced finding 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.py as a whole would fail on a real root runner, since main() refuses root before most cases patch geteuid. Class: pre-existing, outside the two findings.

🤖 Generated with Claude Code

ptr727 and others added 4 commits November 17, 2026 08:21
…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]>
Copilot AI lite review requested due to automatic review settings November 17, 2026 16:34
@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 01251625fd8c68b7ec41bbbb3b5907913a79a9f1, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7c082a0 and 0125162.

Files selected for processing: 6

  • host-setup/README.md
  • scripts/README.md
  • scripts/secrets_sync.py
  • tests/test_bootstrap.py
  • tests/test_restore_secrets.py
  • tests/test_secrets_sync.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 add remedy.
  • 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

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.20%. Comparing base (7c082a0) to head (0125162).

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           
Flag Coverage Δ
python-3.13 78.20% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 345ba6d into develop Nov 17, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/secrets-dryrun-root branch November 17, 2026 16:55
ptr727 added a commit that referenced this pull request Nov 17, 2026
…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)
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.

2 participants