Repository navigation
feat(cli): parallel --rain fetch with bounded worker pool (PR D) - #28
bschellenberger2600 wants to merge 12 commits into
Conversation
Run post-picker repos through the same fetch_workers pool as the default streaming path so one stalled remote cannot block later repos. Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
…' into cursor/parallel-rain-workers-971d Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
…ers-971d Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
…ers-971d Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
…nRepos Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
…ers-971d Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Rain indexes ignore selection order
- Indexes are now taken from confirmed selection slice position via rainRepoJob, so [n/total] and --json index stay stable under parallel workers.
Or push these changes by commenting:
@cursor push 89638c54e9
Preview (89638c54e9)
diff --git a/cmd/rain_workers.go b/cmd/rain_workers.go
--- a/cmd/rain_workers.go
+++ b/cmd/rain_workers.go
@@ -11,6 +11,11 @@
"github.com/git-rain/git-rain/internal/registry"
)
+type rainRepoJob struct {
+ repo git.Repository
+ index int
+}
+
// runRainReposParallel runs fetch/rain for repos using the same bounded worker
// pool as the default streaming CLI path.
func runRainReposParallel(reg *registry.Registry, repos []git.Repository, rainOpts git.RainOptions, fullSync bool, fetchWorkers int) (rainTotals, []jsonRepoResult) {
@@ -19,9 +24,9 @@
}
workers := fetchWorkerCount(fetchWorkers)
- repoChan := make(chan git.Repository, len(repos))
- for _, repo := range repos {
- repoChan <- repo
+ repoChan := make(chan rainRepoJob, len(repos))
+ for i, repo := range repos {
+ repoChan <- rainRepoJob{repo: repo, index: i + 1}
}
close(repoChan)
@@ -31,9 +36,8 @@
skipped int64
frozen int64
failed int64
- seq int64
)
- total := int64(len(repos))
+ total := len(repos)
var jsonReports []jsonRepoResult
var jsonReportsMu sync.Mutex
@@ -43,13 +47,12 @@
workersWG.Add(1)
go func() {
defer workersWG.Done()
- for repo := range repoChan {
+ for job := range repoChan {
if runCtx != nil && runCtx.Err() != nil {
continue
}
- current := int(atomic.AddInt64(&seq, 1))
var buf strings.Builder
- delta, report := runRainOnRepo(reg, repo, rainOpts, fullSync, current, int(total), &buf, !rainJSON)
+ delta, report := runRainOnRepo(reg, job.repo, rainOpts, fullSync, job.index, total, &buf, !rainJSON)
printMu.Lock()
if !rainJSON {You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit e00bcd3. Configure here.
Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
…ers-971d Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
…heck S1030) Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>


Stacked stall-review fix 4/6. Base:
cursor/network-failfast-env-971d(PR C). PR E stacks on this branch.Summary
After the
--rainpicker confirms, selected repos run through the same boundedfetch_workerspool as the default streaming CLI (runRainReposParallel), usingRunNetworkGittimeouts and run-level cancellation.Tests
TestRunRainOnRepos_ParallelStallDoesNotBlockHealthyVerification
go vet ./...— passgo test -race -count=1 ./...— pass except knownTestNetworkFetch_UnauthenticatedHTTPSFailsWithoutPrompt(PR test: make network auth fetch regression test deterministic #21)