Skip to content

Keep a Subdirectory Out of the Scaffold's Unclaimed Secret Files - #4075

Merged
ptr727 merged 2 commits into
developfrom
feature/promotion-4070-review-fixes-2
Nov 11, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/promotion-4070-review-fixes-2

Conversation

@ptr727

@ptr727 ptr727 commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Fixes review findings on promotion #4070.

Summary

  • spec/resolve_secrets.py scaffold: the directory scan counted every entry, so a subdirectory such as notes/ was listed as an unclaimed secret file. A subdirectory is now never unclaimed. Its name still counts as taken, so nothing is created over it, and an expected name held by one still reads as present, which lib/sh/secrets.sh then refuses as no regular file.
  • A subdirectory at a wrong-scope name still stops the run. That half of the finding is declined: repo-config/configure.sh plan_secrets refuses any entry at a wrong-scope name ([ -e ] || [ -L ]), a directory included, so the scaffold stopping there keeps the two agreeing.
  • A symlink keeps reading as a file at its name whatever it resolves to, a dangling one included, since that is the file lib/sh/secrets.sh refuses by name. An is_file() filter would drop a dangling symlink or one to a directory, and the O_EXCL create over that name would then stop the run part way through.
  • tests/test_resolve_secrets.py: a test that fails without the fix (subdirectories at an unclaimed and an expected name), one pinning that a wrong-scope subdirectory stops the run, and one pinning the symlink reading.

Verification

  • python -m unittest discover -s tests -p test_resolve_secrets.py: 61 tests pass, and the subdirectory test fails against the unfixed scaffold.
  • ruff check, ruff format --check, mypy, and the diff-scoped prose gate pass.

Closes on promotion: none

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 11, 2026 07:59
The scaffold's widened directory scan counted every entry, so a
subdirectory read as an unclaimed secret file, and one carrying a
wrong-scope name stopped the run. A subdirectory now keeps its name
taken, so nothing is created over it, without ever reading as a stray
or as unclaimed. A symlink still reads as a file at its name whatever
it resolves to, since that is the file lib/sh/secrets.sh refuses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
configure.sh apply refuses any entry at a wrong-scope name, a
directory included, so the scaffold stopping there is the two agreeing.
Only the unclaimed list now leaves a subdirectory out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 11, 2026 16:05
@coderabbitai

coderabbitai Bot commented Nov 11, 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 6 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 f1c5d14 and 40b82e8.

Files selected for processing: 2

  • spec/resolve_secrets.py
  • tests/test_resolve_secrets.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

@ptr727

ptr727 commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

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

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 change includes targeted handling and regression tests for directory, wrong-scope, and symlink cases.

No open issues 🎉

What changed in this PR

This pull request updates secret scaffolding so subdirectories are not reported as unclaimed secret files while preserving wrong-scope and symlink handling.

Changes:

  • Excludes subdirectories from unclaimed results while keeping their names occupied.
  • Preserves blocking behavior for wrong-scope entries and symlink handling.
  • Adds regression tests for directory and symlink cases.
File Description
tests/​test_resolve_secrets.py Adds regression tests covering expected and unclaimed subdirectories, wrong-scope directories, and symlink behavior.
spec/​resolve_secrets.py Updates scaffold scanning to exclude subdirectories from unclaimed results while retaining their names as occupied.

Review effort: Lite

@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.34%. Comparing base (f1c5d14) to head (40b82e8).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4075   +/-   ##
========================================
  Coverage    82.33%   82.34%           
========================================
  Files           38       38           
  Lines        12947    12951    +4     
========================================
+ Hits         10660    10664    +4     
  Misses        2287     2287           
Flag Coverage Δ
python-3.13 82.34% <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 11, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 11, 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.

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