Skip to content

Commit 12197e3

Browse files
fix(backend): strip /browse suffix from Bitbucket Server webUrl (#877)
* fix(backend): strip /browse suffix from Bitbucket Server webUrl Bitbucket Server's API returns a self link that includes `/browse` at the end. This caused duplicate `/browse` segments when constructing file URLs and incorrect paths for commit URLs. Fixes #876 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add changelog entry for Bitbucket Server URL fix Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add branch naming and PR conventions to CLAUDE.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add changelog update step to PR conventions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: clarify MCP changelog location Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c402b63 commit 12197e3

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Changed the me-control to render the user's avatar in the top-bar. [#874](https://github.com/sourcebot-dev/sourcebot/pull/874)
1212
- Moved the "current version" indicator into the "what's new" dropdown. [#874](https://github.com/sourcebot-dev/sourcebot/pull/874)
1313

14+
### Fixed
15+
- Fixed issue where "Open in Bitbucket" and commit links for Bitbucket Server repos had an extra `/browse` in the URL. [#877](https://github.com/sourcebot-dev/sourcebot/pull/877)
16+
1417
### Removed
1518
- Removed the Discord and GitHub buttons from the top corner. [#874](https://github.com/sourcebot-dev/sourcebot/pull/874)
1619

CLAUDE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,21 @@ className="border-border bg-card text-foreground text-muted-foreground bg-muted
2929
// Incorrect
3030
className="border-[var(--border)] bg-[var(--card)] text-[var(--foreground)]"
3131
```
32+
33+
## Branches and Pull Requests
34+
35+
When creating a branch or opening a PR, ask the user for:
36+
1. The Linear issue ID (if available)
37+
2. The GitHub issue number (if available)
38+
39+
Branch naming convention:
40+
- General: `<username>/<branch_name>-<linear_issue_id>`
41+
- Bug fixes: `<username>/fix-<linear_issue_id>`
42+
- If no Linear issue ID is available, omit it from the branch name
43+
44+
PR description:
45+
- If a GitHub issue number was provided, include `Fixes #<github_issue_number>` in the PR description
46+
47+
After the PR is created:
48+
- Update CHANGELOG.md with an entry under `[Unreleased]` linking to the new PR
49+
- If the change touches `packages/mcp`, update `packages/mcp/CHANGELOG.md` instead

packages/backend/src/repoCompileUtils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,12 @@ export const compileBitbucketConfig = async (
443443
throw new Error(`No ${isServer ? 'self' : 'html'} link found for ${isServer ? 'server' : 'cloud'} repo ${repoName}`);
444444
}
445445

446-
return link.href;
446+
// @note: Bitbucket Server's self link includes `/browse` at the end.
447+
// Strip it so that we can simply append either `/browse`, `/commits`, etc. to
448+
// the base URL.
449+
const href = isServer ? link.href.replace(/\/browse\/?$/, '') : link.href;
450+
451+
return href;
447452
}
448453

449454
const repos = bitbucketRepos.map((repo) => {

0 commit comments

Comments
 (0)