Skip to content

refactor(pull-requests): move the last PR callers off the host's gh - #8771

Merged
saddlepaddle merged 2 commits into
mainfrom
superset/pr-cleanup-host-callers
Oct 28, 2026
Merged

saddlepaddle merged 2 commits into
mainfrom
superset/pr-cleanup-host-callers

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Step 1 of the PR-pane cleanup. Stacked on #8765.

Summary

Moves the last direct callers of the host procedures #8765 deprecated onto the viewer's API path:

  • ChangesControl → PRStatusGroup (desktop tab-bar PR badge): merge and mark ready use mergePullRequest / setPullRequestDraft from pullRequestClient, in place of host github.mergePR / github.markPullRequestReady. The host's refreshByWorkspaces sync after a write stays; that's the host's own state, not GitHub auth.
  • New-workspace prompt context (fetchPrBody): reads the linked PR's body with readPullRequestContent, keyed by the PR's URL, in place of host pullRequests.getContent.
  • Mobile per-row diffstat (usePullRequestDiffstat): integration.github.getPullRequestDetail (without activity) in place of host github.getPR. This drops the host URL plumbing from PullRequestsSheet / RowDiffstat.

After this, the only callers of the deprecated host PR procedures are the desktop pullRequestClient fallbacks, which step 4 removes.

Behaviour note: in a session workspace (no project) with no GitHub connection, merge from the badge now fails with the "Connect GitHub" error. It used to merge through the host's gh.

Test plan

  • desktop: tests for the prompt context, lib/github and ChangesControl pass; tsc clean in touched files
  • mobile: bun test 233/233; tsc clean in touched files
  • In the app: merge and mark ready from the tab-bar badge are attributed to the viewer; the PR list sheet shows diffstats with the host offline

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 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.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ❌ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes stay within pull-request workflows on desktop and mobile.

The PR appears safe to merge, with a non-blocking concern about unused data fetched for mobile PR counts.

Findings

  1. P2 PR rows fetch unused conversations ▶
Fix with agent prompt
### Issue 1
apps/mobile/screens/(authenticated)/workspace/[id]/hooks/usePullRequestDiffstat/usePullRequestDiffstat.ts:32-38
`usePullRequestDiffstat` now loads the whole PR conversation to read two counts. `getPullRequestContent` also requests up to 100 comments, reviews, commits, and check results. Opening `PullRequestsSheet` can run this request for 20 rows, then discard everything except `additions` and `deletions`.

Use a small viewer-authenticated read for these counts so opening the list does not download every PR's conversation.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Moves the remaining direct PR callers to the viewer API:

  • The desktop PR badge sends merge and ready actions through the viewer’s pull-request client.
  • New-workspace prompts read linked PR bodies through the shared pull-request reader.
  • Mobile pull-request rows fetch diffstats through the viewer’s GitHub API path.

One non-blocking concern: mobile rows now fetch full PR conversations for two counts.

Acknowledged behavior: saddlepaddle states that badge merges in session workspaces without a project or GitHub connection now fail with the “Connect GitHub” error. This is intentional and is not an outstanding finding.

Reviews (1) · Last reviewed commit: "refactor(pull-requests): move the last P..." · Reviewed by Greptile

Comment on lines +32 to +38
const pr = await apiClient.integration.github.getPullRequestContent.query(
{
organizationId,
repoFullName: `${pullRequest.repoOwner}/${pullRequest.repoName}`,
number: pullRequest.prNumber,
},
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 PR rows fetch unused conversations

usePullRequestDiffstat now loads the whole PR conversation to read two counts. getPullRequestContent also requests up to 100 comments, reviews, commits, and check results. Opening PullRequestsSheet can run this request for 20 rows, then discard everything except additions and deletions.

Use a small viewer-authenticated read for these counts so opening the list does not download every PR's conversation.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/mobile/screens/(authenticated)/workspace/[id]/hooks/usePullRequestDiffstat/usePullRequestDiffstat.ts
Line: 32-38

Comment:
**PR rows fetch unused conversations**

`usePullRequestDiffstat` now loads the whole PR conversation to read two counts. `getPullRequestContent` also requests up to 100 comments, reviews, commits, and check results. Opening `PullRequestsSheet` can run this request for 20 rows, then discard everything except `additions` and `deletions`.

Use a small viewer-authenticated read for these counts so opening the list does not download every PR's conversation.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@saddlepaddle
saddlepaddle force-pushed the superset/cloud-workspace-cb1e5373 branch from ee04810 to ec2ed7c Compare October 27, 2026 22:26
@saddlepaddle
saddlepaddle force-pushed the superset/pr-cleanup-host-callers branch from 134d32f to 318a285 Compare October 27, 2026 22:26
@saddlepaddle
saddlepaddle force-pushed the superset/pr-cleanup-host-callers branch from 318a285 to 23d82f5 Compare October 28, 2026 01:12
@saddlepaddle
saddlepaddle force-pushed the superset/pr-cleanup-host-callers branch from 23d82f5 to a300d30 Compare October 28, 2026 02:51
@saddlepaddle
saddlepaddle force-pushed the superset/pr-cleanup-host-callers branch from a300d30 to 487740d Compare October 28, 2026 02:57
ChangesControl's merge and mark-ready, the new-workspace prompt's PR body,
and mobile's per-row diffstat go through the API as the viewer. Only the
PR pane's fallback still calls the deprecated host procedures.
@saddlepaddle
saddlepaddle force-pushed the superset/pr-cleanup-host-callers branch from 487740d to bc4cdb3 Compare October 28, 2026 03:13
@saddlepaddle
saddlepaddle changed the base branch from superset/cloud-workspace-cb1e5373 to main October 28, 2026 03:13
@saddlepaddle
saddlepaddle merged commit 57c933e into main Oct 28, 2026
11 checks passed

This branch was previously deployed

1 inactive deployment
preview — bc4cdb3b Deployed Oct 28, 2026 by saddlepaddle via Deploy Docs #13025
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