Skip to content

Commit fe35ef8

Browse files
Merge branch 'main' into svedin/bitbucket-server-sync-all-repos
2 parents a467bb9 + 9173835 commit fe35ef8

File tree

61 files changed

+2025
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2025
-191
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Claude Bug Fixer
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
jobs:
8+
claude-fix-bug:
9+
if: github.event.label.name == 'bug'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
issues: write
15+
id-token: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Run Claude Bug Fixer
24+
id: claude-bug-fixer
25+
uses: anthropics/claude-code-action@v1
26+
with:
27+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
28+
allowed_tools: 'Bash,Read,Write,Edit,Glob,Grep'
29+
prompt: |
30+
A bug has been reported in issue #${{ github.event.issue.number }}.
31+
32+
Issue title: ${{ github.event.issue.title }}
33+
Issue body:
34+
${{ github.event.issue.body }}
35+
36+
Please do the following:
37+
1. Analyze the issue carefully to understand the bug being reported.
38+
2. Explore the codebase to find the relevant code that is likely causing the bug.
39+
3. Implement a fix for the bug.
40+
4. Create a new branch named `fix/issue-${{ github.event.issue.number }}` from main.
41+
5. Commit your changes to that branch with a descriptive commit message.
42+
6. Open a **draft** pull request targeting the main branch with:
43+
- A clear title summarizing the fix
44+
- A description explaining what the bug was and how you fixed it
45+
- `Fixes #${{ github.event.issue.number }}` in the PR body
46+
47+
Important guidelines:
48+
- Only change code that is directly related to fixing the reported bug. Do not refactor or make unrelated improvements.
49+
- If you cannot determine the root cause or the fix is too risky/complex, leave a comment on the issue explaining what you found and why an automated fix isn't appropriate.
50+
- Make sure the fix is complete and the code compiles/passes linting before opening the PR.

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
4040
plugins: 'code-review@claude-code-plugins'
4141
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
42+
allowed_bots: '*'
4243
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4344
# or https://code.claude.com/docs/en/cli-reference for available options
4445

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Deploy to Railway
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Release Sourcebot (Development)"]
6+
types: [completed]
7+
8+
concurrency:
9+
group: deploy-railway
10+
cancel-in-progress: false
11+
12+
jobs:
13+
deploy:
14+
name: Deploy to Railway
15+
runs-on: ubuntu-latest
16+
container: ghcr.io/railwayapp/cli:latest
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
env:
19+
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
20+
21+
steps:
22+
- name: Deploy image to Railway
23+
run: railway redeploy --service=sourcebot --yes

