fix(web): support ports in chat file references - #1565
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
WalkthroughThe chat file-reference regex now supports repository URLs with numeric ports. All affected citation, extraction, instruction, and command parsing paths use the updated capture-group positions. A regression test and changelog entry document the fix. ChangesPort-qualified chat file references
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
5913ad8 to
c709984
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/web/src/features/chat/utils.test.ts`:
- Around line 137-152: Add assertions in the fileReferenceToString port-matching
test for FILE_REFERENCE_REGEX captures match?.[2] through match?.[5], verifying
the expected port, path, start line, and end line values alongside the existing
repository assertion.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 17027e64-1d33-440c-b183-44b20692dc11
📒 Files selected for processing (9)
CHANGELOG.mdpackages/web/src/ee/features/chat/components/chatThread/markdownRenderer.tsxpackages/web/src/ee/features/chat/skills/commandResolution.tspackages/web/src/ee/features/chat/skills/components/skillInstructionsEditor.tsxpackages/web/src/ee/features/chat/useExtractPanelItems.tspackages/web/src/ee/features/chat/useExtractReferences.tspackages/web/src/features/chat/constants.tspackages/web/src/features/chat/utils.test.tspackages/web/src/features/chat/utils.ts
Fixes SOU-1929
Summary
Testing
Note
Low Risk
Localized regex and capture-index updates in chat file-reference handling, with a targeted regression test; no auth or data-layer changes.
Overview
Fixes Ask Sourcebot file citations when the repository identifier includes a host port (e.g.
git.example.com:8080/org/repo). Previously,FILE_REFERENCE_REGEXtreated the first:as the separator between repo and path, so citations were parsed with the wrong repo/path and line ranges.The shared
FILE_REFERENCE_REGEXnow allows an optional:digitssegment inside the repo portion before the::path delimiter. Every consumer that reads regex capture groups was updated to account for the extra capture (markdown rendering, reference extraction, skill instructions, panel interleaving with Mermaid, portable markdown export). A regression test asserts round-trip parsing for a port-bearing repo.Reviewed by Cursor Bugbot for commit 8d8b900. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
Tests