Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe change adds trailing-slash normalization for Jira base URLs. Cloud and server management URLs, OAuth installation state, and autolink registration now use normalized URLs. Tests cover all supported instance types and project autolinks. ChangesJira base URL normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/instance.go`:
- Around line 77-79: Update normalizeJiraBaseURL to remove all trailing slash
characters by using the appropriate right-trimming operation instead of
strings.TrimSuffix. Add a test covering a base URL with repeated trailing
slashes and verify the normalized result contains none.
In `@server/plugin.go`:
- Line 521: Update AddAutolinksForCloudInstance to pass ci.GetJiraBaseURL()
instead of the raw ci.BaseURL when creating Cloud JWT autolinks, and add
coverage verifying trailing-slash URLs are normalized without duplicate slashes.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0cdefb51-9b05-4a6a-9476-ac0455faf00e
📒 Files selected for processing (6)
server/instance.goserver/instance_cloud.goserver/instance_cloud_oauth.goserver/instance_server.goserver/instance_test.goserver/plugin.go
Summary
Every posted Jira link is built as
GetJiraBaseURL() + "/browse/" + key so the base URL must not carry a trailing slash. The same gap existed beyond Cloud OAuth.GetJiraBaseURL()` has three implementations and none of them normalized.Fixes:
installCloudOAuthInstancenow stores the normalizedjiraURLinstead ofrawURL.normalizeJiraBaseURLand routed all threeGetJiraBaseURL()implementations through it, so instances already persisted with a bad URL are corrected without requiring a reinstall and every consumer is covered.GetJiraBaseURL()instead ofGetURL().Ticket Link
https://mattermost.atlassian.net/browse/MM-69474
Test Steps
https://your-instance.atlassian.net/)./jira createand create an issue, or attach a comment to an existing one.https://your-instance.atlassian.net/browse/KEY-1with a single slash and opens without a redirect.Change Impact: 🟡 Medium
Reasoning: The changes affect shared Jira URL handling across Cloud OAuth, Cloud JWT, and Server/DC integrations. Tests cover normalization and autolink paths, but management and webhook URLs also change.
Regression Risk: Medium. Existing instances and multiple integration paths are affected. The behavior change is limited to trailing-slash normalization.
QA Recommendation: Perform targeted manual QA for management links, webhooks, and autolinks across all supported integrations. Skipping manual QA has moderate risk.
Generated by CodeRabbitAI