Skip to content

Preserve Confluence Server REST URL compatibility - #1654

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
hkwi:fix/confluence-server-backward-compatibility
Aug 17, 2026
Merged

Preserve Confluence Server REST URL compatibility#1654
gonchik merged 1 commit into
atlassian-api:masterfrom
hkwi:fix/confluence-server-backward-compatibility

Conversation

@hkwi

@hkwi hkwi commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

The ConfluenceServer class in 5.0.0 changed the client to append the configured API root and version to its base URL. Existing calls that already pass paths such as rest/api/content/... therefore construct URLs such as /rest/api/1.0/rest/api/content/....

This breaks the established Confluence Server REST API URL used by on-premises installations. It also incorrectly places non-REST browser endpoints, such as PDF and Word exports, below the REST API root.

Changes

  • Keep the Confluence site/context URL as the ConfluenceServer base URL, matching 4.x behavior.
  • Prefix only unrooted Server REST resources at request time.
  • Leave legacy rest/api/... paths, experimental REST paths, attachment download links, and browser/UI paths unchanged.
  • Apply explicitly configured api_root and api_version values to unrooted REST resources without duplicating rooted paths.
  • Preserve the existing method-level path expectations instead of rewriting them to fit the new URL layout.
  • Add final HTTP URL regression coverage for relative REST resources, 4.x-style post/put/delete paths, explicit API versions, and PDF/Word export paths.

This keeps the Cloud/Server class split introduced in 5.x while restoring compatibility for existing Confluence Server clients.

Testing

  • Focused Confluence tests: 168 passed, 6 skipped.
  • Full test suite: 1027 passed, 10 skipped.
  • Black check: passed for both changed files.

@hkwi
hkwi marked this pull request as draft August 17, 2026 01:54
@hkwi
hkwi force-pushed the fix/confluence-server-backward-compatibility branch from ef4310c to cd2108c Compare August 17, 2026 02:26
@hkwi
hkwi marked this pull request as ready for review August 17, 2026 02:27
@gonchik

gonchik commented Aug 17, 2026

Copy link
Copy Markdown
Member

@hkwi thanks

@gonchik
gonchik merged commit f5d47e0 into atlassian-api:master Aug 17, 2026
9 checks passed
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.92%. Comparing base (996ea93) to head (cd2108c).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
atlassian/confluence/server/__init__.py 85.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1654      +/-   ##
==========================================
+ Coverage   59.82%   59.92%   +0.09%     
==========================================
  Files         104      104              
  Lines       17316    17334      +18     
  Branches     1797     1801       +4     
==========================================
+ Hits        10360    10387      +27     
+ Misses       6524     6519       -5     
+ Partials      432      428       -4     

☔ 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.

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.

2 participants