fix(bitbucket): checkouts cloned from ssh.bitbucket.org match their pull requests #42330
Mergedadrhumphreys-atlas(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/42330/headmerged by juliusmarminge View on GitHubtanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- @@ -131,3 +143,5 @@131143 : hostname.split(".").includes("bitbucket")132144 ? { kind: KIND, name: "Bitbucket Self-Hosted", baseUrl: `https://${host}` }133145 : null,146+ repositoryKeyFromRemote,147+ canonicalRepositoryKey,
juliusmarminge added labelstakeover:in-progress
Pushed1d051a4
Pushed2bd41eb
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelstakeover:ready
juliusmarminge removed labelstakeover:in-progress
juliusmarminge merged this01962d4
juliusmarminge closed this
juliusmarminge removed labelstakeover:ready
Sign in to join this conversation.


No actionable comments were generated in the recent review.
Walkthrough
The Bitbucket provider maps recognized Cloud SSH repository keys to
bitbucket.orgkeys and removes trailing.gitfrom remote-derived keys. It canonicalizes saved identities before repository and host change-request checks. Tests cover Cloud URL variants, matching, and self-hosted keys.Changes: Bitbucket repository key matching
packages/source-control-bitbucket/src/shared/definition.ts,packages/source-control-bitbucket/src/shared/definition.test.tsssh.bitbucket.organdaltssh.bitbucket.orgkeys tobitbucket.org/workspace/repository, removes trailing.gitfrom remote-derived keys, and canonicalizes saved identities before matching. Tests cover Cloud URL variants, pull-request matching, and a self-hosted remote.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
ssh.bitbucket.orgremote keys fail to match Bitbucket pull requests. This change canonicalizes those keys; it does not cover the issue’sssh.github.comcase.Suggested reviewers:
juliusmarmingeMerge Risk:
Minimal · up to
2bd41Bitbucket Cloud projects cloned over ssh.bitbucket.org or altssh.bitbucket.org now resolve to bitbucket.org keys. Saved checkouts under those SSH hosts also match their pull requests. Self-hosted Bitbucket keys are unchanged. No merge-blocking risk remains.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the bug area (Bitbucket checkouts cloned from ssh.bitbucket.org) and the fix (matching their pull requests). The changeset maps ssh.bitbucket.org and altssh.bitbucket.org remotes to the bitbucket.org repository key, which is the main change. The title is concise, specific, and follows the conventional commit form.
Full details: Description check
Explanation
The description follows the template well. It states the problem (SSH moved to ssh.bitbucket.org, so keys and pull requests did not match, producing 'no longer has a checkout'). It explains the change (repositoryKeyFromRemote and canonicalRepositoryKey, canonicalization of saved keys, self-hosted keys unchanged). It describes verification (tests for SCP-style, ssh://...:443, and HTTPS remotes, with the SSH-host cases failing without the fix) and gives a reference to the Atlassian announcement. Gaps: the Scope section does not link a bug issue or explain why no issue exists, and the Verification section does not state what could not be checked. The template also asks for a conventional commit title, which the title meets. The description lacks the explicit issue link the Scope section requires, but the other sections are substantive, so the check passes.
Finishing Touches
Generate unit tests (beta)
032be042-faf5-467c-8114-b9770ae83514Reviewing files that changed from the base of the PR and between 1d051a401a75e9dde8e5ea720ee7bf2e71506b07 and 2bd41eb11c91a04ee315bfbdf683e304932164ee.
packages/source-control-bitbucket/src/shared/definition.test.tspackages/source-control-bitbucket/src/shared/definition.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.