Skip to content

feat(confluence): optionally sync page footer comments - #5496

Open
mmhh256 wants to merge 2 commits into
Tencent:mainfrom
mmhh256:feat/confluence-comments-5480
Open

mmhh256 wants to merge 2 commits into
Tencent:mainfrom
mmhh256:feat/confluence-comments-5480

Conversation

@mmhh256

@mmhh256 mmhh256 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Confluence imports currently omit page comments. Add an opt-in settings.sync_comments setting 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

  • ✨ New feature
  • 📚 Documentation update
  • 🧪 Test

Related Issue

Refs #5480. This PR covers top-level footer comments on both supported editions.

Testing

  • The new TestFetchStreamConfluenceComments fails 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=1 passes on macOS arm64 with Go 1.26.
  • golangci-lint run --new-from-rev=origin/main ./... reports zero issues.
  • go test ./internal/datasource/... -count=1 fails with the same three test names on the clean base and the patch: TestValidateConnectorBaseURLAllowsPublicHTTPS, TestDownloadFile_RejectsLoopbackURL, and TestParseYuqueConfig. All three hit DNS resolution failures in this environment.
  • The tests use simulated Confluence API responses. A live Confluence instance was not tested.

Checklist

  • git diff --check origin/main...HEAD passes
  • Changed source files are formatted
  • Targeted tests for the changed package pass
  • Diff-scoped Go lint passes
  • Self-reviewed the code
  • Added regression coverage
  • Updated the data source documentation

Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_comments is 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

No deployments
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.

2 participants