Repository navigation
Conversation
docs/confluence.rst documents get_page_space(page_id), and the Server
client has it, but the Cloud client does not, so
Confluence(url="https://<site>.atlassian.net") and ConfluenceCloud raise
"'Cloud' object has no attribute 'get_page_space'".
Add get_page_space to Cloud with the same behaviour as the Server
client: it requests /wiki/rest/api/content/{id}?expand=space and returns
the space key, or None when the page has no space.
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.
docs/confluence.rstdocumentsconfluence.get_page_space(page_id)("Provide space key from content id"), and the Server client has it. The Cloud client (Confluence(url="https://<site>.atlassian.net")/ConfluenceCloud) doesn't, so it fails with:This adds
get_page_space(page_id)toCloud, with the same behaviour as the Server client:GET /wiki/rest/api/content/{id}?expand=space, the same v1 endpointget_page_by_id()already uses;Nonewhen the response has no space.Tests: added four
test_get_page_space_*tests totests/confluence/test_confluence_cloud.py(default call, no space, the final request URL, and a call throughConfluence(url="https://test.atlassian.net")); they fail on master with the error above. The full pytest suite,tox -e mypyand bandit pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.