feat(comments): reply to inline threads and resolve/reopen via the v2 API - #268
Merged
Merged
Conversation
… API Replying to an inline thread through v1 POST /content could fail with a 400 because it needs editor highlight metadata, and there was no way to resolve or reopen a thread. On Confluence Cloud, `comment --parent <id>` now posts through the v2 comment API. The parent is looked up first to pick the matching inline or footer endpoint, and the reply is refused if the parent belongs to a different page. Server/Data Center keeps the v1 behavior. Add `comment-resolve <commentId> [--reopen]`, which reads the current version and updates the inline comment's resolved state. Asking for the state a thread already has is a no-op and dangling threads are rejected. Creating a new inline comment on selected text is not included. Refs #251
- Require numeric comment IDs before any v2 request, so a bad ID gives a clear error instead of an API 400 and cannot alter the request path. - Compare the parent's pageId or blogPostId against the target content, so a blog post comment is no longer skipped by the page check. - Refuse to resolve or reopen a reply; only top-level inline comments can be resolved. - Document the granular-scope requirement for v2 comment calls. - Cover /wiki/rest/api and scoped-token gateway base URLs in tests.
|
🎉 This PR is included in version 2.27.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Problem
confluence comment <page> --parent <id>goes through v1POST /contentwithancestors, which can return 400 for inline threads because it needs editor highlight metadata.Changes
Replies (Confluence Cloud)
createCommentwith a parent now posts through the v2 comment API:POST /api/v2/inline-commentsor/footer-commentswithparentCommentIdand a storage body. NoinlineCommentPropertiesare needed for replies.id,container,_links), so text output and--jsonare unchanged.Resolve / reopen
comment-resolve <commentId> [--reopen](supports--json, blocked in read-only mode).GET /inline-comments/{id}and sendsPUTwithversion + 1andresolved.Behavior notes
--locationand--inline-*options are ignored for replies; the parent decides the thread type.Not included
--inline-selectionwithout editor metadata). It needs live verification against Cloud first.comment-resolve; the Pi write tools have their own allowlist surface.Testing
npm test(40 suites, 1546 tests) andeslintpass.--jsonoutput and read-only blocking.versionandresolved.Refs #251