Skip to content

feat(scan): add -concurrency flag to scan targets in parallel#367

Open
TBX3D wants to merge 2 commits into
vmfunc:mainfrom
TBX3D:feat/scan-concurrency-flag
Open

feat(scan): add -concurrency flag to scan targets in parallel#367
TBX3D wants to merge 2 commits into
vmfunc:mainfrom
TBX3D:feat/scan-concurrency-flag

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

scanning targets one at a time serializes wall-clock time with target count. add a -concurrency flag that runs a worker pool over targets, defaulting to the current sequential behavior when unset.

stacked on #330 (per-target scan extraction) - this only makes sense once scanTarget exists as its own function.

pull the target loop body into scanTarget, which returns a targetScan
holding that target's findings, report rows, scan labels and log files
instead of appending onto run-wide slices. the run loop merges those in
target order and finishRun handles the post-loop notify/silent/report/
summary steps. behavior is identical for the sequential run today; the
isolation is the seam a bounded worker pool needs next.
@TBX3D TBX3D requested a review from vmfunc as a code owner July 10, 2026 00:11
@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 13.01775% with 294 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
sif.go 12.77% 242 Missing and 38 partials ⚠️
internal/output/output.go 0.00% 11 Missing ⚠️
internal/config/config.go 33.33% 2 Missing ⚠️
internal/output/spinner.go 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #367   +/-   ##
=======================================
  Coverage        ?   54.89%           
=======================================
  Files           ?       81           
  Lines           ?     6939           
  Branches        ?        0           
=======================================
  Hits            ?     3809           
  Misses          ?     2823           
  Partials        ?      307           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added tests test changes config configuration changes size/xl 500+ lines changed labels Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

pr summary

7 files changed (+638 -325)

category files
go source 7
tests 2

add -concurrency N (default 1) to run the per-target scan pool over
several targets at once. scanTarget already returns isolated
accumulators, so workers share only the console: output.SetConcurrent
serializes sink writes and de-animates spinners/progress so parallel
lines stay whole. results merge in input order, and concurrency 1 keeps
the sequential path unchanged.
@TBX3D TBX3D force-pushed the feat/scan-concurrency-flag branch from d62d79a to 634e6b0 Compare July 10, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config configuration changes size/xl 500+ lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants