⚡ Bolt: Add concurrency to _filter_to_still_open_prs#50
Conversation
Co-authored-by: xbmc4lyfe <273732874+xbmc4lyfe@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR introduces concurrency to PR filtering by replacing sequential ChangesConcurrent PR State Checking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.jules/bolt.md:
- Line 1: Update the changelog heading "## 2024-05-26 - Add concurrency to
_filter_to_still_open_prs" to the correct date for this PR (2026-05-26) so the
entry reads "## 2026-05-26 - Add concurrency to _filter_to_still_open_prs";
locate the heading in .jules/bolt.md and replace the year portion only, leaving
the rest of the text and the referenced function name
(_filter_to_still_open_prs) unchanged.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 378b49dd-0a8a-459d-a9ca-dc650ab950f5
📒 Files selected for processing (2)
.jules/bolt.mdralph_loop/cli.py
📜 Review details
🧰 Additional context used
🧬 Code graph analysis (1)
ralph_loop/cli.py (3)
ralph_loop/process.py (1)
_print_step(84-97)ralph_loop/gh_ops.py (1)
_pr_is_still_open(449-481)ralph_loop/errors.py (1)
CommandError(5-6)
🔇 Additional comments (1)
ralph_loop/cli.py (1)
5-5: LGTM!Also applies to: 549-572
| @@ -0,0 +1,3 @@ | |||
| ## 2024-05-26 - Add concurrency to _filter_to_still_open_prs | |||
There was a problem hiding this comment.
Fix the changelog entry date.
The heading date is 2024-05-26, but this PR is from May 26, 2026. Please update it to keep project history accurate and avoid timeline confusion.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.jules/bolt.md at line 1, Update the changelog heading "## 2024-05-26 - Add
concurrency to _filter_to_still_open_prs" to the correct date for this PR
(2026-05-26) so the entry reads "## 2026-05-26 - Add concurrency to
_filter_to_still_open_prs"; locate the heading in .jules/bolt.md and replace the
year portion only, leaving the rest of the text and the referenced function name
(_filter_to_still_open_prs) unchanged.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4830351bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: | ||
| for pr, still_open, exc in executor.map(_check_pr, pr_numbers): |
There was a problem hiding this comment.
Keep PR state checks serialized to avoid rate-limit stalls
This new thread pool sends up to 10 gh pr view requests at once, but GitHub’s REST best-practices explicitly say to "make requests serially instead of concurrently" to avoid secondary rate limits. In this codepath, a secondary-limit response triggers _gh_run_with_retry’s 300s sleep, so parallel workers can enter synchronized backoff and significantly delay or stall fan-out startup for repos with many PRs.
Useful? React with 👍 / 👎.
💡 What: Added
concurrent.futures.ThreadPoolExecutorto parallelize GitHub CLI calls within_filter_to_still_open_prs.🎯 Why: Subprocess calls to the GitHub CLI sequentially executed in loops are a significant performance bottleneck due to startup time and network requests, creating delays proportional to the number of open PRs (N+1 queries).
📊 Impact: Considerably reduces the latency of
_filter_to_still_open_prswhen multiple PRs are involved.🔬 Measurement: Verify execution time of
_filter_to_still_open_prslocally with and without changes on a repo with multiple open PRs.PR created automatically by Jules for task 14732288509175498966 started by @xbmc4lyfe