refactor!: inherit mdfluence CLI parser, rename env vars, add auth model#24
Merged
Conversation
BREAKING CHANGE: Environment variable rename: - CONFLUENCE_PROD_HOST -> CONFLUENCE_HOST - CONFLUENCE_PROD_TOKEN -> CONFLUENCE_TOKEN Replace ~150 lines of duplicated argparse definitions with mdfluence's get_parser() as base. gitfluence inherits all mdfluence args, overrides 6 defaults (only_changed, strip_top_header, collapse_single_pages, skip_empty, skip_subtrees_wo_markdown, enable_relative_links), removes incompatible args (file_list, output, prefix nargs, preface/postface nargs), and re-adds them with gitfluence semantics. New features: - Username/password auth (matching mdfluence: token > user+password) - --host-int, --token-int, --username-int, --password-int for integration - --debug alias for --verbose (mdfluence compat) - -n alias for --dry-run - --content-type choices enforced (page/blogpost) - --insecure flag passed to MinimalConfluence verify= - --page-id rejected with user-friendly error Config resolution: CLI > env > interactive prompt > dry-run dummy. Int mode without int host: full fallback to prod config. Int mode with int host: enforce int-specific auth (no prod fallback).
Update documentation for CONFLUENCE_PROD_HOST -> CONFLUENCE_HOST and CONFLUENCE_PROD_TOKEN -> CONFLUENCE_TOKEN rename. Add documentation for new features: - Username/password auth (token > user+password priority) - Integration target CLI args (--host-int, --token-int, etc.) - --debug alias for --verbose, -n alias for --dry-run - --page-id rejection note - --content-type choices (page/blogpost) - --insecure flag - Login args section for mdfluence pass-through
Finding: gitpython@3.1.46 has the following known vulnerabilities: GHSA-rpm5-65cw-6hj4: GitPython has Command Injection via Git options bypass Severity: '8.8'; Minimal Fix Version: '3.1.47'; GHSA-x2qx-6953-8485: GitPython: Unsafe option check validates multi_options before shlex.split... Severity: '8.1'; Minimal Fix Version: '3.1.47'; Fix: tie gitpython to >=3.1.47
… only CLI parent overrides were applied to all pages, flattening the directory hierarchy. Now only pages without a mdfluence-assigned parent receive the override; child pages retain their structure.
- Bump mdfluence minimum from 0.2.1 to 0.4.0 - Bump gitpython minimum from 3.1.47 to 3.1.50 - Pin urllib3>=2.7.0 to fix GHSA-mf9v-mfxr-j63j and GHSA-qccp-gfcp-xxvc
- Remove broken rewrite_page_anchors import; delegate anchor conversion, emoji processing, and diagram rendering to mdfluence's get_pages_from_directory via convert_anchors, enable_emoji, render_diagrams, mmdc_path, plantuml_path params - Add --title override support in _preprocess_page - Prefix page titles and child parent_titles in integration mode (matching mdfluence's prefix behavior) - Add --top-level homepage anchoring for page moves - Fix test_cli: convert_anchors -> disable_anchor_convert - Update test_confluence and test_integration for prefix behavior
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
Major refactoring of gitfluence CLI to inherit mdfluence's
get_parser(), achieving full CLI option parity. Replaces ~150 lines of duplicated argparse with parser inheritance, adds proper auth model, and ensures gitfluence works as a drop-in replacement for mdfluence.Breaking Changes
CONFLUENCE_PROD_HOSTrenamed toCONFLUENCE_HOSTCONFLUENCE_PROD_TOKENrenamed toCONFLUENCE_TOKENaction.ymlinputs renamed accordinglyChanges
Parser inheritance
get_parser(), remove/re-add args with gitfluence semanticsfile_list,output,prefix(re-added with different semantics)Full mdfluence CLI option support
--disable-emoji,--disable-anchor-convert,--render-diagrams,--mmdc-path,--plantuml-path— delegated to mdfluence internals--titleoverride for single-page repos--parent-id/--parent-titlescoped to root-level pages only (child pages keep directory structure)--top-levelanchors orphan pages to space homepage{prefix} - {title})Auth model
--host-int,--token-int,--username-int,--password-intfor integration targetNew CLI features
--debugalias for--verbose(mdfluence compat)-nalias for--dry-run--content-typechoices enforced (page/blogpost)--insecureflag passed to MinimalConfluence--page-idrejected with user-friendly errorConfig resolution
CLI > env > interactive prompt > dry-run dummy
Tests
131 tests, all passing. Coverage for parser inheritance, default overrides, auth decision, config priority, prefix propagation, parent-id scoping, title prefixing, and integration mode.