Analysis Progress Monitoring Improvement#419
Conversation
…ted progress bar to it.
There was a problem hiding this comment.
Pull request overview
This PR introduces a progress-observer abstraction for analysis runs and wires the CLI progress bar implementation through that interface, replacing direct progress-bar manipulation in organization scans.
Changes:
- Add a new
ProgressObserverinterface (with anoopObserverfallback) to emit structured analysis progress events. - Implement
ProgressBarObserverto render progress viaschollz/progressbar. - Update analyzer flows (org/repo/stale-branches) and CLI construction to use the observer.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/root.go | Sets Analyzer.Observer to a progress-bar observer based on quiet. |
| analyze/observer.go | Defines the ProgressObserver contract and a noop implementation. |
| analyze/progress_bar_observer.go | Implements observer callbacks using progressbar output. |
| analyze/analyze.go | Emits observer events during analysis instead of directly updating the org progress bar. |
| analyze/analyze_test.go | Adds tests for observer nil-safety, interface conformance, and basic concurrency exercise. |
Comments suppressed due to low confidence (1)
analyze/analyze.go:285
- After emitting
OnRepoStarted(repoString), error returns (e.g., fetch cone failure) don’t emitOnRepoError, so observers can’t accurately reflect failures for single-repo analysis. EmitOnRepoError(repoString, err)on each error path afterOnRepoStarted.
obs.OnRepoStarted(repoString)
repoUrl := repo.BuildGitURL(a.ScmClient.GetProviderBaseURL())
repoKey, err := a.fetchCone(ctx, repoUrl, a.ScmClient.GetToken(), "refs/heads/*:refs/remotes/origin/*", ".github/workflows")
if err != nil {
return nil, fmt.Errorf("failed to fetch cone: %w", err)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ow everything goes through the observer interface
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added the observer interface for monitoring analysis progress. converted progress bar to it.