Skip to content

Bitbucket connector - #289

Open
kiranfin wants to merge 10 commits into
devfrom
feature/287-bitbucket-connector
Open

kiranfin wants to merge 10 commits into
devfrom
feature/287-bitbucket-connector

Conversation

@kiranfin

@kiranfin kiranfin commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Related issue

Closes #287

Short summary

Adds the Bitbucket Cloud repository connector to the frontend so Bitbucket repositories can be discovered, connected, synced and browsed in the same way as GitHub repositories, across data ingestion, the create-project wizard, the knowledge base, the connector overview and the chat filter.

  • Service layer: new bitbucketService for the backend Bitbucket endpoints (connectBitbucketRepository / connectBitbucketRepositories via POST /api/v1/bitbucket and /connect/all, discoverBitbucketRepositories via GET /api/v1/bitbucket/discover/workspace/{workspace} with paging and hasMore, addBitbucketRepositoryToProject / removeBitbucketRepositoryFromProject, updateBitbucketRepository, updateAllBitbucketRepositories, getBitbucketRepositoryConfig / configureBitbucketRepository / configureAllBitbucketRepositories). The discover DTO is mapped defensively. bitbucketRepositoryInput parses workspace and workspace/slug input as well as bitbucket.org URLs. BITBUCKET is added to the source type unions, together with a BitbucketIcon and a wider IconComponent type so SOURCE_META, DrawerCard and ConnectorMeta accept non-lucide icons.
  • Data ingestion page: Bitbucket source cards are built from the per-repo status row alone (createBitbucketSourceFromInstance, BitbucketRepositoryDetails), show the workspace, and the run history filters by repositoryId with workspace/slug run labels. The source drawer gets a Bitbucket repository card with enable toggle (patchConnectorSources("bitbucket")), manual update, remove from project and a per-repo sync schedule. The global sync settings modal gets a Bitbucket tab.
  • Provider-neutral repository discovery: search, paging, multi-select and link-state handling moved out of GithubRepositoryDiscovery into a new RepositoryDiscovery driven by an adapter and a credential picker slot. GithubRepositoryDiscovery is now a thin wrapper with unchanged props. The already-ingested and in-project lookups filter by source system, so a Bitbucket repo never shows up as a linkable GitHub repo.
  • Add-source flow: new BitbucketRepositoryDiscovery with an Atlassian credential picker and a BitbucketDraftSource that either links an already-ingested repo or connects a new one. Wired into AddSourceFlow and AddSourceModal, Bitbucket drafts appear in the staged list and the review step.
  • Create-project wizard: CreateProjectWizard offers Bitbucket as a source type, stages Bitbucket drafts from the discovery selection and automatically selects a newly added inline Atlassian credential. Works alone and mixed with GitHub.
  • Knowledge base, connectors and chat: parseBitbucketMetadata makes the repository badge, repository facet and URL state work for Bitbucket as well as GitHub. Adds an "Open in Bitbucket" link badge and icon, reads /pull-requests/ links as pull requests and adds CONNECTOR_META.bitbucket. ChatPage maps bitbucket.org citations to BITBUCKET, and BITBUCKET is added to the chat SOURCE_SYSTEMS filter.
  • Smaller fixes: shows a helpful message instead of a bare 500 when connecting fails. Updates the Atlassian credential copy to mention Bitbucket next to Jira and Confluence.
  • Covered by unit + a11y tests (bitbucketService, bitbucketRepositoryInput, RepositoryDiscovery, BitbucketRepositoryDiscovery a11y, AddSourceModal, CreateProjectWizard + a11y, projectSourcesDraft, SourceDetailsPanel + a11y, SourceList, RunDetailsPanel, DataIngestionPage, data, githubMetadata, ArtifactFilters, ArtifactViewerDrawer, SourceLinkBadge, useKnowledgeBase, useKnowledgeBaseUrlState, connectorMeta, useAvailableSources) plus new MSW handlers for the Bitbucket endpoints.

Checks

  • I verified the code makes sense intuitively
  • The PR changes affect only this issue, no unrelated/unwanted code changes to other modules/code segments
  • CI runs (npm ci, npm run lint, npm run build)
  • New logic is unit tested (Vitest), including a11y tests for changed pages/components
  • The new functionality is tested manually

Additional notes

⚠️ Backend dependency: Merge the Bitbucket connector backend first Bitbucket Repository Connector Backend

  • requires the /api/v1/bitbucket/... endpoints (connect, discover, project link, update, config)
  • requires BITBUCKET in the per-repo ingestion status and run history

⚠️ Backend follow-up: Bitbucket connector fixes SprintStartProject/sprintstart-backend#271

  • allows BITBUCKET in the source_system DB check constraints (otherwise ingestion fails)
  • lists Bitbucket repositories in the knowledge base repository facet
  • returns 404 instead of 500 for a missing Bitbucket repository, and fixes the pull request sync and manual updates

⚠️ AI dependency: the chat source filter needs the AI change SprintStartProject/sprintstart-ai#214

  • BITBUCKET in the chat SOURCE_SYSTEMS is only accepted once the AI service knows the value, otherwise filtering by Bitbucket returns a 422

- Add bitbucketService and bitbucketRepositoryInput with tests, including defensive discover mapping and hasMore
- Add BitbucketIcon and a wider IconComponent type so SOURCE_META and DrawerCard accept non-lucide icons
- Add BITBUCKET to the source unions and Record maps, shown as "Soon" in the add-source grid
- Add BitbucketRepositoryDetails and createBitbucketSourceFromInstance, built from the status row alone
- Append Bitbucket cards on the data ingestion page, skip BITBUCKET project sources, filter runs by repositoryId
- Show the workspace on cards and in the run details, and extend run source labels for workspace/slug
- Add a Bitbucket repository card with enable toggle, update, remove from project and per-repo sync schedule to the source drawer
- Wire update, enable/disable via patchConnectorSources("bitbucket"), unlink and config load/save into DataIngestionPage
- Add a Bitbucket tab to the global sync settings modal, saved through configureAllBitbucketRepositories
- Move search, paging, multi-select and link-state handling into RepositoryDiscovery, driven by an adapter and a credential picker slot
- Filter the already-ingested and in-project lookups by source system so a Bitbucket repo never counts as a linkable GitHub repo
- Reduce GithubRepositoryDiscovery to a thin wrapper with the same props and re-exported types
- Add BitbucketRepositoryDiscovery with an Atlassian credential picker and BitbucketDraftSource with link-or-connect dispatch
- Wire the Bitbucket detail into AddSourceFlow and AddSourceModal and make Bitbucket a connectable type
- Show Bitbucket drafts in the staged list and review step, and explain a bare 500 on connect
- Make BITBUCKET an available source type in CreateProjectWizard and pass the Bitbucket detail bundle to AddSourceFlow
- Stage Bitbucket drafts from the discovery selection with an inline Atlassian credential that is selected automatically
- Cover Bitbucket alone, mixed with GitHub, linking and the inline credential in the wizard and a11y tests
- Add a Bitbucket metadata parser and make the repository badge, facet and URL state work for Bitbucket as well as GitHub
- Add the Bitbucket link badge, icon, connector meta and Atlassian copy, and read /pull-requests/ links as markdown
- Recognize bitbucket.org citations in the chat page and offer Bitbucket in the chat source filter
@kiranfin
kiranfin marked this pull request as draft October 1, 2026 12:27
…t connector UI

- Render Bitbucket workspace profiles in the artifact drawer instead of the unavailable org fallback
- Lowercase parsed Bitbucket coordinates and only append the slug when it differs from the display name
- Correct the auto update off copy for Bitbucket and the outdated 500 comments
- Bring in the latest dev changes, including the warning before moving users between projects
- Resolve the conflict in the CreateProjectWizard a11y tests by keeping both the Bitbucket and the moved-member tests
@kiranfin kiranfin linked an issue Oct 1, 2026 that may be closed by this pull request
2 tasks
@kiranfin
kiranfin marked this pull request as ready for review October 1, 2026 13:02
Comment thread src/features/data-ingestion/components/RepositoryDiscovery.tsx Outdated
Comment thread src/services/sources/bitbucketRepositoryInput.ts
…ry from Bitbucket input

- Load more continues with the owner and credential that produced the results, a credential change resets results and selection, and the form is locked while a page loads
- Drop query string and fragment before splitting Bitbucket URLs so the slug stays clean
- Add tests for pagination binding, credential reset, locking and URL suffixes
@kiranfin
kiranfin requested a review from Afif-del October 1, 2026 19:36
@kiranfin
kiranfin added this pull request to stack #292 October 2, 2026 09:52
@kiranfin
kiranfin removed this pull request from stack #292 October 3, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: BitBucket connector frontend

2 participants