Skip to content

Commit e7ce13b

Browse files
MaedahBatoolbahrmichaelsourcegraph-bot-devxjdpleiness
authored
Docs working branch for Sourcegraph version 6.2 (#1044)
Docs for SG 6.2 release. --------- Co-authored-by: Michael Bahr <[email protected]> Co-authored-by: sourcegraph-bot-devx <[email protected]> Co-authored-by: Jacob Pleiness <[email protected]> Co-authored-by: Jacob Pleiness <[email protected]>
1 parent 43ed7d9 commit e7ce13b

File tree

14 files changed

+867
-177
lines changed

14 files changed

+867
-177
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/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/batch-changes/configuring-credentials.mdx

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,70 @@ Let's learn how you can do it for different code hosts.
101101

102102
### GitHub
103103

104-
On GitHub.com, [create a personal access token (classic) with the correct scopes](https://github.com/settings/tokens/new?scopes=repo,read:org,user:email,read:discussion,workflow).
104+
On GitHub.com, create a personal access token or fine-grained access token with the correct scopes.
105105

106106
The `workflow` scope is technically only required if your batch changes modify files in the `.github` directory of a repository. Still, it's recommended to enable it regardless to avoid confusing errors at a later time.
107107

108108
When working with organizations that have SAML SSO (Single Sign On) enabled, configuring credentials requires an additional step that [involves white-listing the token for use in that organization](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
109109

110-
<Callout type="info">At present, only classic personal access tokens (PATs) are supported. Alternative token types like OAuth access tokens (e.g., OAuth apps), and fine-grained personal access tokens (PATv2) are not supported.</Callout>
110+
<Callout type="info">Currently, classic and fine-grained access tokens are supported only. Alternative token types like OAuth access tokens (for example, OAuth apps) are not supported.</Callout>
111+
112+
#### Personal Access Token
113+
114+
Personal access tokens will have access to all repositories you have access to.
115+
116+
[Click here to prefill the form](https://github.com/settings/tokens/new?scopes=repo,read:org,user:email,read:discussion,workflow).
117+
118+
Required Scopes:
119+
120+
- `repo`
121+
- `read:org`
122+
- `user:email`
123+
- `read:discussion`
124+
- `workflow`
125+
126+
#### Fine-Grained Access Token
127+
128+
Fine-grained access tokens allow more granular control of what actions can be performed for a given set of repositories. Most notably, fine-grained access tokens don't grant access by default to all repositories you have access to.
129+
130+
In contrast to personal access tokens, fine-grained access tokens for organization resources may be restricted, may have an expiration, and may require approval.
131+
132+
- **Restriction**: If an administrator of your GitHub organization has restricted access via fine-grained access tokens, you may not be able to use them for Batch Changes
133+
- **Expiration**: If your organization has configured fine-grained access tokens to have maximum lifetimes, you may need to recreate the token when it has expired
134+
- **Approval**: If your organization has configured fine-grained access tokens to require approval, you may need to wait for an administrator to approve the token before you can use it with Batch Changes
135+
136+
Start by navigating to create a [new fine-grained access token](https://github.com/settings/personal-access-tokens/new).
137+
138+
Pick the resource owner that owns the repositories you want to use with Batch Changes. This will likely be your company's GitHub organization.
139+
140+
![Select resource owner for fine-grained access token](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/fine_grained_select_owner.png)
141+
142+
Scroll down and select "All repositories" so that your token can access all current and future repositories that you have access to. You may restrict it to "Only select repositories", but you may have to generate a new token when you want to handle a new repository with Batch Changes.
143+
144+
![Select all repositories for repository access](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/fine_grained_select_repos.png)
145+
146+
Under "Permissions," click on the arrows on the right-hand side to expand the list of repository and organization permissions.
147+
148+
![Expand the repository permissions by clicking on the arrows](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/fine_grained_expand_permissions.png)
149+
150+
Under "Repository permissions", select the following permissions:
151+
152+
- Contents: Read and write
153+
- Metadata: Read-only
154+
- Pull requests: Read and write
155+
- Workflows: Read and write
156+
157+
Under "Organization permissions", select the following permissions:
158+
159+
- Custom properties: Read-only
160+
161+
Once you created the token, copy it and add it to your Batch Changes credentials.
162+
163+
![Add credential modal with fine-grained token selected](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/setup_fine_grained_access_token.png)
164+
165+
If your organization requires approval for fine-grained access tokens, you must wait for an administrator to approve the token before you can publish changesets with it.
166+
167+
The fine-grained access token is now ready to use. Create a new batch change to start using it.
111168

112169
### GitHub Enterprise
113170

@@ -129,7 +186,7 @@ When working with organizations that have SAML SSO (Single Sign On) enabled, con
129186

130187
<Callout type="warning">Currently, for customers on an instance of GitHub Enterprise Cloud that uses [SSH certificate authorities](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities) and requires SSH certificates to authenticate, we are unable to provide a means of authenticating Batch Changes to your code host.</Callout>
131188

132-
<Callout type="info">At present, only classic personal access tokens (PATs) are supported. Alternative token types like OAuth access tokens (e.g. OAuth apps), and fine-grained personal access tokens (PATv2) are not supported.</Callout>
189+
<Callout type="info">Currently, classic personal and fine-grained access tokens are supported only. Alternative token types like OAuth access tokens (for example, OAuth apps) are not supported.</Callout>
133190

134191
### GitLab
135192

@@ -239,4 +296,4 @@ To remove a GitHub app from your Sourcegraph instance, navigate back to the same
239296
<source src="https://sourcegraphstatic.com/docs/videos/batch_changes/2024/batches-github-app-delete.mp4" type="video/mp4" />
240297
</video>
241298

242-
If you want to delete the GitHub app entirely you have to navigate to [GitHub's list of applications](https://github.com/settings/apps/), and delete it from there.
299+
If you want to delete the GitHub app entirely, you have to navigate to [GitHub's list of applications](https://github.com/settings/apps/) and delete it from there.

docs/batch-changes/create-a-batch-change.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ You should see the editor view now. This view consists of three main areas:
140140

141141
![ssbc_editor_panels](https://sourcegraphstatic.com/docs/images/batch_changes/2024/ssbc_editor_panels.png)
142142

143-
You can pick from the examples in the library pane to get started quickly or begin working on your batch spec in the editor right away. The editor will provide documentation as you hover over tokens in the YAML spec and supports auto-completion.
143+
You can pick from the examples in the library pane to get started quickly or begin working on your batch spec in the editor right away. Site admins can configure the examples. The editor will provide documentation as you hover over tokens in the YAML spec and supports auto-completion.
144144

145145
### Previewing workspaces
146146

@@ -180,6 +180,14 @@ You can view a list by clicking the **Batch Changes** icon in the top navigation
180180

181181
![batch-change-icon-to-view](https://sourcegraphstatic.com/docs/images/batch_changes/2024/batch_changes_icon_in_menu.png)
182182

183+
### Title-based search
184+
185+
You can search through your previously created batch changes by title. This search experience makes it much easier to find the batch change you’re looking for, especially when you have large volumes of batch changes to monitor.
186+
187+
Start typing the keywords that match the batch change’s title, and you will see a list of relevant results.
188+
189+
![title-based-search-batch-changes](https://storage.googleapis.com/sourcegraph-assets/Docs/title-based-search-bc.png)
190+
183191
## Filtering Batch Changes
184192

185193
You can also use the filters to switch between showing all open or closed Batch Changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Rebasing changesets
2+
3+
<p className="subtitle">Learn how to rebase your existing changesets.</p>
4+
5+
<Callout type="note">This feature is supported for Sourcegraph versions 6.2 or more.</Callout>
6+
7+
If your codehost requires changesets to be up to date with the main branch, you can use the rebase functionality of the Web UI to update the changesets.
8+
9+
<Callout type="warning">Rebasing does not resolve merge conflicts.</Callout>
10+
11+
## Requirements
12+
13+
- Sourcegraph instance with repositories in it. See the [Quickstart](/#quick-install) guide on how to set up a Sourcegraph instance
14+
- A [global service account token](/batch-changes/configuring-credentials#global-service-account-tokens) for Batch Changes (**a personal access token cannot currently be used for importing changesets**)
15+
16+
## Select changesets to rebase
17+
18+
After navigating to the changesets of your batch change, select one or more **published** changesets to rebase. You can only rebase changesets after they have been published to the codehost.
19+
20+
![List of changesets with two of them selected](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/rebase_changesets.png)
21+
22+
If a changeset is already up to date with the main branch, rebasing will result in no changes.
23+
24+
## Start the rebase bulk operation
25+
26+
With all applicable changesets selected, click the **Select action** button, and then select **Rebase changesets**.
27+
28+
![List of changesets and dropdown overlay](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/rebase_dropdown.png)
29+
30+
Confirm the popup to start the rebase bulk operation.
31+
32+
![Popup to confirm rebase action](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/rebase_confirm.png)
33+
34+
You can see the progress of the rebase operation in the **Bulk Actions** tab.
35+
36+
![List of bulk operations showing that rebase has completed](https://storage.googleapis.com/sourcegraph-assets/docs/images/batch_changes/2025/rebase_status.png)

docs/batch-changes/site-admin-configuration.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Using Batch Changes requires a [code host connection](/admin/external_services/)
1717
- [Outgoing webhooks](/admin/config/webhooks/outgoing), which publish events related to batch changes and changesets to enable deeper integrations with your other tools and systems
1818
- [Auto-delete branch on merge/close](/admin/config/batch_changes#automatically-delete-branches-on-merge-close), which automatically deletes branches created by Batch Changes when changesets are merged or closed
1919
- [Commit signing for GitHub](/admin/config/batch_changes#commit-signing-for-github), which signs commits created by Batch Changes via a GitHub App (Beta)
20+
- [Batch spec library](/admin/config/batch_changes#batch-spec-library), which help your users write batch specs and follow best practices
2021

2122
## Disable Batch Changes
2223

0 commit comments

Comments
 (0)