Skip to content

Commit 92c63ec

Browse files
committed
Fix merge conflicts
2 parents d25876b + 3927cbf commit 92c63ec

34 files changed

+11522
-4129
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sourcegraph Docs
22

3-
<!-- Working branch for FEB 2025 Release -->
3+
<!-- Working branch for April 2025 Release -->
44

55
Welcome to the Sourcegraph documentation! We're excited to have you contribute to our docs. We've recently rearchitectured our docs tech stack — powered by Next.js, TailwindCSS and deployed on Vercel. This guide will walk you through the process of contributing to our documentation using the new tech stack.
66

docs.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const config = {
2-
DOCS_LATEST_VERSION: '6.1'
2+
DOCS_LATEST_VERSION: '6.2'
33
};
44

55
module.exports = config;

docs/admin/code_hosts/github.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ To create a GitHub App and connect it to Sourcegraph:
6666

6767
9. (Optional) If you want to sync repositories from other organization or user namespaces and your GitHub App is set to public visibility, you can create additional installations with **Add installation**.
6868

69+
> NOTE: When you create a GitHub App, Sourcegraph automatically sets up an [incoming webhook](/admin/config/webhooks/incoming) for the app. This webhook subscribes to events for any repository or organization the app has access to, allowing Sourcegraph to keep repository and permission data in sync with GitHub.
70+
6971
> NOTE: If you are using [Batch Changes](/batch-changes/), you can create a GitHub App to perform [commit signing](/admin/config/batch_changes#commit-signing-for-github) (Beta).
7072
7173
### Multiple installations

docs/admin/code_hosts/index.mdx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ We recognize there are other code hosts including CVS, SVN, and many more. Today
5858
- [Non-Git code hosts](/admin/code_hosts/non-git)
5959
- [Perforce](/admin/repo/perforce)
6060
- [Plastic SCM](/admin/repo/plasticscm)
61-
- [Package repository hosts](/admin/code_hosts/package-repos)
62-
- [JVM dependencies](/admin/code_hosts/jvm)
63-
- [Go dependencies](/admin/code_hosts/go)
64-
- [npm dependencies](/admin/code_hosts/npm)
65-
- [Python dependencies](/admin/code_hosts/python)
66-
- [Ruby dependencies](/admin/code_hosts/ruby)
67-
- [Rust dependencies](/admin/code_hosts/rust)
6861

6962
## Rate limits
7063

docs/admin/config/authorization_and_authentication.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,7 @@ And configure the identity provider to pass the email address as the `nameID`.
112112

113113
### Bitbucket Server / Bitbucket Data Center authorization
114114

115-
We do not currently support OAuth for Bitbucket Server or Bitbucket Data Center. You will need to combine permissions syncing from Bitbucket Server / Bitbucket Data Center with another authentication mechanism (SAML, built-in auth, HTTP authentication proxies). Bitbucket Server and Bitbucket Data Center only pass usernames to Sourcegraph, so you’ll need to make sure that those usernames are matched by whatever mechanism you choose to use for access.
116-
117-
Follow the steps to [sync Bitbucket Server / Bitbucket Data Center permissions](/admin/code_hosts/bitbucket_server#repository-permissions). Then, do one of the following:
118-
119-
1. Create the user accounts in Sourcegraph with matching usernames. (Access using `builtin` auth.)
120-
2. [Configure SAML authentication](/admin/auth/saml/). If you are using Bitbucket Server / Bitbucket Data Center, the `login` attribute is _not_ optional. You need to pass the Bitbucket Server username as the `login` attribute.
121-
3. [Configure an HTTP authentication proxy](/admin/auth/#http-authentication-proxies), passing the Bitbucket Server username value as the `usernameHeader`.
115+
We support authentication through OAuth for Bitbucket Server / Bitbucket Data Center. See the [Bitbucket Server auth provider docs](/admin/auth/#bitbucket-server).
122116

123117
### Azure DevOps Services
124118

docs/admin/config/batch_changes.mdx

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ To restore the default behavior, you can either delete the `batchChanges.rollout
3030

3131
Or, to put it another way:
3232

33-
| `batchChanges.rolloutWindows` configuration | Behavior |
34-
|---------------------------------------------|-----------|
35-
| Omitted, or set to `null` | Changesets will be reconciled as fast as the code host allows; essentially the same as setting a single `{"rate": "unlimited"}` window. |
33+
| `batchChanges.rolloutWindows` configuration | Behavior |
34+
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35+
| Omitted, or set to `null` | Changesets will be reconciled as fast as the code host allows; essentially the same as setting a single `{"rate": "unlimited"}` window. |
3636
| Set to an array (even if empty) | Changesets will be reconciled using the rate limit in the current window using [the leaky bucket behavior described below](#leaky-bucket-rate-limiting). If no window covers the current period, then no changesets will be reconciled until a window with a non-zero [`rate`](#rate) opens. |
37-
| Any other value | The configuration is invalid, and an error will appear. |
37+
| Any other value | The configuration is invalid, and an error will appear. |
3838

3939
#### Leaky bucket rate limiting
4040

@@ -171,18 +171,53 @@ For those that require a separate API call, Batch Changes will only be able to d
171171

172172
Refer to the table below to see the levels with which each code host is supported:
173173

174-
Code Host | Changeset property or separate API call? | Support on merge | Support on close | Note
175-
--------- | --------- | :-: | :-: | ----
176-
Azure DevOps | Changeset property | ✓ | ✗ |
177-
Bitbucket Cloud | Changeset property | ✓ | ✓ |
178-
Bitbucket Server | API call | ✓ | ✓ |
179-
GitHub | API call | ✓ | ✓ |
180-
GitLab | Changeset property | ✓ | ✓ |
181-
Gerrit | API call | ✗ | ✓ | Requires ["delete own changes" permission](https://gerrit-review.googlesource.com/Documentation/access-control.html#category_delete_own_changes) at minimum
174+
Code Host | Changeset property or separate API call? | Support on merge | Support on close | Note
175+
---------------- | ---------------------------------------- | :--------------: | :--------------: | -----------------------------------------------------------------------------------------------------------------------------------------------------------
176+
Azure DevOps | Changeset property | ✓ | ✗ |
177+
Bitbucket Cloud | Changeset property | ✓ | ✓ |
178+
Bitbucket Server | API call | ✓ | ✓ |
179+
GitHub | API call | ✓ | ✓ |
180+
GitLab | Changeset property | ✓ | ✓ |
181+
Gerrit | API call | ✗ | ✓ | Requires ["delete own changes" permission](https://gerrit-review.googlesource.com/Documentation/access-control.html#category_delete_own_changes) at minimum
182182

183-
## Commit signing for GitHub
183+
## Commit signing
184184

185-
<Callout type="note"> The feature is currently in Beta stage and supported on Sourcegraph versions 5.1 or more.</Callout>
185+
Batch Changes supports commit signing with both GitHub apps and with SSH keys.
186+
187+
### Commit signing with SSH keys (GitLab and GitHub)
188+
189+
<Callout type="note">Commit signing with SSH keys is currently Experimental and is supported only with Sourcegraph v6.2 or more.</Callout>
190+
191+
Commit signing with SSH keys can only be combined with a personal or fine-grained access token.
192+
193+
Sourcegraph can be configured to sign commits using SSH keys with user and site admin credentials.
194+
195+
To enable **commit signing for your Batch Changes user**, navigate to **Settings > Batch Changes** and click **Add credentials** for a GitHub or GitLab code host.
196+
197+
![List of code hosts with an arrow pointing to add credential](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/code_host_add_credential.png)
198+
199+
If you already have a credential for the given code host, remove it first.
200+
201+
Enter your personal access token, and check the "Sign commits on this code host" box. This will add a step to the setup flow. Click "Next" and wait for Batch Changes to verify the access token.
202+
203+
![The modal for adding a credential with an arrow pointing to the checkbox for commit signing](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/setup_commit_signing_checkbox.png)
204+
205+
Once the credential is added, you can copy the public SSH key Batch Changes will use to sign commits. You can view the public key anytime by clicking **View Credentials**.
206+
207+
![The modal displays the ssh key used for commit signing](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/setup_commit_signing_view_ssh_key.png)
208+
209+
Add this public SSH key to your [GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) or [GitLab](https://docs.gitlab.com/user/ssh/#add-an-ssh-key-to-your-gitlab-account) account.
210+
Make sure you add it as a signing key.
211+
212+
![Add the key to your code host as a signing key](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/github_add_signing_key.png)
213+
214+
To enable **commit signing as a site admin**, navigate to **Site Admin > Section: Batch Changes > Settings** and click **Add credentials** for a GitHub or GitLab code host. The rest of the setup is the same as above.
215+
216+
![Site admin settings for batch changes](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/batch_changes_site_admin_settings.png)
217+
218+
### Commit signing with GitHub apps
219+
220+
<Callout type="note">Commit signing with GitHub apps is currently in Beta and is supported with Sourcegraph v5.1 or more.</Callout>
186221

187222
Sourcegraph can be configured to [sign commits pushed to GitHub](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) using a GitHub App. Commit signing prevents tampering by unauthorized parties and provides a way to ensure that commits pushed to branches created by Batch Changes actually do come from Sourcegraph. Enabling commit signing for Batch Changes can also help pass checks in build systems or CI/CD pipelines that require that all commits are signed and verified before they can be merged.
188223

@@ -306,3 +341,32 @@ When a user is deleted, their Batch Changes become inaccessible in the UI but th
306341
This allows recovering the Batch Changes if the user is restored.
307342

308343
However, if the user deletion is permanent, deleting both account and data, then the associated Batch Changes are also permanently deleted from the database. This frees storage space and removes dangling references.
344+
345+
## Batch Spec Library
346+
347+
<Callout type="note"> Batch Spec Library is currently in Experimental.</Callout>
348+
349+
The Batch Spec Library is a collection of Batch Specs that can be used to create Batch Changes. Sourcegraph provides a few Batch Specs out of the box.
350+
351+
Site admins can manage the library through the GraphQL mutations `createBatchSpecLibraryRecord`, `updateBatchSpecLibraryRecord`, and `deleteBatchSpecLibraryRecord`. Use the query `batchSpecLibrary` to list all available Batch Spec examples.
352+
353+
```graphql
354+
createBatchSpecLibraryRecord(name: "example", spec: "version: 2\nname: example") {
355+
id
356+
}
357+
358+
updateBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4", name: "example-2", spec: "version: 2\nname: example-2") {
359+
id
360+
}
361+
362+
deleteBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4") {
363+
alwaysNil
364+
}
365+
366+
batchSpecLibrary(first: 100) {
367+
nodes {
368+
id
369+
name
370+
}
371+
}
372+
```

docs/admin/deploy/kubernetes/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ When all pods have restarted and show as Running, you can browse to your Sourceg
938938
- Check the `Site Admin > Updates` page to determine [upgrade readiness](/admin/updates/#upgrade-readiness).
939939

940940
**Step 2:**
941-
> <Callout type="warning">The Kubernetes Helm deployment type does not support MVU from Sourcegraph `v5.9.45` versions and earlier to Sourcegraph `v6.0.0`. Admins seeking to upgrade to Sourcegraph `v6.0.0` should upgrade to `v5.10.3940` or `v5.11.6271` and then use the standard upgrade procedure to get to `v6.0.0`. This is because migrator v6.0.0 will no longer connect to Postgres 12 databases. For more info see our [PostgreSQL upgrade docs](/admin/postgres#requirements).</Callout>
941+
> <Callout type="warning">The Kubernetes Helm deployment type does not support MVU from Sourcegraph `v5.9.45` versions and earlier to ANY version `v6.0.x` or later. Admins seeking to upgrade to any Sourcegraph version `v6.0.x` or later (including `v6.1.x`, `v6.2.x`, etc.) must first upgrade to `v5.10.3940` or `v5.11.6271` and then use the standard upgrade procedure to get to their target version. This is because migrator in all versions from `v6.0.0` onwards will no longer connect to Postgres 12 databases. For more info see our [PostgreSQL upgrade docs](/admin/postgres#requirements).</Callout>
942942

943943
Scale down `deployments` and `statefulSets` that access the database, _this step prevents services from accessing the database while schema migrations are in process._
944944
The following services must have their replicas scaled to 0:

docs/admin/how-to/upgrade-postgres-12-16-builtin-dbs.mdx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,28 @@ $ kubectl apply -f deploy-sourcegraph-k8s/base/sourcegraph/pgsql/pgsql.StatefulS
8282

8383
## Helm
8484

85-
To upgrade builtin containers in Helm admins must update their instance to v5.11.6271 via the [helm multi-version upgrade procedure](/admin/deploy/kubernetes#multi-version-upgrade-procedure) or standard upgrade procedure. This is because `helm upgrade` doesn't support just the DBs in a chart.
85+
When using the in-cluster PostgreSQL databases included in the Sourcegraph Helm chart, database upgrades are integrated with the overall application upgrade process and there is no mechanism to upgrade only the PostgreSQL containers independently. Therefore, the PostgreSQL upgrade must be performed as part of a full Sourcegraph version upgrade.
8686

87-
<Callout type="warning"> In Sourcegraph version 6.0.0 Sourcegraph services will no longer be able to connect to a Postgres 12 database. This means at and after Sourcegraph 6.0.0, migrator will not be connect to older versions to execute the `upgrade` command. </Callout>
87+
For production deployments, we recommend using external PostgreSQL databases, which allows for more flexible database management outside the Helm deployment lifecycle.
88+
89+
### Required Upgrade Path
90+
91+
<Callout type="warning">Sourcegraph versions `v6.0.x` and later require PostgreSQL 16 and will not connect to PostgreSQL 12 databases. This means any direct upgrade from versions earlier than `v5.10.3940` to any version `v6.0.x` or later will fail because the migrator in `v6.0.x` and later cannot connect to PostgreSQL 12 to perform the upgrade.</Callout>
92+
93+
To safely upgrade PostgreSQL in Helm deployments:
94+
95+
1. **First upgrade to an intermediate version**:
96+
- Upgrade to either Sourcegraph `v5.10.3940` or `v5.11.6271` using the [helm multi-version upgrade procedure](/admin/deploy/kubernetes#multi-version-upgrade-procedure) or [standard upgrade procedure](/admin/deploy/kubernetes#standard-upgrades)
97+
- These specific versions include the necessary PostgreSQL upgrade scripts to safely migrate from PG12 to PG16
98+
99+
2. **Verify the PostgreSQL upgrade** (optional):
100+
- You can verify the PostgreSQL version has been successfully upgraded by connecting to the database:
101+
```bash
102+
kubectl exec -it pgsql -- psql -U sg -c "SELECT version();"
103+
```
104+
- The output should show PostgreSQL 16.x
105+
106+
3. **Proceed to target version**:
107+
- Once PostgreSQL has been upgraded to version 16, you can safely upgrade to your target version (`v6.0.x` or later) using the standard upgrade procedure
108+
109+
For any issues during the PostgreSQL upgrade process, please contact [email protected].

0 commit comments

Comments
 (0)