Skip to content

fix: preserve draft status when editing Confluence pages#30

Merged
Hinne1 merged 1 commit intomainfrom
claude/fix-confluence-draft-edit
Feb 26, 2026
Merged

fix: preserve draft status when editing Confluence pages#30
Hinne1 merged 1 commit intomainfrom
claude/fix-confluence-draft-edit

Conversation

@Hinne1
Copy link
Contributor

@Hinne1 Hinne1 commented Feb 26, 2026

Summary

  • atl confluence page edit failed on draft pages with a 400 error because UpdatePage hardcoded status: "current" and always incremented the version number
  • Draft pages in Confluence require status: "draft" and must stay at version 1 (no multi-version support)
  • Now preserves the page's current status, so drafts stay as drafts and published pages continue to work as before

Test plan

  • Tested editing a draft page title — succeeds, stays as draft
  • Tested editing a draft page body — succeeds, stays as draft
  • All existing tests pass (go test ./...)

`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.
@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Draft Page Editing Fix: Resolved a 400 error that occurred when attempting to edit draft Confluence pages via the CLI, which previously failed due to hardcoded 'current' status and automatic version incrementing.
  • Status Preservation: Ensured that the original status of a Confluence page (draft or current) is preserved during updates, preventing draft pages from being incorrectly converted to 'current' status.
  • Correct Versioning for Drafts: Implemented logic to prevent version numbers from incrementing for draft pages, as Confluence drafts must remain at version 1.
Changelog
  • internal/api/confluence.go
    • Updated the UpdatePage function signature to accept a status parameter.
    • Added logic to default the status to 'current' if an empty string is provided.
    • Modified the reqBody.Status field to use the new status parameter.
    • Implemented conditional version incrementing: version is used for 'draft' status, and version + 1 for other statuses.
  • internal/cmd/confluence/page/edit.go
    • Modified the call to confluence.UpdatePage to pass the currentPage.Status as the new status argument.
Activity
  • The author provided a detailed summary of the changes and the problem being solved.
  • A test plan was outlined and executed, confirming successful editing of draft pages and passing all existing tests.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 35.46% (-1.13%) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/confluence/page 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/confluence.go 1.97% (-0.03%) 254 (+4) 5 249 (+4) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/confluence/page/edit.go 0.00% (ø) 51 0 51

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.

@Hinne1 Hinne1 merged commit 5028b12 into main Feb 26, 2026
11 checks passed
@Hinne1 Hinne1 deleted the claude/fix-confluence-draft-edit branch February 26, 2026 12:25
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

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.

1 participant