Skip to content

Conversation

@Arbuzov
Copy link

@Arbuzov Arbuzov commented Oct 27, 2025

This pull request adds new features for handling Confluence attachments and improves error handling and test coverage. The main updates include implementing file attachment functionality in both the core Confluence logic and the server endpoints, as well as introducing comprehensive unit tests for these features. Additionally, minor improvements were made to error handling and formatting in user search functionality.

Confluence Attachment Features

  • Added an attach_file method to the PagesMixin class in pages.py, enabling uploading files as attachments to Confluence pages by page ID or by space key and title, with support for custom names, MIME types, and comments. The method includes robust error handling for missing files, invalid parameters, authentication failures, and unexpected API responses. [1] [2]
  • Exposed the file attachment capability as an async endpoint attach_file in servers/confluence.py, allowing users to upload attachments via the server interface with detailed error reporting and parameter validation.

API Extensions

  • Added two new endpoints to servers/confluence.py:
    • get_page_ancestors: Retrieves the ancestor (parent) pages for a given Confluence page.
    • get_space_pages: Lists all pages in a specified Confluence space, with pagination and optional markdown conversion.

Testing Improvements

  • Introduced a comprehensive set of unit tests for the attach_file method in test_pages.py, covering successful uploads (by page ID and by space/title), required parameters, missing files, unexpected API responses, and direct attachment responses.

Error Handling and Formatting

  • Improved error handling in the user search endpoint to specifically catch OSError and provide clearer error messages.
  • Minor formatting adjustments in docstrings and return value formatting for user search. [1] [2]

These changes collectively enhance the Confluence integration by supporting file attachments, expanding the API, improving reliability, and increasing test coverage.

Description

Fixes: #

Changes

Testing

  • Unit tests added/updated
  • Integration tests passed
  • Manual checks performed: [briefly describe]

Checklist

  • Code follows project style guidelines (linting passes).
  • Tests added/updated for changes.
  • All tests pass locally.
  • Documentation updated (if needed).

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 14 days. It will be closed if no further activity occurs. Please leave a comment or remove the 'stale' label if you believe this PR is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale label Nov 14, 2025
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.

1 participant