fix: make wiki path prefix configurable based on apiPath#83
fix: make wiki path prefix configurable based on apiPath#83pchuri merged 2 commits intopchuri:mainfrom
Conversation
URLs no longer hardcode /wiki — they derive the prefix from apiPath, fixing broken links for Server/Data Center instances without /wiki. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for the contribution, @saggl! This is a solid fix for Server/Data Center instances that don't use the One concern I noticed: there's a logic duplication between
const getWebUrlPrefix = (apiPath) => apiPath && apiPath.startsWith('/wiki/') ? '/wiki' : '';
this.webUrlPrefix = this.apiPath.startsWith('/wiki/') ? '/wiki' : '';Since
Suggestion: Instead of maintaining a separate The tests look good — nice coverage of Cloud, Server, and default cases. It would also be great to add a test for the edge case above (missing leading slash in |
Addresses review feedback by removing logic duplication between bin/confluence.js and ConfluenceClient that could cause inconsistent behavior. Changes: - Remove getWebUrlPrefix() and buildPageUrl() functions from bin/confluence.js - Use client.webUrlPrefix and client.buildUrl() for all URL construction - Add test for edge case: apiPath without leading slash (e.g., 'wiki/rest/api/') This ensures consistent URL generation by always using the sanitized apiPath through ConfluenceClient, preventing discrepancies when users configure apiPath with or without a leading slash. Resolves feedback in pchuri#83 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for the thorough review! I've addressed the feedback: Changes Made✅ Removed duplicate logic - Deleted ✅ Single source of truth - All URL construction now uses ✅ Added edge case test - New test verifies that Benefits
All 158 tests pass ✅ The changes ensure that users get consistent URL output regardless of whether they configure |
|
Great work on the update, @saggl! All feedback has been addressed cleanly:
Code looks clean and the approach is solid. LGTM! 👍 |
## [1.27.5](v1.27.4...v1.27.5) (2026-03-23) ### Bug Fixes * make wiki path prefix configurable based on apiPath ([#83](#83)) ([fb58a37](fb58a37)), closes [/github.com//pull/83#issuecomment-4108336611](https://github.com//github.com/pchuri/confluence-cli/pull/83/issues/issuecomment-4108336611)
|
🎉 This PR is included in version 1.27.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Derives the
/wikiURL prefix fromapiPathinstead of hardcoding it, fixing broken links on Server/Data Center instances.🤖 Generated with Claude Code