confluence-publisher icon indicating copy to clipboard operation
confluence-publisher copied to clipboard

Confluence Page attachments are deleted while orphanRemovalStrategy=KEEP_ORPHANS

Open kalemena opened this issue 2 years ago • 4 comments

Thanks for this great project.

Here is a scenario causing issue:

  • Create adoc page with some attachments (e.g. image: or plantuml:)
  • Publish page to Confluence
  • Remove the attachment from adoc
  • Re-publish
  • In Confluence, browse to page attachments to see that the attachment was deleted even if KEEP_ORPHANS is set

.Example logs: Updated page 'MyProject - Tests' (id 133606310, version 25 -> 26) Deleted attachment 'MyProject-some-image.png' (page id 133606310)

NOTE: A Confluence instance may be setup with preventing delete. If so, the re-publish step will fail with error and prevents full doc publication.

Any of below ideas would help bypass this use-case:

  • When KEEP_ORPHANS, simply skip attachment deletes like done for pages
  • If need to make a difference between Pages and Attachments, introduce option such as KEEP_ORPHANS_ATTACHMENTS
  • If such delete attachment operations fails, perhaps this is not important, and publish should continue next, with WARNING log

kalemena avatar Mar 14 '22 17:03 kalemena

Hi @kalemena, thank you for using the Confluence Publisher and for describing in detail your scenario.

If you understand you correctly, then it is not your main goal to keep the attachment from a "content" perspective because you want to keep the attachment (since after all, it is no longer part of the previously referencing page content), but just to avoid issue with Confluence instances that do not allow the corresponding user to delete any content.

If so, I think we should try to support the "no delete allowed" Confluence instance configuration with an explicit configuration property. Thank you for your clarification!

cstettler avatar Jun 01 '22 19:06 cstettler

Hi @cstettler Exactly, an option "no delete allowed" is the perfect understandable name for the intent when user is not allowed any deletes on the Confluence space (pages or attachments)

kalemena avatar Jun 02 '22 06:06 kalemena

Hi @cstettler Is this possible to follow-up on this issue?

kalemena avatar Nov 15 '23 17:11 kalemena

Hi @kalemena, thank you for catching up on this. Unfortunately, I currently don't have the capacity to invest in this feature. Would you maybe be up for providing a pull request for it? That would be great!

cstettler avatar Nov 21 '23 13:11 cstettler