Repository navigation
ADFA-5086: Fail a plugin command with bad paths or environment instead of throwing - #2091
Daniel-ADFA wants to merge 2 commits into
Conversation
…owing
executeCommand passed the plugin-supplied ShellCommand.workingDirectory
straight to Paths.get and File.canonicalFile, so a NUL character threw
InvalidPathException and a path too long to resolve threw IOException,
both out of the host service and onto the plugin's calling thread. The
environment map had the same problem: ProcessBuilder rejects a NUL or
'=' in a name or value with IllegalArgumentException.
These now return a CommandExecution that has already completed with
CommandResult.Failure ("Invalid working directory: ..." or "Invalid
environment: ..."), the same shape a failed process start already
reports. Permission, concurrency and outside-the-project-root checks
still throw SecurityException/IllegalStateException as before.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 Summary
WalkthroughCommand execution now returns a rejected result when working-directory resolution or validation raises selected path or I/O errors, or when applying the environment raises ChangesCommand Input Rejection
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is established. The change reports invalid command setup as failures without changing the existing security checks; merge after normal checks pass. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks the paths with care, Comment |
ADFA-5086
IdeCommandServiceImpl.executeCommandno longer throws on bad plugin input. These now return an execution that has already completed withCommandResult.Failure:workingDirectorywith a NUL character (InvalidPathExceptionfromPaths.get)workingDirectorytoo long to resolve (IOExceptionfromcanonicalFile, at the resolve site and invalidateWorkingDirectory)environmentnames or valuesProcessBuilderrejects (IllegalArgumentException, NUL or=)Permission, concurrency and outside-the-project-root checks still throw as before.
executableandargumentswere already reported as a failure, since they only reachProcessBuilder.start()inside the execution.Review by commit: the first commit is a Spotless reformat of
IdeCommandServiceImpl.ktonly.