Skip to content

ci: release notes batch 10 commits per GraphQL query and retry GitHub 5xx - #20412

Merged
lawrencecchen merged 1 commit into
mainfrom
fix-rc-notes-graphql-502
Oct 14, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
fix-rc-notes-graphql-502

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The 0.65.2 RC publish (run 38501752257) passed the new RC-line guard from #20331, then failed in scripts/ci/nightly_release_notes.py with GitHub metadata request failed. A new RC line summarizes the commits since the two lines split, about 2,000 commits here. I reproduced it locally against the same range: GitHub answered the 25-commit associatedPullRequests GraphQL batch with HTTP 502 (each commit asks for up to 10 PRs with 100 labels and 100 files).

This PR:

  • Batches 10 commits per GraphQL query (COMMIT_BATCH).
  • Retries a GitHub 5xx up to 3 times, with a 2, 4 and 8 s backoff. Other failures still stop at once.

Verification

  • Local run of collect_prs with this script against the real range (published 77eea5f → rc/v0.65.2 d17004f, which goes through the merge-base path): completes with 1,328 PRs in about 19 minutes. The rendered notes still list at most 40 PRs plus an "and N more" link.
  • tests/test_nightly_release_notes.py: passes. The batching test now checks COMMIT_BATCH; 27 commits give 3 queries.

After the merge, I re-run the failed publish job of run 38501752257, so the 0.65.2 RC reaches the feed.

Changelog

none


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the release notes script failing on large commit ranges: the 0.65.2 RC publish hit HTTP 502 because GitHub rejected the 25-commit GraphQL batch. The script now batches 10 commits per query and retries GitHub 5xx responses up to 3 times with 2, 4, and 8 s backoff; other failures still fail immediately.

Written for commit 042acb8. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Chores
    • Release note generation now retries temporary server errors before reporting a failure, helping it recover from intermittent service issues.
    • Commit information is processed in smaller batches, with the batch size reflected in automated checks.

… 5xx

The 0.65.2 RC publish (run 38501752257) failed in the release notes: a new
RC line summarizes ~2,000 commits since the lines' merge base, and GitHub
answered a 25-commit association query with HTTP 502. Locally the same range
completes with 10 commits per query and 5xx retries (1,328 PRs, ~19 min).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Correctness review by a subagent, correctness first: no blocking or major findings. Verified: imports present; the retry loop keeps the last result (success, non-5xx, or 4th attempt; 14 s total backoff); GraphQL errors handling unchanged; REST compare retries are safe reads; the RC publish job has no timeout (360-minute default); nightly.yml's 30-minute publish-nightly works on small daily ranges. Minor notes I left as is: a 90 s TimeoutExpired is still not retried (same as before), and there is no new test for the retry path (team rule: no new unit tests; the real-range run above is the evidence).

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bf37bc20-c17c-46ae-a46e-d961447509bd
📥 Commits

Reviewing files that changed from the base of the PR and between 82b7a92 and 042acb8.

📒 Files selected for processing: 2
  • scripts/ci/nightly_release_notes.py
  • tests/test_nightly_release_notes.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The nightly release-note script retries failed requests that match HTTP 5xx responses and reduces GraphQL commit batches from 25 to 10. The batch-query test now checks the configured batch size and expects three GraphQL calls.

Changes: Nightly release notes

Layer / File(s) Summary
GitHub request retries and commit batching
scripts/ci/nightly_release_notes.py, tests/test_nightly_release_notes.py
GitHub.request retries matching HTTP 5xx failures up to four times, with delays of 2, 4, and 8 seconds. Commit queries use batches of 10. The test checks NOTES.COMMIT_BATCH and expects three GraphQL calls.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: teamleaderleo

Merge Risk: ⚪ Minimal · up to 042ac

The release-notes change batches GraphQL requests and retries transient GitHub server errors; no remaining merge risk is identified.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

Failed Failed checks: 1 error · 1 warning

