feat(integrations): add Bitbucket Cloud - #6860
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview The surface area is 30 registered tools (workspaces through pipeline step logs), a workflow block with operation-specific fields, cascading workspace/repository pickers, and server routes that authorize credentials, refresh tokens, and call Bitbucket with strict API cursor validation (host/path/workspace binding, no redirects) plus bounded JSON and raw reads. OAuth is wired end-to-end: consumer config env vars, connector registration (basic-auth token exchange), self-hosted docs with required consumer permissions, connect-modal scope text keyed by provider, and catalog/docs/icons for the integration page. Supporting tests cover block↔tool mapping, selector hooks, and repository/workspace API routes (auth order, malformed provider responses, cursor rejection). Reviewed by Cursor Bugbot for commit f5cf56c. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryAdds a complete Bitbucket Cloud OAuth integration for repository, source, pull-request, and pipeline workflows.
Confidence Score: 5/5The PR appears safe to merge because no concrete blocking or independently actionable non-blocking defect was established in the changed paths. The OAuth lifecycle, selector authorization, tool registry alignment, block parameter mapping, bounded reads, cursor validation, and normalized response handling form consistent end-to-end paths, and the investigated edge cases lacked a reachable contradictory provider or caller condition.
|
| Filename | Overview |
|---|---|
| apps/sim/tools/bitbucket/utils.server.ts | Adds DNS-pinned, bounded, retry-aware reads and validated pull-request redirect resolution; no actionable defect was established. |
| apps/sim/tools/bitbucket/utils.ts | Centralizes request validation, cursor binding, response normalization, and bounded UTF-8 processing for the integration. |
| apps/sim/blocks/blocks/bitbucket.ts | Defines the 30-action block UI and maps editor values to registered tool parameters consistently. |
| apps/sim/lib/auth/connectors/providers.ts | Adds the Bitbucket connector authorization-code exchange and synthetic connector identity mapping. |
| apps/sim/lib/oauth/oauth.ts | Registers Bitbucket scopes and refresh-token configuration using Basic authentication and rotating-token persistence. |
| apps/sim/app/api/tools/bitbucket/workspaces/route.ts | Adds an authenticated, credential-authorized, bounded workspace selector endpoint with strict cursor validation. |
| apps/sim/app/api/tools/bitbucket/repositories/route.ts | Adds an authenticated repository selector bound to the selected workspace and validated provider pagination. |
| apps/sim/tools/registry.ts | Registers all new Bitbucket tool IDs referenced by the block. |
Sequence Diagram
sequenceDiagram
participant User as Workflow user
participant Block as Bitbucket block
participant Exec as Generic executor
participant OAuth as OAuth credential service
participant Tool as Bitbucket tool
participant BB as Bitbucket Cloud
User->>Block: Configure action and repository
Block->>Exec: Tool ID and normalized parameters
Exec->>OAuth: Resolve credential and refresh token if needed
OAuth-->>Exec: Access token
Exec->>Tool: Execute selected operation
Tool->>BB: Authenticated API request
BB-->>Tool: JSON, redirect, or bounded raw response
Tool-->>Exec: Normalized output
Exec-->>User: Workflow result
Reviews (1): Last reviewed commit: "feat(integrations): add Bitbucket Cloud" | Re-trigger Greptile
c80ee96 to
e74c06c
Compare
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 e74c06c. Configure here.

Summary
Adds a complete Bitbucket Cloud action integration with 30 OAuth-backed tools for repository/source inspection, pull request collaboration, and pipeline operations.
Includes:
No triggers or webhooks are included.
Type of Change
Testing
bunx vitest run app/api/tools/bitbucket hooks/selectors/providers/bitbucket blocks/blocks/bitbucket.test.ts tools/bitbucket— 323 tests passedbun run tool-metadata:checkbun run check:tool-registry-boundarybun run apps/sim/scripts/check-canvas-sentences.ts --block=bitbucket— 30/30 operationsbun run check:bare-iconsbun run integration-catalog:checkbun run docs:checkbun run check:api-validationbun run type-checkgit diff --checkReviewer focus:
Known follow-ups intentionally outside this PR:
typediscriminator needs a disposable live-provider probe before adding an undocumented value.Checklist
Screenshots/Videos
Not applicable; no standalone visual workflow changes.