fix(bitbucket): render private images in pull request descriptions #28596
main fromrefs/pull/28596/head·opened View on GitHubProblem#
Private Bitbucket Cloud images in pull request descriptions and comments fail to load even when the saved account can read the repository. The renderer requests them without a Bitbucket browser session.
Reproduce by embedding a private repository's Downloads or raw/src image URL in a PR description, then opening Summary → Description in T3 Code. The image should render through the server's existing credentials.
Fixes https://git.cafe/pingdotgg/t3code/issues/19828.
Change#
- Recognize Bitbucket Cloud Downloads and repository file URLs, and map web links to the API endpoints that accept tokens.
- Connect Bitbucket to the existing signed media driver API, using saved credentials or the existing environment fallback.
- Keep credentials on the configured API origin. Follow bounded HTTPS redirects to signed storage without forwarding the token, and preserve range requests and streamed bytes.
- Bound response-header waits with the existing API timeout while allowing the media body to stream afterward.
The fix stays in the Bitbucket package. Contracts, UI components, and GitHub handling remain unchanged.
Scope and approval#
This addresses the existing Bitbucket image-loading defect documented in https://git.cafe/pingdotgg/t3code/issues/19828 and its maintainer source triage. Credential handling still needs maintainer review; this does not claim prior implementation approval.
Related: https://git.cafe/pingdotgg/t3code/pulls/19853 covers private Downloads. This independent implementation covers repository images through raw/src links as well as Downloads and uses the current source-control driver API.
Verification#
- Added regression cases failed on unmodified main before the implementation.
- 91 focused tests passed: URL recognition, filename handling, current saved credentials, byte streaming, range forwarding, credential-free storage redirects, unsafe targets, redirect limits, response-header timeout, and existing registry/asset behavior.
- Bitbucket package type checking, targeted lint, formatting, and commit-hook checks passed.
- Manually confirmed private images rendering in a local macOS fork build. The screenshot below comes from that check; identifying content is blurred. The current-main driver port uses the production Bitbucket service with a fake HTTP transport in tests. Live-account rendering of this port and native mobile clients were not rechecked.
Focused test command:
vp test run \
packages/source-control-bitbucket/src/shared/definition.test.ts \
packages/source-control-bitbucket/src/server/BitbucketApi.test.ts \
apps/server/src/sourceControl/sourceControlDefinitions.test.ts \
apps/server/src/assets/AssetAccess.test.ts
Screenshot#
| State | Before | After |
|---|---|---|
| Private Bitbucket image in a PR description | Not captured; reproduction and failure are documented in https://git.cafe/pingdotgg/t3code/issues/19828. | ![]() |
Implemented with GPT-6.1-Sol using the Codex harness in T3 Code.
Fixes pingdotgg/t3code#19828
- 1
- 2
- 3
Pushedc5ff47a
github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase
Sign in to join this conversation.
