feat(pull-requests): copy provider checkout commands - #9086
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new provider-aware checkout-command copy control to the production pull-request detail UI and threads optional Bitbucket source-repository data through the server and contract layers. The implementation is contained and backward-compatible, but the automatically exposed user-facing capability warrants human review. You can add or adjust custom eligibility rules. Learn more. |
Dismissing prior approval to re-evaluate 0e3c884
Dismissing prior approval to re-evaluate c207ed8
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4327f9d. Configure here.

Adds a visible, one-click checkout command in the pull request branch metadata line while keeping the branch control dedicated to copying the branch name.
The command matches the pull request provider:
gh pr checkout <number>glab mr checkout <number>az repos pr checkout --id <number>t3code-pr-<number>Verified with the focused pull request suites (85 web and 31 server tests), targeted typechecks, lint, and the live web client. Built by
gpt-5.6-solin the Codex harness.screenshots
the checkout command sits in the existing branch metadata line. clicking it copies the full command.
Note
Low Risk
Additive UI and optional API field; Bitbucket commands are gated by regex validation and omit the button when inputs are invalid rather than surfacing unsafe shell text.
Overview
Adds a copyable checkout command under the branch row in the pull request detail panel, separate from copying the branch name alone.
pullRequestCheckoutCommandbuilds host-specific CLI text:gh pr checkout,glab mr checkout,az repos pr checkout --id, and for Bitbucket agit clone --single-branchintot3code-pr-<number>. Bitbucket needs the fork’sowner/repo, so the API path now parsessource.repository.full_name, threadsheadRepositoryNameWithOwnerthrough contracts, the Bitbucket provider, andPullRequestService.detail, and only emits a Bitbucket command when repo and branch pass shell-safe validation—otherwise the control is hidden.Copy uses a dedicated clipboard hook with success/error toasts; unit tests cover decoding and per-provider command strings.
Reviewed by Cursor Bugbot for commit e677f92. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add provider-specific checkout command copy button to pull-request detail panel
pullRequestCheckoutCommandin pullRequestDetail.logic.ts to build CLI checkout commands for GitHub, GitLab, and Azure DevOps. Bitbucket requires a validated source repository owner/name and shell-safe head branch before generating a clone command; unknown providers return null.headRepositoryOwnerNamefield through the full stack: Bitbucket raw JSON decoding in bitbucketPullRequestJson.ts, theProviderChangeRequestinterface in PullRequestProvider.ts, the service factory in PullRequestService.ts, and thePullRequestDetailcontract in pullRequest.ts.headRepositoryOwnerNamematches the allowed repository pattern and the head branch matches a shell-safe argument pattern; invalid or incomplete inputs return null and no button is shown.Macroscope summarized e677f92.