Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Cloud comment conversion can discard code blocks, mentions, and unlabeled internal-link content, causing fingerprints to miss edits and preventing document updates.
1 open issue
What changed in this PR
Adds opt-in Confluence comment syncing to the existing data source importer, addressing the top-level footer-comment portion of #5480 for Cloud and Server/Data Center.
Changes:
- Appends footer comments to page Markdown when
settings.sync_commentsis enabled. - Detects comment-only changes and aborts affected-page processing when comment retrieval fails.
- Adds regression coverage and documents configuration, scope, and conflict-policy behavior.
| File | Description |
|---|---|
| website-docs/03-features/10-datasource.md | Documents the setting, supported comments, and sync behavior. |
| internal/datasource/connector/confluence/connector.go | Integrates comment retrieval, fingerprinting, and Markdown output. |
| internal/datasource/connector/confluence/comments.go | Fetches and converts paginated comments for both editions. |
| internal/datasource/connector/confluence/comments_test.go | Covers pagination, edits, removals, retrieval failures, and disabling sync. |
Review effort: Balanced
| cloud := c.cfg.cloud() | ||
| if cloud { | ||
| path = "/api/v2/pages/" + url.PathEscape(pageID) + "/footer-comments" | ||
| query = url.Values{"limit": {"100"}, "body-format": {"storage"}, "status": {"current"}} |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Confluence imports currently omit page comments. Add an opt-in
settings.sync_commentssetting that appends top-level footer comments to the existing page Markdown for Cloud and Server/Data Center. This initial scope covers top-level footer comments. Inline comments, replies, and comment attachments are outside the scope of this PR.Comment-only additions, edits, and removals trigger a page update even when the page version stays the same. Incomplete comment listings abort the run before the affected page is emitted or checkpointed. Existing documents keep their normal conflict policy. The setting defaults to off and is available via the data source API.
AI assistance: OpenAI Codex investigated, implemented, tested and self-reviewed the changes.
Type of Change
Related Issue
Refs #5480. This PR covers top-level footer comments on both supported editions.
Testing
TestFetchStreamConfluenceCommentsfails on the unmodified base for both editions and passes with this patch. The test exercises pagination, unchanged comments, comment-only edits/removals, a failed later page and disabling the setting.go test ./internal/datasource/connector/confluence -count=1passes on macOS arm64 with Go 1.26.golangci-lint run --new-from-rev=origin/main ./...reports zero issues.go test ./internal/datasource/... -count=1fails with the same three test names on the clean base and the patch:TestValidateConnectorBaseURLAllowsPublicHTTPS,TestDownloadFile_RejectsLoopbackURL, andTestParseYuqueConfig. All three hit DNS resolution failures in this environment.Checklist
git diff --check origin/main...HEADpasses