Default stream: parallel scan + stdout serialization#8
Conversation
- Replace blocking scan+process with runRainDefaultStream (git-fire-style): cancellable scan, upsert/filter pipeline, FetchWorkers pool, atomic totals - Per-repo output via runRainOnRepo with [N/M] headers and mutex-serialized blocks - Scan progress ticker (2s), post-run TTY scan-wait or non-interactive cancel - Tests: streaming integration, helper coverage, fetchFailureMessage/weather/outcome/buildKnownPaths/upsert
Drop unreachable post-worker scan prompt (scan always finishes before repoChan closes). Serialize folder-progress lines with printMu like worker output. Await scanDone before reading scanErr to avoid a race. Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
… under printMu Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
- Resolve merge conflicts in cmd/root.go and cmd/root_test.go - Hold printMu while printing runRainDefaultStream summary lines - Wait for scan progress ticker exit after scanDone so a final tick cannot print after the summary Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 56 minutes and 56 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChanges synchronize ticker shutdown and final output printing in the scan-progress function by introducing a signaling channel and mutex locking. Additionally, dependency management is updated to promote Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@go.mod`:
- Line 31: The go.mod lists github.com/mattn/go-isatty as an indirect dependency
but cmd/root.go imports it directly; update go.mod to make
github.com/mattn/go-isatty a direct dependency by running `go mod tidy` (or
removing the "// indirect" marker and ensuring the require line is present) so
the module appears in the direct dependencies; check cmd/root.go import of
github.com/mattn/go-isatty and verify `go.sum` is updated accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 48635ac6-61fa-4224-b23d-0f5184ea9a61
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (2)
cmd/root.gogo.mod
| github.com/gofrs/flock v0.12.1 // indirect | ||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/lucasb-eyer/go-colorful v1.3.0 // indirect | ||
| github.com/mattn/go-isatty v0.0.20 // indirect |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify whether go-isatty is directly imported by repository Go files.
rg -n --type=go -C2 '"github\.com/mattn/go-isatty"'
rg -n -C2 'github\.com/mattn/go-isatty' go.modRepository: git-fire/git-rain
Length of output: 532
Move go-isatty from indirect to direct dependencies.
cmd/root.go line 19 directly imports github.com/mattn/go-isatty, so marking it // indirect is inconsistent with the source code. Running go mod tidy will move it to the direct dependency section.
Proposed fix
require (
github.com/charmbracelet/bubbles v1.0.0
github.com/charmbracelet/bubbletea v1.3.10
github.com/charmbracelet/lipgloss v1.1.0
github.com/git-fire/git-testkit v0.2.0
github.com/gofrs/flock v0.12.1
+ github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-runewidth v0.0.19
github.com/pelletier/go-toml/v2 v2.2.4
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
)
@@
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
- github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@go.mod` at line 31, The go.mod lists github.com/mattn/go-isatty as an
indirect dependency but cmd/root.go imports it directly; update go.mod to make
github.com/mattn/go-isatty a direct dependency by running `go mod tidy` (or
removing the "// indirect" marker and ensuring the require line is present) so
the module appears in the direct dependencies; check cmd/root.go import of
github.com/mattn/go-isatty and verify `go.sum` is updated accordingly.
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 160e3d8. Configure here.
Summary
Merges latest
maininto this branch and fixes a race where default-stream summary lines could interleave with the folder scan-progress ticker.Changes
printMu: After workers and scan complete, summary output uses the same mutex as workers and the scan ticker so lines cannot splice mid-write.scanDoneso a tick that was already eligible cannot emit a scan line after the summary (which would otherwise be possible onceprintMuis released).Testing
make test-racemake lint(go vet ./...)Summary by CodeRabbit
Bug Fixes
Chores