Make hook execution working directory explicit - #202
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughHook execution now uses an explicit repository working directory. The CLI no longer changes the caller’s current directory. Executor and runner APIs support explicit directories, with tests for nested directories, bare repositories, linked worktrees, and failed execution. ChangesHook working-directory execution
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant CLI_run_hook
participant Git_repository
participant Executor
participant PlatformCommandRunner
participant Hook_command
CLI_run_hook->>Git_repository: find repository root
CLI_run_hook->>Executor: execute hook with root directory
Executor->>PlatformCommandRunner: configure explicit working directory
PlatformCommandRunner->>Hook_command: spawn command at repository root
Hook_command-->>CLI_run_hook: execution result
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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 `@crates/git-smee-core/src/executor/runner.rs`:
- Around line 207-215: Update the Windows-only cmd_compatible_path function to
handle paths beginning with \\?\UNC\ by converting them to the absolute UNC form
\\server\share\repo before returning. Preserve the existing \\?\ drive-letter
prefix removal behavior for non-UNC paths, ensuring the result remains suitable
for shell_command.current_dir().
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: dd2afad9-46e7-4ed5-904c-ae7ab2e5eab5
📒 Files selected for processing (4)
crates/git-smee-cli/src/commands/run.rscrates/git-smee-cli/tests/cli_integration.rscrates/git-smee-core/src/executor.rscrates/git-smee-core/src/executor/runner.rs
Summary
TDD
RED was established with
successful_run_preserves_callers_current_directoryandfailed_run_preserves_callers_current_directory: both failed becauserun_hookleft the process cwd at the repository root (the second test also observed the poisoned test lock after the first assertion failure).Validation
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p git-smee-core executorcargo test -p git-smee-core repositorycargo test -p git-smee-cli --test cli_integration(74 passed)cargo test --workspace --all-targets --all-featuresFixes #201
Summary by CodeRabbit