Skip to content

feat(web): surface pull request deployments with one-click preview links - #8261

Closed
vitalyiegorov wants to merge 1 commit into
pingdotgg:mainfrom
vitalyiegorov:feat/pr-pane-deployments
Closed

vitalyiegorov wants to merge 1 commit into
pingdotgg:mainfrom
vitalyiegorov:feat/pr-pane-deployments

Conversation

@vitalyiegorov

@vitalyiegorov vitalyiegorov commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What Changed

When a pull request has deployments (for example Vercel preview environments on GitHub), the review now shows them as first-class data instead of generic check rows:

  • The Summary tab gains a Deployments section — one row per environment with its state (Live / Deploying / Failed / Inactive); clicking a row opens the environment.
  • The pane header gains a compact globe Open preview button: with one live environment it opens directly, with several it opens a menu naming each environment, newest first.
  • Server side, a new read against GitHub's Deployments GraphQL API (head commit, latest deployment per environment) feeds an optional deployments field on PullRequestDetail. GitHub only; other hosts leave the field absent, following the updateMethods/reactions pattern. The read goes through the existing GraphQL budget and degrades to an absent field on failure, so it can never break the detail view. It rides the existing detail query — no new RPC, no extra polling.
  • A live deployment with no environment URL never falls back to its build log from the preview button; the log fallback applies only to non-successful deployments, where logs are what you want.
  • User docs: a short "See preview deployments" entry in the source control guide.

Proposed and discussed in #8258.

Why

The preview URL is the thing you usually want mid-review, and today it is buried: providers post it as a commit status, so it renders as an indistinguishable "Details" link among lint and test checks. This promotes deployments to a labeled section and a one-click affordance without new machinery — the data rides the existing detail read, refresh, and cache.

UI Changes

Before — the Vercel preview is two generic "Passed" rows inside Checks:

PR pane Summary tab before: Vercel appears only as generic check rows

After — a Deployments section names the environment and its state:

PR pane Summary tab after: Deployments section with a Preview environment marked Live

Header "Open preview" button with tooltip:

PR pane header with the Open preview globe button and its tooltip

Multiple environments become a menu (real data: vercel/commerce#1535):

Header globe button open, showing a menu with two preview environments

Verified end-to-end against live PRs: single environment opens the deployed preview directly; menu entries open their environment's URL.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes (no motion added; the icons deliberately avoid spinners per the no-repainting-animation rule)

Built with Claude Fable 5 in the Claude Code harness.

🤖 Generated with Claude Code


Note

Medium Risk
Every GitHub PR detail load gains an extra GraphQL read (budgeted, but raises parallel fan-out from 3 to 4), though deployment fetch failures are isolated from the rest of the detail response.

Overview
Adds optional preview deployment data to pull request detail so reviewers can open live environments without digging through generic check rows.

Contracts & API: Introduces PullRequestDeployment / PullRequestDeploymentStatus and an optional deployments field on PullRequestDetail (absent when the host does not report deployments or the read failed—not the same as an empty list).

GitHub server path: New getPullRequestDeployments GraphQL read (head commit, newest deployment per environment) with decoding that maps GitHub states, dedupes by environment, and picks environment URL vs build log (logs only for non-success previews). getChangeRequest loads deployments in parallel with the existing detail fetches (concurrency 3 → 4) and degrades with orElseSucceed(() => undefined) so failures never break the page.

UI: Summary tab Deployments section with status labels/icons and clickable URLs when present. Header globe opens the sole live preview directly or a menu when multiple environments have URLs.

Docs: Short “See preview deployments” note in the source-control guide. GitHub-only for now; other providers omit the field.

Reviewed by Cursor Bugbot for commit 1fdc0d7. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add pull request deployment preview links to PullRequestDetail

  • Adds PullRequestDeployment and PullRequestDeploymentStatus schemas to contracts, and an optional deployments array on PullRequestDetail (most recent first)
  • Server fetches deployments via a new GraphQL query in GitHubPullRequestCli; decodePullRequestDeploymentsJson normalizes the response, maps GitHub states to internal statuses, deduplicates by environment, and skips unnamed entries
  • GitHubPullRequestProvider.getChangeRequest includes deployments with orElseSucceed(() => undefined) so fetch failures never fail the page; concurrency in Effect.all raised from 3 to 4
  • Web UI shows a globe button in the detail header that opens the single live preview or a menu for multiple; the summary tab renders a Deployments section with status icons and clickable URLs
  • Risk: getChangeRequest concurrency increase from 3 to 4 in GitHubPullRequestProvider.ts may raise GitHub API rate pressure under high load
📊 Macroscope summarized 1fdc0d7. 10 files reviewed, 2 issues evaluated, 0 issues filtered, 2 comments posted

🗂️ Filtered Issues

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f30d34d5-734c-4bb9-885a-aed53e2bebfe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 26, 2026
commits(last: 1) {
nodes {
commit {
deployments(first: ${GRAPHQL_PAGE_SIZE}, orderBy: { field: CREATED_AT, direction: DESC }) {

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.

🟡 Medium pullRequest/gitHubPullRequestJson.ts:2006

A head commit with more than 100 deployments returns incomplete environment data: deployments after the first 100 are silently omitted, so environments whose newest deployment is on a later page disappear despite the decoder promising one row per environment. Add pageInfo handling and follow-up queries until all deployment pages are fetched.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/pullRequest/gitHubPullRequestJson.ts around line 2006:

A head commit with more than 100 deployments returns incomplete environment data: deployments after the first 100 are silently omitted, so environments whose newest deployment is on a later page disappear despite the decoder promising one row per environment. Add `pageInfo` handling and follow-up queries until all deployment pages are fetched.

Comment thread docs/user/source-control.md Outdated

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.

🟢 Low user/source-control.md:52

The globe button does not always open a menu when a deployment has several environments: openableDeployments filters to successful deployments with URLs, so one live, openable preview opens directly and none removes the globe control. Please document that the menu requires multiple live, openable previews.

Suggested change
- When there are several environments, the globe button opens a menu so you can pick which one to open
- When there are multiple live, openable environments, the globe button opens a menu; with one, it opens that preview directly, and with none, no globe control is shown
🤖 Copy this AI Prompt to have your agent fix this:
In file @docs/user/source-control.md around line 52:

The globe button does not always open a menu when a deployment has several environments: `openableDeployments` filters to successful deployments with URLs, so one live, openable preview opens directly and none removes the globe control. Please document that the menu requires multiple live, openable previews.

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit eaf33a027953d04ad7bde9349ebc8c58b6ae9068. Configure here.

environmentUrl ?? (status === "success" ? null : trimmed(node?.latestStatus?.logUrl));
latestByEnvironment.set(environment, { environment, status, url });
}
return Result.succeed([...latestByEnvironment.values()]);

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.

Redeploy hides live preview URL

Medium Severity

decodePullRequestDeploymentsJson keeps only the newest deployment per environment. When that newest row is failure or in-progress, an older success row for the same environment (often still serving a live preview) is dropped, so the header globe and Summary lose the working URL even though GitHub typically leaves the prior deployment active until a later success marks it inactive.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit eaf33a027953d04ad7bde9349ebc8c58b6ae9068. Configure here.

@macroscopeapp

macroscopeapp Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a substantial cross-layer capability that queries GitHub deployments on every PR detail read and exposes new preview-opening UI behavior. Unresolved concerns include incomplete pagination and potentially hiding still-live preview URLs during redeploys, so the runtime behavior needs human review.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

The PR pane buries provider preview links (Vercel and similar) inside the
Checks section as generic Details rows. This reads GitHub's Deployments API
for the head commit, adds an optional deployments field to the detail
contract, renders a Deployments section in the Summary tab, and puts an
Open preview button in the pane header: one live environment opens directly,
several open a menu.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vitalyiegorov
vitalyiegorov force-pushed the feat/pr-pane-deployments branch from eaf33a0 to 1fdc0d7 Compare August 26, 2026 15:40
@t3dotgg

t3dotgg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

We are not adding pull request deployment discovery and one-click preview links in this form. The provider authentication and deployment API support cost is too high for this narrow source control convenience.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotgg t3dotgg closed this Aug 28, 2026
@vitalyiegorov

Copy link
Copy Markdown
Contributor Author

Understood, and thanks for the clear reasoning — the cost/benefit call on provider deployment support makes sense, and it's more useful to hear it plainly than to have it linger. No follow-up needed on this one.

For anyone who finds this later: preview links already reach the pane today through statusCheckRollup.targetUrl, rendered as an ordinary check row, so nothing is lost by not landing this.

Discussion context, if it's ever worth revisiting: #8258

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants