Skip to content

fix(runner): use stdin only when no list provided - #297

Open
dwisiswant0 wants to merge 1 commit into
mainfrom
dwisiswant0/fix/runner/use-stdin-only-when-no-list-provided
Open

dwisiswant0 wants to merge 1 commit into
mainfrom
dwisiswant0/fix/runner/use-stdin-only-when-no-list-provided

Conversation

@dwisiswant0

@dwisiswant0 dwisiswant0 commented Sep 16, 2026

Copy link
Copy Markdown
Member

Read stdin only when no domains were loaded from -l/-list or the CLI
config. Previously, a detected pipe replaced those domains with stdin
input, or blocked waiting for EOF even though input was already
available.

Fixes #296

Summary by CodeRabbit

  • Bug Fixes

    • Preserved domains supplied through command-line flags or configuration when stdin is also available.
    • Stdin is now used only when no domains are provided through other supported inputs.
  • Tests

    • Added coverage for domain input from flags, files, configuration, and stdin, including empty, idle, and whitespace-only input scenarios.

Read stdin only when no domains were loaded from -l/-list or the CLI
config. Previously, a detected pipe replaced those domains with stdin
input, or blocked waiting for EOF even though input was already
available.

Fixes #296

Signed-off-by: Dwi Siswanto <git@dw1.io>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: f6fed074-539b-4f60-8295-222e6713dd52

📥 Commits

Reviewing files that changed from the base of the PR and between 7c34e21 and 015a995.

📒 Files selected for processing (2)
  • internal/runner/runner.go
  • internal/runner/runner_test.go

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

ParseFlags now keeps domains supplied by flags or configuration when stdin is available. New subprocess tests cover input precedence, file and configuration inputs, pipe behavior, normalization, timeouts, and missing-input errors.

Changes

ParseFlags input handling

Layer / File(s) Summary
Preserve configured domains
internal/runner/runner.go
ParseFlags reads stdin only when stdin is available and opts.Domains is empty.
Validate input-source behavior
internal/runner/runner_test.go
Subprocess tests cover list flags, files, configuration, piped and idle stdin, empty input, whitespace normalization, timeouts, and missing-input errors. A helper subprocess entry point returns parsed domains as JSON.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 015a9

Configured domains retain precedence over stdin, and the supplied test coverage addresses piped and idle stdin behavior. The change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: stdin is used only when no list input is provided.
Linked Issues check ✅ Passed The PR addresses #296. ParseFlags now reads stdin only when no domains come from -l/-list or configuration. This prevents list domains from being discarded and prevents waiting for stdin when li…
Out of Scope Changes check ✅ Passed The reported changes are limited to stdin and domain-input handling in internal/runner/runner.go and tests in internal/runner/runner_test.go. The tests directly validate the requirements in #296. …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dwisiswant0/fix/runner/use-stdin-only-when-no-list-provided

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.


A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

alterx silently ignores -l when stdin is a pipe, and hangs forever when that pipe is empty

1 participant