You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
## [Unreleased]
9
9
10
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)
11
+
- Added PostHog events for chat UI interactions (details card expand/collapse, copy answer, table of contents toggle). [#922](https://github.com/sourcebot-dev/sourcebot/pull/922)
12
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
13
- Added permission syncing support for Bitbucket Cloud. [#925](https://github.com/sourcebot-dev/sourcebot/pull/925)
14
14
- Added `wa_user_created` PostHog event fired on successful user sign-up. [#933](https://github.com/sourcebot-dev/sourcebot/pull/933)
15
15
- Added `wa_askgh_login_wall_prompted` PostHog event fired when an unauthenticated user attempts to ask a question on Ask GitHub. [#933](https://github.com/sourcebot-dev/sourcebot/pull/933)
16
16
- Added Bitbucket Server (Data Center) OAuth 2.0 SSO identity provider support (`provider: "bitbucket-server"`). [#934](https://github.com/sourcebot-dev/sourcebot/pull/934)
17
17
- Added `GET /api/ee/user` endpoint that returns the authenticated owner's user info (name, email, createdAt, updatedAt). [#940](https://github.com/sourcebot-dev/sourcebot/pull/940)
18
+
- Added `selectedReposCount` to the `wa_chat_message_sent` PostHog event to track the number of selected repositories when users ask questions. [#941](https://github.com/sourcebot-dev/sourcebot/pull/941)
18
19
19
20
### Changed
20
21
- Hide version upgrade toast for askgithub deployment (`EXPERIMENT_ASK_GH_ENABLED`). [#931](https://github.com/sourcebot-dev/sourcebot/pull/931)
21
22
22
23
### Fixed
23
24
- 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)
24
-
- Fixed 6 unused import/variable build warnings in the web package. [#935](https://github.com/sourcebot-dev/sourcebot/pull/935)
Copy file name to clipboardExpand all lines: docs/docs/configuration/idp.mdx
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,9 +74,11 @@ in the GitHub identity provider config.
74
74
- `"Metadata" repository permissions (read)` (only needed if using permission syncing)
75
75
</Tab>
76
76
<Tabtitle="GitHub OAuth App">
77
-
Follow [this guide](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) by GitHub to create an OAuth App.
78
-
77
+
Follow [this guide](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) by GitHub to create an OAuth App.
78
+
79
79
When asked to provide a callback url, provide `<sourcebot_url>/api/auth/callback/github` (ex. https://sourcebot.coolcorp.com/api/auth/callback/github)
80
+
81
+
If [permission syncing](/docs/features/permission-syncing#github) is enabled, also enable the `repo` scope.
80
82
</Tab>
81
83
</Tabs>
82
84
</Step>
@@ -128,7 +130,7 @@ in the GitLab identity provider config.
128
130
When configuring your application:
129
131
- Set the callback URL to `<sourcebot_url>/api/auth/callback/gitlab` (ex. https://sourcebot.coolcorp.com/api/auth/callback/gitlab)
130
132
- Enable the `read_user` scope
131
-
- If using for permission syncing, also enable the `read_api` scope
133
+
- If [permission syncing](/docs/features/permission-syncing#gitlab) is enabled, also enable the `read_api` scope
132
134
133
135
The result of registering an OAuth application is an `APPLICATION_ID` (`CLIENT_ID`) and `SECRET` (`CLIENT_SECRET`) which you'll provide to Sourcebot.
134
136
</Step>
@@ -182,7 +184,7 @@ in the Bitbucket Cloud identity provider config.
182
184
When configuring your consumer:
183
185
- Set the callback URL to `<sourcebot_url>/api/auth/callback/bitbucket-cloud` (ex. https://sourcebot.coolcorp.com/api/auth/callback/bitbucket-cloud)
184
186
- Enable **Account: Read**
185
-
- If using for permission syncing, also enable **Repositories: Read**
187
+
- If [permission syncing](/docs/features/permission-syncing#bitbucket-cloud) is enabled, also enable **Repositories: Read**
186
188
187
189
The result of creating an OAuth consumer is a `Key` (`CLIENT_ID`) and `Secret` (`CLIENT_SECRET`) which you'll provide to Sourcebot.
188
190
</Step>
@@ -220,7 +222,8 @@ in the Bitbucket Cloud identity provider config.
220
222
221
223
### Bitbucket Server
222
224
223
-
A Bitbucket Server (Data Center) connection can be used for [authentication](/docs/configuration/auth).
225
+
A Bitbucket Server (Data Center) connection can be used for [authentication](/docs/configuration/auth) and/or [permission syncing](/docs/features/permission-syncing). This is controlled using the `purpose` field
226
+
in the Bitbucket Server identity provider config.
224
227
225
228
<Accordiontitle="instructions">
226
229
<Steps>
@@ -231,6 +234,7 @@ A Bitbucket Server (Data Center) connection can be used for [authentication](/do
231
234
232
235
When configuring your application:
233
236
- Set the redirect URL to `<sourcebot_url>/api/auth/callback/bitbucket-server` (ex. https://sourcebot.coolcorp.com/api/auth/callback/bitbucket-server)
237
+
- If [permission syncing](/docs/features/permission-syncing#bitbucket-data-center) is enabled, also enable the `REPO_READ` scope
234
238
235
239
The result of creating the application is a `CLIENT_ID` and `CLIENT_SECRET` which you'll provide to Sourcebot.
236
240
</Step>
@@ -247,7 +251,10 @@ A Bitbucket Server (Data Center) connection can be used for [authentication](/do
247
251
"identityProviders": [
248
252
{
249
253
"provider": "bitbucket-server",
250
-
"purpose": "sso",
254
+
// "sso" for auth + perm sync, "account_linking" for only perm sync
255
+
"purpose": "account_linking",
256
+
// if purpose == "account_linking" this controls if a user must connect to the IdP
Copy file name to clipboardExpand all lines: docs/docs/connections/bitbucket-data-center.mdx
+81-29Lines changed: 81 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,18 @@ If you're not familiar with Sourcebot [connections](/docs/connections/overview),
39
39
}
40
40
```
41
41
</Accordion>
42
+
<Accordiontitle="Sync all repos">
43
+
<Note>Requires a `token` to be set in order to access private repositories.</Note>
44
+
```json
45
+
{
46
+
"type": "bitbucket",
47
+
"deploymentType": "server",
48
+
"url": "https://mybitbucketdeployment.com",
49
+
// Index all repos visible to the provided token
50
+
"all": true
51
+
}
52
+
```
53
+
</Accordion>
42
54
<Accordiontitle="Exclude repos from syncing">
43
55
```json
44
56
{
@@ -68,35 +80,75 @@ If you're not familiar with Sourcebot [connections](/docs/connections/overview),
68
80
69
81
## Authenticating with Bitbucket Data Center
70
82
71
-
In order to index private repositories, you'll need to provide an access token to Sourcebot via a [token](/docs/configuration/config-file#tokens).
72
-
73
-
Create an access token for the desired scope (repo, project, or workspace). Visit the official [Bitbucket Data Center docs](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html)
74
-
for more info.
75
-
76
-
1. Add the `token` property to your connection config:
77
-
78
-
```json
79
-
{
80
-
"type": "bitbucket",
81
-
"deploymentType": "server",
82
-
"url": "https://mybitbucketdeployment.com",
83
-
"token": {
84
-
// note: this env var can be named anything. It
85
-
// doesn't need to be `BITBUCKET_TOKEN`.
86
-
"env": "BITBUCKET_TOKEN"
87
-
}
88
-
// .. rest of config ..
89
-
}
90
-
```
91
-
92
-
2. Pass this environment variable each time you run Sourcebot:
93
-
94
-
```bash
95
-
docker run \
96
-
-e BITBUCKET_TOKEN=<ACCESS_TOKEN> \
97
-
/* additional args */ \
98
-
ghcr.io/sourcebot-dev/sourcebot:latest
99
-
```
83
+
In order to index private repositories, you'll need to provide a [HTTP Access Token](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html). Tokens can be scoped to a user account, a project, or an individual repository. Only repositories visible to the token will be able to be indexed by Sourcebot.
84
+
85
+
<Note>
86
+
If [permission syncing](/docs/features/permission-syncing#bitbucket-data-center) is enabled, the token must have **Repository Admin** permissions so Sourcebot can read repository-level user permissions.
87
+
</Note>
88
+
89
+
<Tabs>
90
+
<Tabtitle="User account token">
91
+
User account tokens grant access to all repositories the user can access. Because these are tied to a specific user account, you must also set the `user` field to that user's username.
92
+
93
+
1. In Bitbucket Data Center, navigate to your profile → **Manage account** → **HTTP access tokens** and click **Create token**. Give it a name and grant it **Project read** and **Repository read** permissions.
94
+
95
+
2. Add the `user` (your Bitbucket username) and `token` properties to your connection config:
96
+
97
+
```json
98
+
{
99
+
"type": "bitbucket",
100
+
"deploymentType": "server",
101
+
"url": "https://mybitbucketdeployment.com",
102
+
"user": "myusername",
103
+
"token": {
104
+
// note: this env var can be named anything. It
105
+
// doesn't need to be `BITBUCKET_TOKEN`.
106
+
"env": "BITBUCKET_TOKEN"
107
+
}
108
+
// .. rest of config ..
109
+
}
110
+
```
111
+
112
+
3. Pass this environment variable each time you run Sourcebot:
113
+
114
+
```bash
115
+
docker run \
116
+
-e BITBUCKET_TOKEN=<ACCESS_TOKEN> \
117
+
/* additional args */ \
118
+
ghcr.io/sourcebot-dev/sourcebot:latest
119
+
```
120
+
</Tab>
121
+
<Tabtitle="Project / repository token">
122
+
Project and repository tokens are scoped to a specific project or repository.
123
+
124
+
1. In Bitbucket Data Center, navigate to the project or repository → **Settings** → **HTTP access tokens** and click **Create token**. Give it a name and grant it **Repository read** and **Project read** permissions.
125
+
126
+
2. Add the `token` property to your connection config:
127
+
128
+
```json
129
+
{
130
+
"type": "bitbucket",
131
+
"deploymentType": "server",
132
+
"url": "https://mybitbucketdeployment.com",
133
+
"token": {
134
+
// note: this env var can be named anything. It
135
+
// doesn't need to be `BITBUCKET_TOKEN`.
136
+
"env": "BITBUCKET_TOKEN"
137
+
}
138
+
// .. rest of config ..
139
+
}
140
+
```
141
+
142
+
3. Pass this environment variable each time you run Sourcebot:
143
+
144
+
```bash
145
+
docker run \
146
+
-e BITBUCKET_TOKEN=<ACCESS_TOKEN> \
147
+
/* additional args */ \
148
+
ghcr.io/sourcebot-dev/sourcebot:latest
149
+
```
150
+
</Tab>
151
+
</Tabs>
100
152
101
153
## Troubleshooting
102
154
If you're seeing errors like `TypeError: fetch failed` when fetching repo info, it may be that Sourcebot is refusing to connect to your self-hosted Bitbucket instance due to unrecognized SSL certs. Try setting the `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable or providing Sourcebot your certs through the `NODE_EXTRA_CA_CERTS` environment variable.
|[Bitbucket Data Center](/docs/features/permission-syncing#bitbucket-data-center)|🟠 Partial|
44
44
| Gitea | 🛑 |
45
45
| Gerrit | 🛑 |
46
46
| Generic git host | 🛑 |
@@ -50,7 +50,8 @@ We are actively working on supporting more code hosts. If you'd like to see a sp
50
50
## GitHub
51
51
52
52
Prerequisites:
53
-
- Configure GitHub as an [external identity provider](/docs/configuration/idp).
53
+
- Configure a [GitHub connection](/docs/connections/github).
54
+
- Configure GitHub as an [external identity provider](/docs/configuration/idp#github).
54
55
-**If you are using a self-hosted GitHub instance**, you must also set the `baseUrl` property of the `github` identity provider in the [config file](/docs/configuration/config-file) to the base URL of your GitHub instance (e.g. `https://github.example.com`).
55
56
56
57
Permission syncing works with **GitHub.com**, **GitHub Enterprise Cloud**, and **GitHub Enterprise Server**. For organization-owned repositories, users that have **read-only** access (or above) via the following methods will have their access synced to Sourcebot:
@@ -61,27 +62,29 @@ Permission syncing works with **GitHub.com**, **GitHub Enterprise Cloud**, and *
61
62
- Organization owners.
62
63
63
64
**Notes:**
64
-
- A GitHub [external identity provider](/docs/configuration/idp) must be configured to (1) correlate a Sourcebot user with a GitHub user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
65
+
- A GitHub [external identity provider](/docs/configuration/idp#github) must be configured to (1) correlate a Sourcebot user with a GitHub user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
65
66
- OAuth tokens must assume the `repo` scope in order to use the [List repositories for the authenticated user API](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user) during [User driven syncing](/docs/features/permission-syncing#how-it-works). Sourcebot **will only** use this token for **reads**.
66
67
67
68
## GitLab
68
69
69
70
Prerequisites:
70
-
- Configure GitLab as an [external identity provider](/docs/configuration/idp).
71
+
- Configure a [GitLab connection](/docs/connections/gitlab).
72
+
- Configure GitLab as an [external identity provider](/docs/configuration/idp#gitlab).
71
73
-**If you are using a self-hosted GitLab instance**, you must also set the `baseUrl` property of the `gitlab` identity provider in the [config file](/docs/configuration/config-file) to the base URL of your GitLab instance (e.g. `https://gitlab.example.com`).
72
74
73
75
Permission syncing works with **GitLab Self-managed** and **GitLab Cloud**. Users with **Guest** role or above with membership to a group or project will have their access synced to Sourcebot. Both direct and indirect membership to a group or project will be synced with Sourcebot. For more details, see the [GitLab docs](https://docs.gitlab.com/user/project/members/#membership-types).
74
76
75
77
76
78
**Notes:**
77
-
- A GitLab [external identity provider](/docs/configuration/idp) must be configured to (1) correlate a Sourcebot user with a GitLab user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
79
+
- A GitLab [external identity provider](/docs/configuration/idp#gitlab) must be configured to (1) correlate a Sourcebot user with a GitLab user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
78
80
- OAuth tokens require the `read_api` scope in order to use the [List projects for the authenticated user API](https://docs.gitlab.com/ee/api/projects.html#list-all-projects) during [User driven syncing](/docs/features/permission-syncing#how-it-works).
79
81
-[Internal GitLab projects](https://docs.gitlab.com/user/public_access/#internal-projects-and-groups) are **not** enforced by permission syncing and therefore are visible to all users. Only [private projects](https://docs.gitlab.com/user/public_access/#private-projects-and-groups) are enforced.
80
82
81
83
## Bitbucket Cloud
82
84
83
85
Prerequisites:
84
-
- Configure Bitbucket Cloud as an [external identity provider](/docs/configuration/idp).
86
+
- Configure a [Bitbucket Cloud connection](/docs/connections/bitbucket-cloud).
87
+
- Configure Bitbucket Cloud as an [external identity provider](/docs/configuration/idp#bitbucket-cloud).
85
88
86
89
Permission syncing works with **Bitbucket Cloud**. OAuth tokens must assume the `account` and `repository` scopes.
87
90
@@ -98,9 +101,33 @@ If your workspace relies heavily on group or project-level permissions rather th
98
101
</Warning>
99
102
100
103
**Notes:**
101
-
- A Bitbucket Cloud [external identity provider](/docs/configuration/idp) must be configured to (1) correlate a Sourcebot user with a Bitbucket Cloud user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
104
+
- A Bitbucket Cloud [external identity provider](/docs/configuration/idp#bitbucket-cloud) must be configured to (1) correlate a Sourcebot user with a Bitbucket Cloud user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
102
105
- OAuth tokens require the `account` and `repository` scopes. The `repository` scope is required to list private repositories during [User driven syncing](/docs/features/permission-syncing#how-it-works).
103
106
107
+
## Bitbucket Data Center
108
+
109
+
Prerequisites:
110
+
- Configure a [Bitbucket Data Center connection](/docs/connections/bitbucket-data-center).
111
+
- Configure Bitbucket Data Center as an [external identity provider](/docs/configuration/idp#bitbucket-server).
112
+
113
+
Permission syncing works with **Bitbucket Data Center**. OAuth tokens must assume the `PUBLIC_REPOS` and `REPO_READ` scopes.
114
+
115
+
<Warning>
116
+
**Partial coverage for repo-driven syncing.** Repo-driven syncing only captures users who have been **directly and explicitly** granted access to the repository. Users who have access via any of the following are **not** captured by repo-driven syncing:
117
+
118
+
- Project-level permissions (inherited by all repos in the project)
119
+
- Group membership
120
+
121
+
These users **will** still gain access via [user-driven syncing](/docs/features/permission-syncing#how-it-works), which fetches all repositories accessible to each authenticated user using the `REPO_READ` scope. However, there may be a delay between when access is granted and when affected users see the repository in Sourcebot (up to the `experiment_userDrivenPermissionSyncIntervalMs` interval, which defaults to 24 hours).
122
+
123
+
If your instance relies heavily on project or group-level permissions, we recommend reducing the `experiment_userDrivenPermissionSyncIntervalMs` interval to limit the window of delay.
124
+
</Warning>
125
+
126
+
**Notes:**
127
+
- A Bitbucket Data Center [external identity provider](/docs/configuration/idp#bitbucket-server) must be configured to (1) correlate a Sourcebot user with a Bitbucket Data Center user, and (2) to list repositories that the user has access to for [User driven syncing](/docs/features/permission-syncing#how-it-works).
128
+
- The connection token must have **Repository Read** permissions so Sourcebot can read repository-level user permissions for [Repo driven syncing](/docs/features/permission-syncing#how-it-works).
129
+
- OAuth tokens require the `REPO_READ` scope to list accessible repositories during [User driven syncing](/docs/features/permission-syncing#how-it-works).
130
+
104
131
# How it works
105
132
106
133
Permission syncing works by periodically syncing ACLs from the code host(s) to Sourcebot to build an internal mapping between Users and Repositories. This mapping is hydrated in two directions:
Copy file name to clipboardExpand all lines: docs/snippets/schemas/v3/bitbucket.schema.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,11 @@
67
67
"default": "cloud",
68
68
"description": "The type of Bitbucket deployment"
69
69
},
70
+
"all": {
71
+
"type": "boolean",
72
+
"default": false,
73
+
"description": "Sync all repositories visible to the provided `token` (if any) in the Bitbucket Server instance. This option is ignored if `deploymentType` is `cloud`."
0 commit comments