Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Feb 3, 2026

Fixes #845

Summary by CodeRabbit

  • Bug Fixes
    • Improved branch reference handling in code browse URLs to ensure proper formatting across all supported Git platforms (GitHub, GitLab, Gitea, Azure DevOps, Bitbucket, Gerrit, and others). Ensures reliable links when navigating to code at specific branches.

@github-actions

This comment has been minimized.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Walkthrough

Bug fix that sanitizes branch references in URL construction by stripping refs/heads/ and refs/tags/ prefixes before building code host browse URLs, resolving URL path issues in GitLab and other platforms.

Changes

Cohort / File(s) Summary
URL Sanitization
packages/web/src/lib/utils.ts
Renamed branchName parameter to _branchName in getCodeHostBrowseAtBranchUrl and getCodeHostBrowseFileAtBranchUrl. Added internal logic to strip Git reference prefixes (refs/heads/, refs/tags/) from the branch name before constructing URLs, ensuring proper URL formatting across all code host types.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the bug fix addressing the 404 error in GitLab URL generation when using the 'Open in GitLab' feature, directly matching the linked issue #845.
Linked Issues check ✅ Passed The code changes strip 'refs/heads/' and 'refs/tags/' prefixes from branch names before constructing URLs, directly addressing the root cause of issue #845 where invalid URL segments were being generated.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the branch name sanitization in URL generation functions, with no extraneous modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bkellam/fix-SOU-346

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@brendan-kellam brendan-kellam merged commit 880c8e0 into main Feb 3, 2026
8 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/fix-SOU-346 branch February 3, 2026 18:42
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.

[bug] Open in Gitlab leads to 404

2 participants