Repository navigation
Conversation
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
|
I have read the CLA Document and I hereby sign the CLA |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 2 critical |
🟢 Metrics 7 complexity · 0 duplication
Metric Results Complexity 7 Duplication 0
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
The regression test does not reliably verify that icacls command output is included in the wrapped error; an exit-status-only message could pass. Strengthen the assertion before merging.
Test suggestions
- Verify icacls wraps a missing-path failure with the expected prefix and captured output.
- Verify icacls returns nil for an existing directory.
TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback
| if !strings.HasPrefix(err.Error(), "icacls: ") { | ||
| t.Errorf("icacls error = %q, want prefix %q", err.Error(), "icacls: ") | ||
| } | ||
| if strings.TrimPrefix(err.Error(), "icacls: ") == "" { |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Assert that the wrapped error contains the missing-path command's captured output, not merely non-empty text or an exit-status message.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Problem
icacls()inpackages/sandbox/windows.gois the single point where every deny and cleanup ACL call made fromLaunchcan fail. It wraps a failing command's output as"icacls: " + strings.TrimSpace(out.String()). No test calledicaclsdirectly, so a change to that wrapping, or a regression in how the output is captured, would only surface through aLaunch-level test failing for an unrelated reason.Change
Test-only. Adds
TestWindowsIcaclsWrapsFailureAndReturnsNilOnSuccesstopackages/sandbox/windows_test.go:icaclsagainst a path that does not exist and asserts a non-nil error with theicacls:prefix and non-empty captured output after it.icaclsagainst an existing temporary directory and asserts a nil return.No production code changes.
Testing
Run on Windows, where the file is built (
//go:build windows):go -C packages/sandbox test -count=1 -run TestWindowsIcaclsWrapsFailureAndReturnsNilOnSuccess -v .passed.go -C packages/sandbox vet .was clean.go -C packages/sandbox test -count=1 -v -run "Windows|SystemBinary" .passed, including the existing Windows tests.The test is excluded on Linux and macOS by its build tag, so it does not run in the Debian/WSL environment.
Regression test: untested: a small feature has no test that fails before the change
Fixes #350