You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Combine exact PR fields and stack summary queries - #35295
An exact or fallback-number GitHub.com branch lookup currently reads rich PR fields and then probes REST for stack membership. Read the PR fields and stack summary together so a complete response removes that extra probe, with no batching wait or change to refresh cadence or TTLs.
For a no-stack PR with a cold stack-summary cache, the PR-fields plus stack-summary reads now make 1 request instead of 2. Repository capability reads, when needed, are unchanged. GraphQL still costs 1 point; a REST 200 would have cost 1 core point. A prior REST 304 already cost no core points, and a warm stack-summary cache already skipped its network request.
Keep checks on the latest commit and paginate beyond 100 contexts using the first page already fetched. Recover through the existing rich CLI path on unusable successful responses or a commit change during pagination. Transport/auth/rate-limit errors go directly to existing REST recovery, without a second GraphQL attempt; scoped NOT_FOUND results return immediately.
Only treat complete, valid stack data or explicit null/null as authoritative. Stack-only partial errors retain usable PR fields and recover via the existing stack reader. Keep existing stack-detail hydration and capability lookup on the original PR base branch.
Only exact/fallback-number branch lookups through lookupPRByNumber opt into the combined query. These serve sidebar refreshes and other existing branch-lookup consumers. Merge preflight, Enterprise, unresolved hosts and branch-discovery hydration retain their existing paths. Use the existing executor and caller account, environment, WSL and remote execution options; no IPC change.
Validation:
131 focused tests passed across eight files: sidebar query, linked lookup, branch discovery, fallback numbers, stack hydration, stack merge guard, merge/auto-merge safety and default-branch stale-PR handling. The 11 failures from the prior CI run are covered by these passing suites. Existing merge safety assertions are unchanged; sidebar integration fixtures now return the combined GraphQL envelope.
Replayed the request-count test against base production code with valid command-specific responses: it fails with 2 requests, while the new code passes with 1. The fixture uses a closed PR, which needs no capability read; the current test exercises the production exact-number lookup and refresh-derivation entry points.
Error-path regression replay against the previous PR head: authentication, secondary-rate-limit and timeout cases fail with 3 requests, while the fix passes with 2, preserving the original recovery cost.
pnpm check:changed --maxWorkers=2: 19/20 checks passed. The broad affected-test phase was stopped after 718 seconds without completing; the eight focused suites passed separately. Full CI passed on exact head 2b095713c6c2d465c10b25b3c244a63a6137770e (40765734859), including all five unit shards, relay integration and Linux/Windows packaging. No full local pass is claimed. Commit hooks passed formatting, lint and structural checks. Independent Claude review found no actionable regressions and passed the 76 scope/safety tests plus all 28 detail-context tests in the related PR.
Live positive-stack and native Windows/WSL/SSH transport checks were not run; stack mapping and execution-option preservation are covered by focused tests.
The skipped REST stack-summary probe no longer warms its ETag for a later merge. That first merge-time REST read can therefore cost one core point that a prior refresh might have saved via 304.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Walkthrough
The change adds a GraphQL sidebar query for pull-request metadata, stack fields, and paginated status checks. Candidate repository lookups can use this query and retain its stack summary. The tests cover query validation, pagination, fallback behavior, hydration, refreshes, and GraphQL-shaped pull-request fixtures.
Priority: Low
Merge Risk: Minimal · up to 2b095
No actionable issue remains from this review; the change is mergeable after normal checks.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check
The description clearly explains the change, motivation, behavior, recovery paths, testing, performance impact, and known validation gaps. However, it does not follow the required template and omits t…
Add the required template sections. Include an actual issue link under “Linked Issue” using “Fixes #” or explain the maintainer exception. Add N/A with a reason under “Visual Proof” if there is no UI or interaction change. Complet…
Passed checks: 3 passed
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title "Combine exact PR fields and stack summary queries" matches the main change: the sidebar lookup now reads PR fields and stack summary in one GraphQL query instead of a separate REST probe. I…
Full details: Title check
Explanation
The title "Combine exact PR fields and stack summary queries" matches the main change: the sidebar lookup now reads PR fields and stack summary in one GraphQL query instead of a separate REST probe. It is specific and concise. It does not name the GitHub.com sidebar scope, but that is a detail rather than a mismatch.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 5 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Full details: Description check
Explanation
The description clearly explains the change, motivation, behavior, recovery paths, testing, performance impact, and known validation gaps. However, it does not follow the required template and omits the required linked issue, visual-proof statement, checklist confirmations, AI disclosure, and review sections.
Resolution
Add the required template sections. Include an actual issue link under “Linked Issue” using “Fixes #<number>” or explain the maintainer exception. Add N/A with a reason under “Visual Proof” if there is no UI or interaction change. Complete the Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections, including the required test-status confirmations and any remaining validation limitations.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
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.
[Medium impact] The changes appear safe to merge; no actionable new issues were found.
Summary
Combines sidebar PR fields and stack summaries into one GitHub.com query.
Sidebar lookups fetch pull request details and stack data together.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Sidebar PR lookup] --> B{GitHub.com?}
B -->|Yes| C[Combined PR and stack query]
B -->|No| D[Existing rich CLI lookup]
C --> E{Response}
E -->|Usable| F[Read remaining checks]
E -->|Unusable success| D
E -->|Request failure| G[Existing REST recovery]
E -->|Scoped NOT_FOUND| H[Return no PR]
F --> I[Hydrate PR capabilities]
I --> J{Stack summary complete?}
J -->|Yes| K[Existing stack-detail hydration]
J -->|No| L[Existing stack-summary reader]
L --> K
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An exact or fallback-number GitHub.com branch lookup currently reads rich PR fields and then probes REST for stack membership. Read the PR fields and stack summary together so a complete response removes that extra probe, with no batching wait or change to refresh cadence or TTLs.
lookupPRByNumberopt into the combined query. These serve sidebar refreshes and other existing branch-lookup consumers. Merge preflight, Enterprise, unresolved hosts and branch-discovery hydration retain their existing paths. Use the existing executor and caller account, environment, WSL and remote execution options; no IPC change.Validation:
pnpm check:changed --maxWorkers=2: 19/20 checks passed. The broad affected-test phase was stopped after 718 seconds without completing; the eight focused suites passed separately. Full CI passed on exact head2b095713c6c2d465c10b25b3c244a63a6137770e(40765734859), including all five unit shards, relay integration and Linux/Windows packaging. No full local pass is claimed. Commit hooks passed formatting, lint and structural checks. Independent Claude review found no actionable regressions and passed the 76 scope/safety tests plus all 28 detail-context tests in the related PR.Live positive-stack and native Windows/WSL/SSH transport checks were not run; stack mapping and execution-option preservation are covered by focused tests.
The skipped REST stack-summary probe no longer warms its ETag for a later merge. That first merge-time REST read can therefore cost one core point that a prior refresh might have saved via 304.