feat(cli): add --clear flag to delete subpages before upload#60
Open
geopanther wants to merge 1 commit into
Open
feat(cli): add --clear flag to delete subpages before upload#60geopanther wants to merge 1 commit into
geopanther wants to merge 1 commit into
Conversation
Owner
Author
Maintainer ReviewVerdict: The feature is useful for CI workflows, but this is a destructive operation that needs more safeguards before merging. Blocking concerns:
Non-blocking suggestions:
Good:
|
Add --clear flag that recursively deletes all child pages under the specified --parent-id before uploading new content. Requires --parent-id to be set. Also adds delete_page() and get_child_pages() to the API client, and handles HTTP 204 no-content responses. Adapted from iamjackg/md2cf#114 by @stevengoossensB.
a7e64c6 to
e89f6d5
Compare
Owner
Author
|
Updated — addressed all review feedback:
|
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.
Summary
Add
--clearflag that recursively deletes all child pages under the specified--parent-idbefore uploading new content. Useful for CI workflows where you want to ensure a clean slate.Adapted from iamjackg/md2cf#114 by @stevengoossensB.
Changes
--clear(requires--parent-id)--yes/-ydelete_page()andget_child_pages()added toMinimalConfluenceAPIget_child_pages()paginates — follows_links.nextto fetch all children (Confluence default limit is 25)_request()Differences from upstream
--parent-id— errors explicitly instead of silently doing nothing--yesto skip (upstream had none)_request()Tests (6 new)
test_delete_subpages_empty_parent— no children, no deletestest_delete_subpages_flat_children— direct children deletedtest_delete_subpages_nested_children— depth-first recursive deletiontest_delete_subpages_partial_failure— continues on HTTPErrortest_get_child_pages_pagination— follows_links.nexttest_get_child_pages_empty— returns empty listAll 156 unit tests pass.