refactor(core): model executor spawn failures explicitly - #24
Conversation
📝 WalkthroughWalkthroughIntroduced a pluggable CommandRunner abstraction and PlatformCommandRunner adapter, refactored command execution to use runners, added command redaction and a CommandSpawnFailed error variant, and updated tests to exercise runner-based execution and redaction behavior. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/git-smee-core/src/executor.rs`:
- Around line 114-125: The redact_command function currently treats the first
whitespace token as the executable and can leak inline env assignments like
KEY=VALUE; update redact_command to skip any leading tokens that match an
ENV_ASSIGN pattern (tokens containing '=' before any whitespace and not starting
with '-' or containing a path separator) and consider the first non-ENV_ASSIGN
token as the executable (or use "<redacted>" if none remain) before applying the
existing truncation and "<args redacted>" logic; reference the redact_command
function and the local variables tokens, executable, and redacted when making
the change.
|
Addressed the CodeRabbit comment about potential secret leakage in redaction.
This is now in commit |
What changed
NonSuccessfulExitStatuserror withCommandSpawnFailed { command, source }<args redacted>) to improve diagnostics without leaking sensitive argsExecutionFailed,ExecutionTerminatedBySignal)Validation
cargo test --workspaceCloses git-smee-7ud.
Summary by CodeRabbit
Refactor
Bug Fixes
Tests