Skip to content

Commit 0542559

Browse files
committed
publisher: ensure new pages include a configured version comment
When a user configures `confluence_version_comment`, the value used will only show in a page's history for page updates. This is due to the original implementation only populate the version message for page updates. This commit adjusts the implementation to always populate a `version` entry for a page with a configured message value. Note that new page comments only appear to work on Confluence Cloud. Tests with Confluence server (v7.19.x) does not appear to accept a message value (ignored?). Signed-off-by: James Knight <[email protected]>
1 parent 2754702 commit 0542559

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sphinxcontrib/confluencebuilder/publisher.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,10 @@ def _build_page(self, page_name, data):
931931
'space': {
932932
'key': self.space_key,
933933
},
934+
'version': {
935+
'number': 1,
936+
'message': self.config.confluence_version_comment,
937+
},
934938
}
935939

936940
if self.editor:
@@ -972,10 +976,7 @@ def _update_page(self, page, page_name, data, parent_id=None):
972976

973977
update_page = self._build_page(page_name, data)
974978
update_page['id'] = page['id']
975-
update_page['version'] = {
976-
'number': last_version + 1,
977-
'message': self.config.confluence_version_comment,
978-
}
979+
update_page['version']['number'] = last_version + 1
979980

980981
labels = list(data['labels'])
981982
if self.append_labels:

0 commit comments

Comments
 (0)