fix(bitbucket): honor repository in pull request URLs#23442

closed1
main
GitHub fork: fix/bitbucket-pr-url-repository
opened9d agobyYyashranaway
View on GitHubTwo-way sync enabledPR last imported 1d ago

Opening a Bitbucket PR URL from another repository uses the checkout's repository instead, which can select the wrong PR with the same number. Honor the repository in the URL and only reuse a checkout remote when it matches the PR source.

Regressions fail before the fix for lookup and checkout, with and without an explicit remote context. All 24 API tests pass, including number-only and fork checkout behavior. Targeted lint, package typecheck, and server typecheck pass. API responses and Git operations were tested through fixtures.

Checks

24 successful · 12 skipped
All checks passed
0742d1e

Added 1 commit

  • fix(bitbucket): honor repository in pull request URLs0742d1e
Synced from GitHub

Warning

Review limit reached

Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 3b95e7831b11b17627dff16843bc087bfca397ec and 0742d1e1936b504b883d4f02ed6495ae9ce3dd33.

📒 Files selected for processing: 2
  • apps/server/src/sourceControl/BitbucketApi.test.ts
  • packages/source-control-bitbucket/src/server/BitbucketApi.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Synced from GitHub

Approvability

Verdict: Approved at 0742d1e

Macroscope's review found this PR approvable — This is a narrowly scoped Bitbucket bug fix that honors the repository encoded in pull-request URLs and prevents mismatched checkout remotes from being reused. Regression tests cover URL lookup, fork checkout, context handling, and the existing number-only path.

You can add or adjust custom eligibility rules. Learn more.