Skip to content

[Confluence] Keep the context path when following relative next links - #1685

Open
RizgarOzan wants to merge 1 commit into
atlassian-api:masterfrom
RizgarOzan:fix/paged-context-path
Open

RizgarOzan wants to merge 1 commit into
atlassian-api:masterfrom
RizgarOzan:fix/paged-context-path

Conversation

@RizgarOzan

Copy link
Copy Markdown

Fixes #1668

When Confluence Server runs under a context path (https://host/confluence), _get_paged resolved the relative _links.next against scheme://netloc only, so every page after the first was requested from https://host/rest/api/....

Relative next links (/rest/api/... and rest/api/...) are now joined under the context path from self.url. If the link already starts with the context path it is left alone. This only applies to Server; the Cloud branch is unchanged, since test_pagination_with_relative_next_link_and_base pins the current Cloud behaviour and I didn't want to change that here.

How I tested:

  • New parametrized test test_child_page_pagination_keeps_context_path (base URL with and without trailing slash, three next-link forms). On master 4 of the 6 cases fail with https://test.confluence.com/rest/api/...; with the fix all pass.
  • pytest tests: 1720 passed, 10 skipped (master: 1714 passed, 10 skipped).
  • flake8 and black 25.1.0 clean. mypy reports the same 12 existing errors as master, none in base.py.

On Server instances deployed under a context path (https://host/confluence),
_get_paged built the second page URL from scheme+host only, so every page
after the first went to https://host/rest/api/... Fixes atlassian-api#1668
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.16%. Comparing base (37f7eb4) to head (f92d2c0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1685   +/-   ##
=======================================
  Coverage   65.15%   65.16%           
=======================================
  Files         106      106           
  Lines       19206    19210    +4     
  Branches     2085     2086    +1     
=======================================
+ Hits        12514    12518    +4     
  Misses       6004     6004           
  Partials      688      688           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

_get_paged drops context path when resolving next-page URL on Server deployments

1 participant