fix: preserve draft status when editing Confluence pages#30
Conversation
`page edit` failed on draft pages because UpdatePage hardcoded status "current" and always incremented the version number. Draft pages require status "draft" and version 1 (no multi-version support). Now passes the page's current status through so drafts stay as drafts.
Summary of ChangesHello @Hinne1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that prevented users from editing draft Confluence pages using the CLI tool. The changes ensure that when a page is updated, its draft status is correctly maintained and its version number is not incremented, aligning with Confluence's requirements for draft content. This significantly improves the reliability and functionality of the Confluence page editing feature for draft content. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the issue of editing Confluence draft pages by correctly preserving their draft status and version number. The changes in internal/api/confluence.go introduce a status parameter to the UpdatePage function, allowing for conditional handling of page status and versioning. The corresponding update in internal/cmd/confluence/page/edit.go ensures that the existing page status is passed to the API, maintaining the integrity of draft pages while allowing published pages to be updated as before. The implementation is clear, correct, and directly resolves the reported bug.
Summary
atl confluence page editfailed on draft pages with a 400 error becauseUpdatePagehardcodedstatus: "current"and always incremented the version numberstatus: "draft"and must stay at version 1 (no multi-version support)Test plan
go test ./...)