fix: split comma-separated entries from list input#950
fix: split comma-separated entries from list input#950hriszc wants to merge 3 commits intoprojectdiscovery:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughRefactors input handling to split comma-separated entries before processing. Adds an unexported helper Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
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
🧹 Nitpick comments (1)
internal/runner/runner_test.go (1)
41-70: Add an end-to-end regression test for-land stdin paths.These cases only validate
splitInputEntries(). They won't catch regressions innormalizeAndQueueInputs, which is where the new file/stdin behavior actually lives. A temp-file case foroptions.InputListplus a stdin-backed case would give coverage on the paths this PR changes.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/runner/runner_test.go` around lines 41 - 70, Add an end-to-end regression test that exercises the actual input-queueing paths (not just splitInputEntries): create a test (e.g., TestNormalizeAndQueueInputs or TestInputPaths) that writes a temp file and sets options.InputList to point at it to validate the "-l" file path, and add a stdin-backed case (use an io.Reader or os.Stdin replacement) to validate the stdin path; call normalizeAndQueueInputs with those options and assert the queued/normalized results match expectations, ensuring the new file/stdin behavior from normalizeAndQueueInputs is covered instead of only testing splitInputEntries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/runner/runner.go`:
- Around line 441-456: The scanner usage in runner.go (the loops that call
bufio.NewScanner for files and os.Stdin while iterating splitInputEntries and
calling r.processInputItem) must be made robust: after creating each scanner,
call scanner.Buffer with a larger max token size (e.g., several megabytes) to
allow long comma-separated lines, and after each scanning loop check
scanner.Err() and return or propagate the error instead of dropping input
silently; apply these changes to both the file-reading loop and the hasStdin
loop so long lines from splitInputEntries are not truncated and errors are
surfaced.
---
Nitpick comments:
In `@internal/runner/runner_test.go`:
- Around line 41-70: Add an end-to-end regression test that exercises the actual
input-queueing paths (not just splitInputEntries): create a test (e.g.,
TestNormalizeAndQueueInputs or TestInputPaths) that writes a temp file and sets
options.InputList to point at it to validate the "-l" file path, and add a
stdin-backed case (use an io.Reader or os.Stdin replacement) to validate the
stdin path; call normalizeAndQueueInputs with those options and assert the
queued/normalized results match expectations, ensuring the new file/stdin
behavior from normalizeAndQueueInputs is covered instead of only testing
splitInputEntries.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c2a1e855-b811-456b-bba3-f92e1074301e
📒 Files selected for processing (2)
internal/runner/runner.gointernal/runner/runner_test.go
Neo - PR Security ReviewNo security issues found Highlights
Hardening Notes
Comment |
|
Addressed the review feedback:
The PR head has been updated accordingly. |
|
Follow-up: scanner buffering/error handling feedback is already incorporated, checks are green, and the file/stdin regression tests are in place. Ready for maintainer review when convenient. |
|
Checks are green and the scanner/test feedback is already incorporated. This is ready for maintainer review when convenient. |
/claim #859
Summary
Normalize comma-separated entries from
-lfile input and stdin so they behave like-u, which already supports comma-separated values.Validation
Ran:
Result: passed.
Summary by CodeRabbit
New Features
Bug Fixes / Improvements
Tests