Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves Bitbucket hosted-review behavior by persisting newly created PR numbers into worktree metadata, using them for immediate refresh, and prioritizing explicit PR-by-number fetches to avoid transient branch-index failures hiding the created review.
Changes:
- Persist and re-use created hosted-review numbers (including Bitbucket) across both creation surfaces (SourceControl + ChecksPanel) via a shared link resolver.
- Update Bitbucket client lookup to fetch explicitly linked PRs by number before consulting the branch index; add regression coverage for branch-index 503.
- Replace temporary Bitbucket localization keys with generated IDs and add forge-provider delegation coverage for Bitbucket creation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/i18n/locales/en.json | Replaces temporary Bitbucket integration strings with generated localization IDs. |
| src/renderer/src/components/settings/integrations-search.ts | Updates integration-search entries to reference the new generated localization IDs. |
| src/renderer/src/components/right-sidebar/SourceControl.tsx | Persists created hosted-review link metadata via shared resolver and uses it for refresh lookup. |
| src/renderer/src/components/right-sidebar/source-control-created-review-link.ts | Adds shared mapping from provider+number to worktree metadata + lookup overrides. |
| src/renderer/src/components/right-sidebar/source-control-created-review-link.test.ts | Adds unit tests covering provider-to-link mapping behavior. |
| src/renderer/src/components/right-sidebar/ChecksPanel.tsx | Mirrors SourceControl behavior for persisting/using created hosted-review links. |
| src/main/source-control/forge-provider.test.ts | Adds test ensuring Bitbucket review creation routes through the shared provider contract. |
| src/main/bitbucket/client.ts | Fetches explicitly linked Bitbucket PR by number before branch index (to avoid transient index failures). |
| src/main/bitbucket/client.test.ts | Adds regression test for explicit PR fetch succeeding when branch index returns 503. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (typeof linkedPRNumber === 'number') { | ||
| const raw = await requestJson<RawBitbucketPullRequest>( | ||
| `/repositories/${encodedRepoPath(repo)}/pullrequests/${encodeURIComponent(String(linkedPRNumber))}`, | ||
| {}, | ||
| throwOnFailure | ||
| ) | ||
| if (raw) { | ||
| return normalizePullRequest(repo, raw) | ||
| } | ||
| } |
|
Merged — thanks, this is good work and it caught a real bug I'd left behind.
You're right, and the linking gap was mine: I wired up creation but never added the Fetching the linked PR by number before the branch index is also the right call. The index is eventually consistent, so a freshly created PR could take a moment to show up there, and Verified on my side before merging: lint, both typechecks, and 7444 tests pass. |
Summary
Regression covered
Immediately after creation, Bitbucket's branch-index endpoint can fail or lag while
GET /pullrequests/{id}already succeeds. The new client test makes the branch index return HTTP 503 and verifies the explicitly linked PR is returned without consulting the index. The shared link-mapping test covers Bitbucket persistence in both renderer callbacks.Verification
Commits are intentionally separated by concern so they can be reviewed or cherry-picked independently.