Skip to content

feat(cli): show progress for longer duration scans - #114

Open
Dev10-sys wants to merge 3 commits into
chaoss:mainfrom
Dev10-sys:feat/show-scan-progress
Open

Dev10-sys wants to merge 3 commits into
chaoss:mainfrom
Dev10-sys:feat/show-scan-progress

Conversation

@Dev10-sys

Copy link
Copy Markdown

Description

  • CLI showed no output during long scans, looked like it was stuck.
  • Added progress output to stderr: Scanning commits: X/Y (Z%).
  • Only shows after 10 seconds so short scans aren't affected.
  • Added --no-progress flag for CI use.

This PR fixes #100

Notes for Reviewers
scanProgressDelay is a var so tests can override it.

Signed commits

  • Yes, I signed my commits.

Generative AI disclosure

Please select one option:

  • This contribution was NOT assisted or created by Generative AI tools.
  • This contribution was assisted or created by Generative AI tools.

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
@Dev10-sys
Dev10-sys force-pushed the feat/show-scan-progress branch from 6bc7377 to f532049 Compare October 1, 2026 04:59
@MoralCode

Copy link
Copy Markdown
Contributor

Code looks ok as a first pass, but I'd also want to find time to run this to validate it in more detail.

@MoralCode
MoralCode requested review from andrew and omkar-foss October 1, 2026 12:04

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The history-loading phase still leaves long scans without progress output. Please cover that phase before merging.

Comment thread scan/scan.go Outdated
// ScanCommitRangeWithProgress scans all commits in the given range using the provided detectors,
// invoking progress after each commit is processed if non-nil.
func ScanCommitRangeWithProgress(repoPath, commitRange string, detectors []detection.Detector, progress ProgressFunc) (Report, error) {
commits, err := gitops.ListCommits(repoPath, commitRange)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListCommits loads every commit and its notes before any progress callback runs. Running the CLI against a generated million-commit repository produced no stderr output for 51.8 seconds out of a 92.4-second scan, well beyond the ten-second threshold. Please add progress during history loading and a regression test through the CLI that covers a slow loading phase.

Report progress during history loading phase before scanning commits, and add CLI regression test covering slow loading.

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
@Dev10-sys

Copy link
Copy Markdown
Author

The history-loading phase still leaves long scans without progress output. Please cover that phase before merging.

Hey @andrew, I've pushed the updates to show progress during the history loading phase and added that regression test. Mind taking another look when you have a sec?

…/show-scan-progress

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

CLI should show progress for longer duration scans

3 participants