Refactor code structure for improved readability and maintainability #741
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.
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
attach_filemethod to thePagesMixinclass inpages.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]attach_fileinservers/confluence.py, allowing users to upload attachments via the server interface with detailed error reporting and parameter validation.API Extensions
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
attach_filemethod intest_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
OSErrorand provide clearer error messages.These changes collectively enhance the Confluence integration by supporting file attachments, expanding the API, improving reliability, and increasing test coverage.
Description
Fixes: #
Changes
Testing
[briefly describe]Checklist