Bitbucket - Add Bitbucket Integration#4218
Conversation
| const onlyAvailableRepo = | ||
| !isLoadingGitHubRepos && | ||
| !isLoadingGitLabRepos && | ||
| (organizationId || !isLoadingBitbucketRepos) && |
There was a problem hiding this comment.
WARNING: Repository auto-selection can race Bitbucket loading
For personal sessions this effect still runs while the Bitbucket query is loading, and for organization sessions organizationId || !isLoadingBitbucketRepos explicitly treats the repository set as complete before Bitbucket finishes. Because getPreferredInitialRepo() still only tracks GitHub/GitLab loading, a saved or recent GitHub/GitLab repo can be auto-selected here and prevent the user’s Bitbucket repo from ever being chosen automatically.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| CREATE UNIQUE INDEX "UQ_platform_oauth_credentials_platform_integration_id" ON "platform_oauth_credentials" USING btree ("platform_integration_id");--> statement-breakpoint | ||
| CREATE INDEX "IDX_platform_oauth_credentials_platform_subject" ON "platform_oauth_credentials" USING btree ("platform","provider_subject_id");--> statement-breakpoint | ||
| CREATE INDEX "IDX_platform_oauth_credentials_authorized_by_user_id" ON "platform_oauth_credentials" USING btree ("authorized_by_user_id");--> statement-breakpoint | ||
| CREATE UNIQUE INDEX "UQ_platform_integrations_user_bitbucket" ON "platform_integrations" USING btree ("owned_by_user_id","platform") WHERE "platform_integrations"."platform" = 'bitbucket' AND "platform_integrations"."owned_by_user_id" IS NOT NULL;--> statement-breakpoint |
There was a problem hiding this comment.
WARNING: Non-concurrent index creation can block writes on deploy
platform_integrations is an existing populated table, so these two CREATE UNIQUE INDEX statements will take a write-blocking lock while the migration runs. In production that can stall integration updates and other writes; this needs a concurrent rollout strategy instead of plain index creation.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
Files Reviewed (136 files)
Previous Review Summaries (3 snapshots, latest commit d876fd8)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d876fd8)Status: 2 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
Files Reviewed (136 files)
Previous review (commit eb72ecd)Status: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous review (commit 95af145)Status: 2 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
Files Reviewed (103 files)
Reviewed by gpt-5.4-20260305 · Input: 420.5K · Output: 28.5K · Cached: 2.4M Review guidance: REVIEW.md from base branch |
Includes Bitbucket OAuth setup, repository selection support, token-service integration, worker secret handling, and organization Workspace Access Token authorization.
| const onlyAvailableRepo = | ||
| !isLoadingGitHubRepos && | ||
| !isLoadingGitLabRepos && | ||
| (!organizationId || !isLoadingBitbucketRepos) && |
There was a problem hiding this comment.
WARNING: Repository auto-selection can still beat Bitbucket loading
This effect now waits for Bitbucket before using the single-repo fallback, but getPreferredInitialRepo() still only tracks GitHub/GitLab loading. When a saved or recent GitHub/GitLab repo is already in unifiedRepositories, it can be auto-selected before Bitbucket finishes loading and prevent the intended Bitbucket repo from ever being chosen automatically.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| import { BitbucketLogo } from '@/components/auth/BitbucketLogo'; | ||
|
|
||
| export type RepositoryPlatform = 'github' | 'gitlab'; | ||
| export type RepositoryPlatform = 'github' | 'gitlab' | 'bitbucket'; |
There was a problem hiding this comment.
WARNING: Saved Bitbucket repo preference is discarded on reload
Now that RepositoryPlatform includes bitbucket, setLastUsedRepo() can persist platform: "bitbucket" for org sessions, but parseLastUsedRepo() in model-preferences.ts still only accepts GitHub and GitLab. Reloading the panel drops the saved Bitbucket repo, so the new provider never benefits from last-used repo auto-selection.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| CREATE UNIQUE INDEX "UQ_platform_oauth_credentials_platform_integration_id" ON "platform_oauth_credentials" USING btree ("platform_integration_id");--> statement-breakpoint | ||
| CREATE INDEX "IDX_platform_oauth_credentials_platform_subject" ON "platform_oauth_credentials" USING btree ("platform","provider_subject_id");--> statement-breakpoint | ||
| CREATE INDEX "IDX_platform_oauth_credentials_authorized_by_user_id" ON "platform_oauth_credentials" USING btree ("authorized_by_user_id");--> statement-breakpoint | ||
| CREATE UNIQUE INDEX "UQ_platform_integrations_user_bitbucket" ON "platform_integrations" USING btree ("owned_by_user_id","platform") WHERE "platform_integrations"."platform" = 'bitbucket' AND "platform_integrations"."owned_by_user_id" IS NOT NULL;--> statement-breakpoint |
There was a problem hiding this comment.
WARNING: Non-concurrent unique indexes can block writes on deploy
platform_integrations is an existing populated table, so these CREATE UNIQUE INDEX statements will take write-blocking locks while the migration runs. In production that can stall integration updates and other writes; this needs a concurrent rollout strategy instead of plain index creation.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Summary
git-token-service, with live owner authorization checks and purpose-bound internal tokens.Verification