Check name Status Explanation Resolution
Cmux No Hacky Sleeps Error The PR adds a production fixed backoff at scripts/ci/nightly_release_notes.py:33: time.sleep(2 ** (attempt + 1)) inside the new GitHub 5xx retry loop. This is a wall-clock network retry delay, whi… Remove the direct fixed sleep. Use a tested, cancellation-aware retry abstraction with a bounded overall deadline, or redesign the GitHub request path to retry without wall-clock backoff. Add tests for 5xx retry, final failure, cancellation…
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 23 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes both primary changes: reducing GraphQL batches to 10 commits and retrying GitHub 5xx responses.
Description check Passed The description is mostly complete and directly addresses the failure, implementation, verification results, and changelog. Testing is documented under “Verification.” The template’s Proof and Checkli…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input Passed PASS: The diff changes only GitHub release-notes collection in scripts/ci/nightly_release_notes.py and its test. It adds COMMIT_BATCH batching and retries gh api on HTTP 5xx responses. It does n…
Cmux Swift Actor Isolation Passed The pull request changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. The production change is Python code, and the test change is also Python. No Swift produc…
Cmux Swift Blocking Runtime Passed The pull request changes only Python CI code and its Python tests. It does not change production Swift code. Therefore, the Swift blocking-runtime check is not applicable, even though the Python scrip…
Cmux Browser Automation Off-Main Passed PASS: The pull request changes only scripts/ci/nightly_release_notes.py and its Python tests. The diff contains GitHub API retry logic and commit batching, with no browser.* socket automation comm…
Cmux Expensive Synchronous Load Passed The pull request changes only Python CI code and its Python tests: scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. It adds GitHub request retries and changes GraphQL b…
Cmux Cache Substitution Correctness Passed PASS: The pull request changes only Python files: scripts/ci/nightly_release_notes.py and its Python test. The custom check applies to production Swift, TypeScript, and JavaScript changes, and the d…
Cmux Algorithmic Complexity Passed PASS. The diff does not introduce a listed complexity defect. In scripts/ci/nightly_release_notes.py, COMMIT_BATCH = 10 keeps each GraphQL batch explicitly bounded. The changed collection processi…
Cmux Swift Concurrency Passed PASS: The pull request changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. Both are Python files. The diff introduces no cmux-owned Swift code or Swift concur…
Cmux Swift @Concurrent Passed The pull request changes only Python files: scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. It introduces no Swift code or Swift call-site changes, so the `@concurrent…
Cmux Swift Package Boundaries Passed The pull request changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. The diff contains no Swift production changes, so the Swift package boundary rule does no…
Cmux Swiftpm Lockfiles Passed PASS: The PR changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. The diff contains no SwiftPM package, Package.resolved, .gitignore, workflow, Xcode proje…
Cmux Swift Logging Passed PASS. The pull request changes only Python CI code and its Python tests. It adds no production Swift logging or other Swift code, so the Swift logging failure conditions do not apply.
Cmux User-Facing Error Privacy Passed The diff changes internal CI metadata batching and retries only. It adds no user-facing error, alert, API body, or recovery copy. The script runs from GitHub Actions and its changed behavior does not …
Cmux Full Internationalization Passed PASS: The PR changes only CI metadata batching, retry timing, comments, and a test expectation. It does not add or materially change user-facing Swift text, locale catalogs, web messages, API copy, re…
Cmux Swiftui State Layout Passed The pull request changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. The reviewed diff contains no Swift or SwiftUI files or code, so the SwiftUI state-layout…
Cmux Architecture Rethink Passed PASS. The pull request changes only Python CI code and its Python tests. It does not change Swift architecture. The Swift-specific failure conditions do not apply.
Cmux Swift Auxiliary Window Close Shortcuts Passed PASS: The pull request changes only Python files (scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py). It adds no Swift window code, so the auxiliary-window close-shortcut…
Cmux Source Artifacts Passed The pull request changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. These are intentional source and test files. The diff adds no logs, screenshots, recordin…
Cmux No Test Or Debug Seam In Production Source Passed The pull request changes only scripts/ci/nightly_release_notes.py and tests/test_nightly_release_notes.py. The authoritative diff contains no Swift file under a production Sources/ path, so this…
Full details: Cmux No Hacky Sleeps

Explanation

The PR adds a production fixed backoff at scripts/ci/nightly_release_notes.py:33: time.sleep(2 ** (attempt + 1)) inside the new GitHub 5xx retry loop. This is a wall-clock network retry delay, which the rule explicitly flags. The code uses a plain loop with per-call 90-second timeouts, has no cancellation-aware scheduler or bounded overall deadline, and the changed tests cover batching only, not retry behavior.

Resolution

Remove the direct fixed sleep. Use a tested, cancellation-aware retry abstraction with a bounded overall deadline, or redesign the GitHub request path to retry without wall-clock backoff. Add tests for 5xx retry, final failure, cancellation/deadline handling, and non-5xx behavior.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lawrencecchen
lawrencecchen merged commit 085479b into main Oct 14, 2026
54 checks passed
@lawrencecchen
lawrencecchen deleted the fix-rc-notes-graphql-502 branch October 14, 2026 03:28
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 042acb8291: every check was green at merge (9 verified; 15 skipped by policy). Full suite runs on main after merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant