Feature/269 confluence connector - #185
Conversation
…page artifacts - Extend ArtifactType with PAGE and SourceSystem with CONFLUENCE in knowledge-base types - Update shouldRenderAsMarkdown in ArtifactViewerDrawer to treat Confluence page artifacts as markdown documents - Enable Formatted / Source mode switching for Confluence page artifacts in ArtifactViewerDrawer - Add BookOpen icon mapping for PAGE artifacts in ArtifactList - Add unit tests verifying Confluence markdown rendering and Source view toggle
…ence-connector # Conflicts: # src/features/knowledge-base/components/ArtifactList.tsx # src/features/knowledge-base/types.ts
…ture/269-confluence-connector
…into feature/269-confluence-connector
Bug fixes - Fix handleUpdateSource using source.sourceId (potentially a raw status-row ref string) instead of the actual connection UUID when triggering a Confluence sync from the source details drawer. Now resolves the connection ID via source.confluenceSpace.connectionId, which is always set from the ConfluenceConnectionDto on the matched connection. (issue #1) - Fix canUpdate guard in SourceDetailsPanel for Confluence sources. Previously used Boolean(source.sourceId) which is always truthy even when sourceId holds a non-UUID ref string, allowing the Update space button to fire and silently 404. Now checks confluence?.connectionId so the button is only enabled when a real connection is present. (issue #1) - Remove over-broad artifactType === 'PAGE' condition from shouldRenderAsMarkdown in ArtifactViewerDrawer. The sourceSystem check already handles all Confluence artifacts; the PAGE type alone would incorrectly force any future non-Confluence PAGE artifact into Markdown rendering. Added a regression test to guard against this. (issue #2) Logic fixes - Add baseUrl|spaceId composite format as the primary candidate in the run-matcher inside createConfluenceSourceFromConnection, matching the same format already used in the DataIngestionPage status-row lookup. Keeps spaceId/id/spaceKey fallbacks for backwards compatibility. (issue #4) - Fix run filter options and buildRunSourceLabels to use confluenceSpace.connectionId as the Confluence source reference key, consistent with the connection UUID the sync endpoint expects. (issue #5) - Populate nextSync from connection.nextSyncAt in both createConfluenceSourceFromInstance and createConfluenceSourceFromConnection instead of always returning 'Not available'. Falls back to 'Not scheduled' when no nextSyncAt is present. (issue #8) Refactor / polish - Replace the inline Confluence sync toast block in handleUpdateSource with a delegation to useConfluenceSync, unifying toast format (COMPLETED / PARTIAL / FAILED with per-page counts) across all sync entry points. Removes duplicate toast logic and aligns the drawer's Update space action with the connector table's Sync now action. (issue #9) - Add inputMode='numeric' and pattern='[0-9]+' to the Space ID input in both ConfluenceConnectStep variants (data-ingestion and connectors). Surfaces a numeric keyboard on mobile and provides native browser validation feedback before a server round-trip. (issue #10) - Add default MSW handlers for POST /confluence/projects/:id/connections and POST .../connections/:id/update to the global test handler list. Prevents unhandled request warnings in tests that incidentally trigger these endpoints. (issue #11) - Add a TODO comment in ConnectorSourcesSection documenting that the source.id passed to syncConnection must be verified to be the same UUID namespace as ConfluenceConnectionDto.id from the connections endpoint before the comment can be removed. (issue #6) Tests - Add negative regression test in ArtifactViewerDrawer.test.tsx: a PAGE artifact from a non-Confluence source system must not be rendered as Markdown (guards the issue #2 fix). All 302 unit tests and 60 a11y tests pass (npm run try exit 0).
…solution - update buildRunQuery in DataIngestionPage to pass repositoryId for Confluence connections so the backend queries by sourceInstanceId UUID - restrict sourceRef query param strictly to Jira instance URLs - register Confluence composite references, space keys, and connection IDs in buildRunSourceLabels so getRunSourceLabel displays friendly space names instead of raw composite strings - add repositoryId fallback matching to createConfluenceSourceFromConnection - add unit test coverage for Confluence run source label resolution and instance mapping
|
Draft, so no approval — but here's a pass over the Confluence work itself (I reviewed
1. The diff can't be reviewed in isolation
Retarget the PR base to 2. Three different "which run belongs to this space?" matchers, and they disagree
Two of those keys aren't unique. Worth settling with the backend: for a Confluence 3. The artifact count means two different things depending on which builder ran
4. Two components named
|
- add atlassianService.ts (/api/v1/atlassian/credentials) and drop the credential functions from jiraService.ts - rename the credential hook/components/access-registry entry from Jira to Atlassian - update all consumers (JiraConnectStep, AddSourceModal, CreateProjectWizard, AddSourceFlow) to the new imports and types
- add spaceName and credentialName to ConfluenceConnectionDto and ConfluenceSpaceSourceDetails - name Confluence source cards from spaceName, falling back to spaceKey then spaceId - show the credential name in the Confluence source details drawer
- replace email/apiToken with credentialName in the Confluence connect request, draft, and both connect forms - share one Atlassian credential list between the Jira and Confluence pickers in both source wizards - surface a dedicated message when a picked credential was deleted before connecting
…ource cards - add a base URL subtitle line to Confluence cards in SourceList, mirroring the Jira instance line - rename formatJiraInstanceDomain to formatInstanceDomain since it now serves Jira and Confluence - update the RunDetailsPanel call site to the new name
- Bring the buddy page fresh visit button and its tests over from dev - No conflicts, build and unit tests pass
- Drop the Confluence-only add and sync actions so the connector modal only toggles sources in and out of scope - Delete the now-unused connectors ConfluenceConnectStep and its test - Add remove-from-project for Confluence spaces via a new deleteConnection call
- Stop remapping a 404 on connect to a credential error, since the backend message already distinguishes unknown space from unknown credential - Reject a non-numeric Confluence space ID while staging instead of failing at provisioning time - Carry spaceName and credentialName onto Confluence sources built from a status row
Note
Merge & Review Sequence
devdevafter add GitHub organization metadata filtering #182 and Feature/minor upgrades #183.feature/easter-eggs-overhaul), which is designated to merge last.Summary
This PR implements end-to-end frontend support for the Confluence Cloud Connector (#269), enabling software teams to integrate Confluence Cloud spaces into the SprintStart knowledge platform, view ingested page artifacts in the Knowledge Base, and trigger manual synchronization.
🚀 Key Features & Architectural Changes
1. Confluence REST API Client (
src/services/sources/confluenceService.ts)confluenceServicecovering all endpoints on/api/v1/confluence/projects/{projectId}/connections:POST /connections- Create space connection with credentials & allow/denylistsGET /connections- List project-scoped connectionsGET /connections/{connectionId}- Get single connection detailsPOST /connections/{connectionId}/update- Synchronize space content (returnsConfluenceIngestionResult)PUT /connections/{connectionId}/schedule- Configure automatic synchronization scheduleCreateConfluenceConnectionRequest,ConfluenceConnectionDto,ConfluenceIngestionResult,ConfigureConfluenceScheduleRequest, andScheduleSpec.2. Connectors Settings (
src/features/connectors/)ConfluenceConnectStep.tsx: Form to configure base URL, numeric space ID, account email, and API token.useConfluenceSync.ts: Reusable hook managing space sync lifecycle with granular toast notifications forCOMPLETED,PARTIAL, andFAILEDresults.ConnectorSourcesSection.tsx: Added accordion support for Confluence spaces with "Add space", "Sync now", and scope inclusion/exclusion toggles.3. Data Ingestion & Source Monitoring (
src/features/data-ingestion/,src/pages/DataIngestionPage.tsx)AddSourceModal.tsxalongside GitHub, Jira, and File Uploads.SourceDetailsPanel.tsx. The update action resolves the connection UUID viaconfluenceSpace.connectionIdand delegates to the shareduseConfluenceSynchook.data.ts): Implemented normalization helpers to convert Confluence connections into unifiedIngestionSourcestructures. Run-matching supportsbaseUrl|spaceIdcomposite format,connection.id(matchingrepositoryId/sourceInstanceId),spaceId, andspaceKey.connectionId(mapped to backendrepositoryIdquery param) and registered compositebaseUrl|spaceIdreferences, space keys, and connection IDs inbuildRunSourceLabelsfor clean display names.4. Admin Project Creation Wizard (
src/features/admin/)Updated
CreateProjectWizard.tsx,AddSourceFlow.tsx, andprojectSourcesDraft.tsto support staging Confluence spaces during initial project onboarding. Deduplication is keyed onbaseUrl + spaceId.5. Knowledge Base & Document Viewer (
src/features/knowledge-base/)shouldRenderAsMarkdown()inArtifactViewerDrawer.tsxto detect Confluence page artifacts (sourceSystem: "CONFLUENCE"or a/wiki/spaces/URL pattern) and render with ReactMarkdown, GFM tables, and.prosestyling.ArtifactType = "PAGE"andSourceSystem = "CONFLUENCE", mappedBookOpendocument icon inArtifactList.tsx, and ensured coexistence withORG_METADATA.🔒 Security & Credential Hygiene
localStorage,sessionStorage, or client logs.🗂️ Modified Files Summary
src/services/sources/confluenceService.tssrc/features/connectors/components/ConfluenceConnectStep.tsxinputModeon Space ID fieldsrc/features/connectors/components/useConfluenceSync.tssrc/features/connectors/components/ConnectorSourcesSection.tsxsrc/features/data-ingestion/components/AddSourceModal.tsxsrc/features/data-ingestion/components/ConfluenceConnectStep.tsxinputModeon Space IDsrc/features/data-ingestion/components/SourceDetailsPanel.tsxconfluenceSpace.connectionIdsrc/features/data-ingestion/data.tsnextSyncfromnextSyncAtsrc/pages/DataIngestionPage.tsxconnectionId; sync delegated touseConfluenceSyncsrc/features/admin/components/CreateProjectWizard.tsxsrc/features/admin/projectSourcesDraft.tsConfluenceDraftSourcetype;isSameSourcededuplication;connectOneDraftSourcesrc/features/knowledge-base/types.tsPAGEartifact type;CONFLUENCEsource systemsrc/features/knowledge-base/components/ArtifactList.tsxBookOpenicon for Confluence page artifactssrc/features/knowledge-base/components/ArtifactViewerDrawer.tsxsourceSystem/URL (notartifactTypealone); Formatted/Source toggletests/unit/services/confluenceService.test.tstests/unit/features/connectors/ConfluenceConnectStep.test.tsxtests/unit/features/data-ingestion/ConfluenceConnectStep.test.tsxtests/unit/features/data-ingestion/data.test.tscreateConfluenceSource*helpers; run source label resolutiontests/unit/features/knowledge-base/components/ArtifactViewerDrawer.test.tsxPAGEmust not render as markdowntests/unit/setup/msw-handlers.tsPOST /connectionsandPOST .../update🧪 Verification & Quality Assurance
Automated Checks
prettier --check .tsc -b && vite buildeslint .vitest run tests/unit/vitest run tests/a11y/Manual Verification
X created, Y updated, Z unchanged).useConfluenceSynchook).📋 Definition of Done (DoD)
npm run tryruns with 0 errors)./knowledge/artifacts/{id}/summaryendpoint supportsCONFLUENCEsource system has not been confirmed. If it does not, the button should be hidden in a follow-up PR.configureScheduleUI: The schedule configuration endpoint is implemented in the service client but not yet exposed in the UI. Follow-up work required to wire up a schedule settings panel for Confluence connections.💡 Reviewer Guidance: Please review with Claude Code and commit/push any fixes directly to this branch.