diff --git a/CHANGELOG.md b/CHANGELOG.md index e28ac8b48..438911ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed the me-control to render the user's avatar in the top-bar. [#874](https://github.com/sourcebot-dev/sourcebot/pull/874) - Moved the "current version" indicator into the "what's new" dropdown. [#874](https://github.com/sourcebot-dev/sourcebot/pull/874) +### Fixed +- 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) + ### Removed - Removed the Discord and GitHub buttons from the top corner. [#874](https://github.com/sourcebot-dev/sourcebot/pull/874) diff --git a/CLAUDE.md b/CLAUDE.md index 2ff8c9615..85e88aaad 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -29,3 +29,21 @@ className="border-border bg-card text-foreground text-muted-foreground bg-muted // Incorrect className="border-[var(--border)] bg-[var(--card)] text-[var(--foreground)]" ``` + +## Branches and Pull Requests + +When creating a branch or opening a PR, ask the user for: +1. The Linear issue ID (if available) +2. The GitHub issue number (if available) + +Branch naming convention: +- General: `/-` +- Bug fixes: `/fix-` +- If no Linear issue ID is available, omit it from the branch name + +PR description: +- If a GitHub issue number was provided, include `Fixes #` in the PR description + +After the PR is created: +- Update CHANGELOG.md with an entry under `[Unreleased]` linking to the new PR +- If the change touches `packages/mcp`, update `packages/mcp/CHANGELOG.md` instead diff --git a/packages/backend/src/repoCompileUtils.ts b/packages/backend/src/repoCompileUtils.ts index 12b2a6caf..7ff12c622 100644 --- a/packages/backend/src/repoCompileUtils.ts +++ b/packages/backend/src/repoCompileUtils.ts @@ -443,7 +443,12 @@ export const compileBitbucketConfig = async ( throw new Error(`No ${isServer ? 'self' : 'html'} link found for ${isServer ? 'server' : 'cloud'} repo ${repoName}`); } - return link.href; + // @note: Bitbucket Server's self link includes `/browse` at the end. + // Strip it so that we can simply append either `/browse`, `/commits`, etc. to + // the base URL. + const href = isServer ? link.href.replace(/\/browse\/?$/, '') : link.href; + + return href; } const repos = bitbucketRepos.map((repo) => {