-
Notifications
You must be signed in to change notification settings - Fork 104
Correctly build URLs to file paths containing spaces #364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly build URLs to file paths containing spaces #364
Conversation
WalkthroughThe update changes the logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SearchAPI
User->>SearchAPI: Call getFileWebUrl(branch, fileName)
SearchAPI->>SearchAPI: Split template string
loop For each part in split template
SearchAPI->>SearchAPI: If part == .Version, replace with branch
SearchAPI->>SearchAPI: If part == .Path, replace with fileName
SearchAPI->>SearchAPI: Otherwise, keep part as is
end
SearchAPI->>User: Return constructed URL
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice LGTM, thanks for the fix 👍 Just tested it and works.
Mind adding a entry to the Changelog?
Previously, such paths would have their spaces replaced with `/`s, breaking external links to the file. Fixes sourcebot-dev#249
6e9735b
to
f164469
Compare
Done and rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG.md (1)
8-12
: Include the related issue number for full traceabilityThe new entry mentions the fixing PR (#364) but omits the underlying issue (#249) called out in the PR description. Other entries typically reference both the issue and the PR, so adding it keeps the changelog consistent and easier to follow.
- - Fixed issue with external source code links being broken for paths with spaces. [#364](https://github.com/sourcebot-dev/sourcebot/pull/364) + - Fixed issue with external source code links being broken for paths with spaces. [#249](https://github.com/sourcebot-dev/sourcebot/issues/249) [#364](https://github.com/sourcebot-dev/sourcebot/pull/364)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md
(1 hunks)packages/web/src/features/search/searchApi.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/web/src/features/search/searchApi.ts
🧰 Additional context used
📓 Path-based instructions (1)
`**/*`: Filenames should always be camelCase. Exception: if there are filenames in the same directory with a format other than camelCase, use that format to keep things consistent.
**/*
: Filenames should always be camelCase. Exception: if there are filenames in the same directory with a format other than camelCase, use that format to keep things consistent.
CHANGELOG.md
🪛 LanguageTool
CHANGELOG.md
[duplication] ~10-~10: Possible typo: you repeated a word.
Context: ...pec/v2.0.0.html). ## [Unreleased] ### Fixed - Fixed issue with external source code links b...
(ENGLISH_WORD_REPEAT_RULE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
Previously, such paths would have their spaces replaced with
/
s, breaking external links to the file.Fixes #249
I haven't tested this yet.
Summary by CodeRabbit