Skip to content

feat(export): add attachment exclude patterns - #229

Merged
pchuri merged 1 commit into
pchuri:mainfrom
AlexanderTheGrey:feature/attachment-exclude-patterns
Aug 28, 2026
Merged

feat(export): add attachment exclude patterns#229
pchuri merged 1 commit into
pchuri:mainfrom
AlexanderTheGrey:feature/attachment-exclude-patterns

Conversation

@AlexanderTheGrey

@AlexanderTheGrey AlexanderTheGrey commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds --exclude-attachments <patterns> to confluence export, allowing comma-separated glob patterns to exclude matching attachments from single-page and recursive exports.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • Tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Additional Context

  • Add --exclude-attachments <patterns> to confluence export
  • Support comma-separated, case-insensitive glob patterns
  • Exclude matching attachments from downloads
  • Apply attachment exclusions to both single-page and recursive exports
  • Add tests for attachment exclusion behavior
  • Update documentation

Example

confluence export 123456789 --exclude-attachments "*.mp4,*.mov"

Testing

Added coverage for multiple patterns, case-insensitive matching, interaction with existing attachment filters, recursive exports, --skip-attachments, and excluding all matching attachments.

@pchuri pchuri left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the contribution, @AlexanderTheGrey — this is a well-executed PR. 🎉

What I like:

  • Extracting the duplicated attachment-filtering logic (single-page and recursive paths) into a shared filterAttachments helper is a nice cleanup on its own — the existing --pattern--referenced-only → all precedence is preserved exactly, with exclusions applied last as documented.
  • The comma-separated parsing (split(',') → trim → filter) mirrors the existing --exclude option for page titles, so the CLI stays consistent.
  • Solid test coverage: multiple patterns, case-insensitive matching (recording.MOV vs *.mov), interaction with --pattern / --referenced-only / --skip-attachments, recursive export, empty-pattern handling, and the exclude-everything edge case.
  • Docs updated in all three places (README examples, command table, and SKILL.md).

Verified locally:

  • matchesPattern in lib/confluence-client.js genuinely supports pattern arrays and defaults to case-insensitive matching via globToRegExp, so the helper's array usage is safe (the tests mock the client, so I double-checked the real implementation).
  • Full test suite (1128 tests) and ESLint pass on the branch; CI is green across Node 18/20/22.

LGTM — approving.

@pchuri
pchuri merged commit b1bb913 into pchuri:main Aug 28, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 28, 2026
# [2.22.0](v2.21.0...v2.22.0) (2026-08-28)

### Features

* **export:** add attachment exclude patterns ([#229](#229)) ([b1bb913](b1bb913))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants