Skip to content

refactor: introduce branch page hierarchy for integration targets#22

Merged
geopanther merged 7 commits into
mainfrom
refactor/branch-page-hierarchy
Apr 28, 2026
Merged

refactor: introduce branch page hierarchy for integration targets#22
geopanther merged 7 commits into
mainfrom
refactor/branch-page-hierarchy

Conversation

@geopanther

Copy link
Copy Markdown
Owner

Summary

Replaces the branch-name prefix on integration page titles with an intermediate Branch: {branch-name} grouping page. Content pages now have clean titles under a dedicated branch node.

Breaking Changes

  • Integration page titles no longer carry branch-name - prefix. Consumers bookmarking old-style titles will need to update.

Changes

  • gitfluence/confluence.py — Add _ensure_branch_page(), wire into run_sync(), remove prefix logic from _preprocess_page()
  • gitfluence/template.py — Switch from str.format() to .replace() to avoid KeyError on literal braces in user templates
  • gitfluence/__main__.py — Replace getattr(args, "no_preface", False) with direct args.no_preface
  • tests/ — Add TestEnsureBranchPage, update TestPreprocessPage and TestIntegrationPrefix for new hierarchy, add literal-braces and homepage-fallback tests
  • README.md — Document new page hierarchy with diagram
  • CHANGELOG.md — Fix duplicate headings, add breaking change and feature entries

New Hierarchy (Integration)

Space Homepage
  └── {repo-name}              (integration root)
       └── Branch: {branch}    (new grouping page)
            └── Page Title     (clean, no prefix)

Tests

73 tests pass, all pre-commit hooks green.

- Add TestEnsureBranchPage class (3 tests)
- Update TestPreprocessPage: branch_page parenting, no prefix on titles
- Update TestIntegrationPrefix: verify branch page hierarchy
- Add confluence_int_token to integration test settings
Replace branch-name prefix on page titles with an intermediate
'Branch: {branch-name}' grouping page. Top-level integration pages
now parent to the branch page instead of the integration root.

- Add _ensure_branch_page() function
- Wire branch_page into run_sync() and _preprocess_page()
- Remove prefix application from titles and parent titles

BREAKING CHANGE: integration page titles no longer carry branch prefix
- Update page hierarchy section with new structure diagram
- Remove branch prefix from prod/int table
- Add CHANGELOG entries for branch page and breaking change
str.format() raises KeyError on literal curly braces in user-provided
templates (e.g. '--preface-markdown "Use {curly} braces"'). Switch to
manual .replace() chain that only substitutes known placeholders.
…/no_postface

argparse store_true always sets the attribute; getattr with default is
misleading.
- Rename test_no_prefix_applied_to_title_on_int →
  test_no_prefix_applied_to_title_when_branch_page_present
- Add test_top_level_falls_back_to_homepage_without_roots
Merge duplicate ### Changed sections, move --no-preface/--no-postface
and other new features to ### Added.
@geopanther
geopanther merged commit 6037523 into main Apr 28, 2026
5 checks passed
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