.github/workflows/release-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
- name: Commit changes
135135
run: |
136136
git add CHANGELOG.md packages/shared/src/version.ts
137-
git commit -m "Release v$VERSION"
137+
git commit -m "[skip ci] Release v$VERSION"
138138
139139
- name: Push to temporary branch
140140
id: push_temp_branch
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tag Linear Issues with Release
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Release Sourcebot (Production)"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
tag-linear-issues:
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
ref: main
21+
fetch-depth: 0
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "24"
27+
28+
- name: Extract version from release
29+
id: extract_version
30+
run: |
31+
# Get the latest version from CHANGELOG.md (first non-Unreleased version)
32+
VERSION=$(grep -oP '## \[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md | head -n 1)
33+
34+
if [ -z "$VERSION" ]; then
35+
echo "Error: Could not extract version from CHANGELOG.md"
36+
exit 1
37+
fi
38+
39+
echo "Detected version: $VERSION"
40+
echo "version=$VERSION" >> $GITHUB_OUTPUT
41+
42+
- name: Tag Linear issues
43+
env:
44+
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
45+
LINEAR_TEAM_ID: ${{ secrets.LINEAR_TEAM_ID }}
46+
run: |
47+
node scripts/tagLinearIssuesWithRelease.mjs "${{ steps.extract_version.outputs.version }}"

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- Added PostHog events for chat UI interactions (details card expand/collapse, copy answer, table of contents toggle) and repo tracking in `wa_chat_message_sent`. [#922](https://github.com/sourcebot-dev/sourcebot/pull/922)
12+
- Added Bitbucket Cloud OAuth identity provider support (`provider: "bitbucket-cloud"`) for SSO and account-linked permission syncing. [#924](https://github.com/sourcebot-dev/sourcebot/pull/924)
13+
- Added permission syncing support for Bitbucket Cloud. [#925](https://github.com/sourcebot-dev/sourcebot/pull/925)
14+
15+
### Changed
16+
- Hide version upgrade toast for askgithub deployment (`EXPERIMENT_ASK_GH_ENABLED`). [#931](https://github.com/sourcebot-dev/sourcebot/pull/931)
17+
18+
### Fixed
19+
- Fixed text inside angle brackets (e.g., `<id>`) being hidden in chat prompt display due to HTML parsing. [#929](https://github.com/sourcebot-dev/sourcebot/pull/929) [#932](https://github.com/sourcebot-dev/sourcebot/pull/932)
20+
21+
## [4.11.7] - 2026-02-23
22+
23+
### Changed
24+
- Skip redundant dev build when production release commits are pushed to main. [#919](https://github.com/sourcebot-dev/sourcebot/pull/919)
25+
- Bumped zoekt version. [#921](https://github.com/sourcebot-dev/sourcebot/pull/921)
26+
27+
## [4.11.6] - 2026-02-21
28+
29+
### Added
30+
- Added GitHub workflow to automatically tag Linear issues with the release version when a new release is published. [#917](https://github.com/sourcebot-dev/sourcebot/pull/917)
31+
- Added optional `gitUser` field to the Bitbucket connection config to support Bitbucket Cloud API tokens, which require an email address for the REST API but an Atlassian username for git clone. [#918](https://github.com/sourcebot-dev/sourcebot/pull/918)
32+
33+
## [4.11.5] - 2026-02-21
34+
35+
### Fixed
36+
- Skip calling `getCommitHashForRefName` for empty repositories to avoid noisy debug log output. [#914](https://github.com/sourcebot-dev/sourcebot/pull/914)
37+
- Fixed "Open in GitLab" links having a double slash when the GitLab host URL is configured with a trailing slash. [#915](https://github.com/sourcebot-dev/sourcebot/pull/915)
38+
1039
## [4.11.4] - 2026-02-20
1140

1241
### Fixed

CLAUDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,22 @@ Branch naming convention:
193193
- Bug fixes: `<username>/fix-<linear_issue_id>`
194194
- If no Linear issue ID is available, omit it from the branch name
195195

196+
PR title should follow conventional commit standards:
197+
- `feat:` new feature or functionality
198+
- `fix:` bug fix
199+
- `docs:` documentation or README changes
200+
- `chore:` maintenance tasks, dependency updates, etc.
201+
- `refactor:` code refactoring without changing behavior
202+
- `test:` adding or updating tests
203+
204+
You can optionally include a scope to indicate which package is affected:
205+
- `feat(web):` feature in the web package
206+
- `fix(worker):` bug fix in the worker package (`backend/`)
207+
196208
PR description:
197209
- If a GitHub issue number was provided, include `Fixes #<github_issue_number>` in the PR description
198210

199211
After the PR is created:
200212
- Update CHANGELOG.md with an entry under `[Unreleased]` linking to the new PR. New entries should be placed at the bottom of their section.
201213
- If the change touches `packages/mcp`, update `packages/mcp/CHANGELOG.md` instead
214+
- Do NOT add a CHANGELOG entry for documentation-only changes (e.g., changes only in `docs/`)

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"group": "Deployment",
2626
"pages": [
2727
"docs/deployment/docker-compose",
28-
"docs/deployment/k8s"
28+
"docs/deployment/k8s",
29+
"docs/deployment/sizing-guide"
2930
]
3031
}
3132
]

docs/docs/configuration/idp.mdx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,59 @@ in the GitLab identity provider config.
165165
</Steps>
166166
</Accordion>
167167

168+
### Bitbucket Cloud
169+
170+
[Auth.js Bitbucket Provider Docs](https://authjs.dev/getting-started/providers/bitbucket)
171+
172+
A Bitbucket Cloud connection can be used for [authentication](/docs/configuration/auth) and/or [permission syncing](/docs/features/permission-syncing). This is controlled using the `purpose` field
173+
in the Bitbucket Cloud identity provider config.
174+
175+
<Accordion title="instructions">
176+
<Steps>
177+
<Step title="Register an OAuth Consumer">
178+
To begin, you must register an OAuth consumer in Bitbucket to facilitate the identity provider connection.
179+
180+
Navigate to your Bitbucket workspace settings at `https://bitbucket.org/<your-workspace>/workspace/settings/api` and create a new **OAuth consumer** under the **OAuth consumers** section.
181+
182+
When configuring your consumer:
183+
- Set the callback URL to `<sourcebot_url>/api/auth/callback/bitbucket-cloud` (ex. https://sourcebot.coolcorp.com/api/auth/callback/bitbucket-cloud)
184+
- Enable **Account: Read**
185+
- If using for permission syncing, also enable **Repositories: Read**
186+
187+
The result of creating an OAuth consumer is a `Key` (`CLIENT_ID`) and `Secret` (`CLIENT_SECRET`) which you'll provide to Sourcebot.
188+
</Step>
189+
<Step title="Define environment variables">
190+
To provide Sourcebot the client id and secret for your OAuth consumer you must set them as environment variables. These can be named whatever you like
191+
(ex. `BITBUCKET_CLOUD_IDENTITY_PROVIDER_CLIENT_ID` and `BITBUCKET_CLOUD_IDENTITY_PROVIDER_CLIENT_SECRET`)
192+
</Step>
193+
<Step title="Define the identity provider config">
194+
Finally, pass the client id and secret to Sourcebot by defining a `identityProvider` object in the [config file](/docs/configuration/config-file):
195+
196+
```json wrap icon="code"
197+
{
198+
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
199+
"identityProviders": [
200+
{
201+
"provider": "bitbucket-cloud",
202+
// "sso" for auth + perm sync, "account_linking" for only perm sync
203+
"purpose": "account_linking",
204+
// if purpose == "account_linking" this controls if a user must connect to the IdP
205+
"accountLinkingRequired": true,
206+
"clientId": {
207+
"env": "YOUR_CLIENT_ID_ENV_VAR"
208+
},
209+
"clientSecret": {
210+
"env": "YOUR_CLIENT_SECRET_ENV_VAR"
211+
}
212+
}
213+
]
214+
}
215+
```
216+
</Step>
217+
</Steps>
218+
</Accordion>
219+
220+
168221
### Google
169222

170223
[Auth.js Google Provider Docs](https://authjs.dev/getting-started/providers/google)

docs/docs/connections/bitbucket-cloud.mdx

Lines changed: 93 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ sidebarTitle: Bitbucket Cloud
44
icon: Bitbucket
55
---
66

7-
import BitbucketToken from '/snippets/bitbucket-token.mdx';
8-
import BitbucketAppPassword from '/snippets/bitbucket-app-password.mdx';
97
import BitbucketSchema from '/snippets/schemas/v3/bitbucket.schema.mdx'
108

119
<Note>
@@ -78,25 +76,107 @@ If you're not familiar with Sourcebot [connections](/docs/connections/overview),
7876

7977
## Authenticating with Bitbucket Cloud
8078

81-
In order to index private repositories, you'll need to provide authentication credentials via a [token](/docs/configuration/config-file#tokens). You can do this using an `App Password` or an `Access Token`
79+
In order to index private repositories, you'll need to provide authentication credentials via a [token](/docs/configuration/config-file#tokens). You can do this using an `API Token`, `Access Token`, or `App Password`.
8280

8381
<Tabs>
84-
<Tab title="App Password">
85-
Navigate to the [app password creation page](https://bitbucket.org/account/settings/app-passwords/) and create an app password. Ensure that it has the proper permissions for the scope
86-
of info you want to fetch (i.e. workspace, project, and/or repo level)
87-
![Bitbucket App Password Permissions](/images/bitbucket_app_password_perms.png)
88-
89-
Next, provide your username + app password pair to Sourcebot:
90-
91-
<BitbucketAppPassword />
82+
<Tab title="API Token">
83+
1. Navigate to [Personal Settings → API tokens](https://id.atlassian.com/manage-profile/security/api-tokens) and click **Create API token with scopes**. Give the token a name and set an expiry date.
84+
85+
2. Select **Bitbucket** as the app.
86+
87+
3. Select the following scopes:
88+
- `read:repository:bitbucket` — View your repositories
89+
- `read:workspace:bitbucket` — View your workspaces
90+
91+
4. Click **Create token** and copy the token value.
92+
93+
5. Add the `user` (your account email), `gitUser` (your Bitbucket username), and `token` to your connection config. [Learn why both are needed](https://support.atlassian.com/bitbucket-cloud/docs/using-api-tokens/)
94+
95+
```json
96+
{
97+
"type": "bitbucket",
98+
"deploymentType": "cloud",
99+
"user": "you@example.com",
100+
"gitUser": "myusername",
101+
"token": {
102+
// note: this env var can be named anything. It
103+
// doesn't need to be `BITBUCKET_TOKEN`.
104+
"env": "BITBUCKET_TOKEN"
105+
}
106+
// .. rest of config ..
107+
}
108+
```
109+
110+
6. Pass this environment variable each time you run Sourcebot:
111+
112+
```bash
113+
docker run \
114+
-e BITBUCKET_TOKEN=<API_TOKEN> \
115+
/* additional args */ \
116+
ghcr.io/sourcebot-dev/sourcebot:latest
117+
```
92118
</Tab>
93119
<Tab title="Access Token">
94120
Create an access token for the desired scope (repo, project, or workspace). Visit the official [Bitbucket Cloud docs](https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/)
95121
for more info.
96122

97-
Next, provide the access token to Sourcebot:
123+
1. Add the `token` property to your connection config:
124+
125+
```json
126+
{
127+
"type": "bitbucket",
128+
"deploymentType": "cloud",
129+
"token": {
130+
// note: this env var can be named anything. It
131+
// doesn't need to be `BITBUCKET_TOKEN`.
132+
"env": "BITBUCKET_TOKEN"
133+
}
134+
// .. rest of config ..
135+
}
136+
```
137+
138+
2. Pass this environment variable each time you run Sourcebot:
139+
140+
```bash
141+
docker run \
142+
-e BITBUCKET_TOKEN=<ACCESS_TOKEN> \
143+
/* additional args */ \
144+
ghcr.io/sourcebot-dev/sourcebot:latest
145+
```
146+
</Tab>
147+
<Tab title="App Password">
148+
<Warning>
149+
App Passwords are deprecated. Atlassian recommends migrating to API tokens. [Learn more](https://www.atlassian.com/blog/bitbucket/bitbucket-cloud-transitions-to-api-tokens-enhancing-security-with-app-password-deprecation)
150+
</Warning>
151+
152+
Navigate to the [app password creation page](https://bitbucket.org/account/settings/app-passwords/) and create an app password. Ensure that it has the proper permissions for the scope
153+
of info you want to fetch (i.e. workspace, project, and/or repo level)
154+
![Bitbucket App Password Permissions](/images/bitbucket_app_password_perms.png)
98155

99-
<BitbucketToken />
156+
1. Add the `user` (your Bitbucket username) and `token` properties to your connection config:
157+
158+
```json
159+
{
160+
"type": "bitbucket",
161+
"deploymentType": "cloud",
162+
"user": "myusername",
163+
"token": {
164+
// note: this env var can be named anything. It
165+
// doesn't need to be `BITBUCKET_TOKEN`.
166+
"env": "BITBUCKET_TOKEN"
167+
}
168+
// .. rest of config ..
169+
}
170+
```
171+
172+
2. Pass this environment variable each time you run Sourcebot:
173+
174+
```bash
175+
docker run \
176+
-e BITBUCKET_TOKEN=<APP_PASSWORD> \
177+
/* additional args */ \
178+
ghcr.io/sourcebot-dev/sourcebot:latest
179+
```
100180
</Tab>
101181
</Tabs>
102182

0 commit comments

Comments
 (0)