Skip to content

Combine exact PR fields and stack summary queries - #35295

Merged
OrcaWin merged 3 commits into
mainfrom
OrcaWin/github-sidebar-query
Oct 29, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
OrcaWin/github-sidebar-query

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.
  • Live query against PR fix(github): count gh pr and issue commands against the GraphQL rate limit #28778: cost 1, no GraphQL errors, and all 38 check states match the rich CLI output.
  • 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.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 33758962-ee2f-4ed9-b881-65df7b46a5c7
Commits

Reviewing files that changed from the base of the PR and between be7a6ee and 2b09571.

Files selected for processing: 5
  • src/main/github/client-stack-merge-guard.test.ts
  • src/main/github/client/lookup/pr-number-lookup.ts
  • src/main/github/client/lookup/pull-request-sidebar-query.ts
  • src/main/github/default-branch-stale-pr.test.ts
  • src/main/github/pull-request-sidebar-query.test.ts

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: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning 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 Warning 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 Passed checks: 3 passed
Check name Status Explanation
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.
Title check Passed 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.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[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
Loading

Reviews (2) · Last reviewed commit: "Keep combined sidebar queries out of mer..." · Reviewed by Greptile

@OrcaWin OrcaWin changed the title Combine sidebar PR and stack summary queries Combine exact PR fields and stack summary queries Oct 28, 2026
@OrcaWin
OrcaWin merged commit ed7fe7d into main Oct 29, 2026
35 checks passed
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