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: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Sourcegraph Docs
2
2
3
-
<!-- Working branch for FEB 2025 Release -->
3
+
<!-- Working branch for April 2025 Release -->
4
4
5
5
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.
| 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. |
| 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. |
36
36
| 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. |
38
38
39
39
#### Leaky bucket rate limiting
40
40
@@ -171,18 +171,53 @@ For those that require a separate API call, Batch Changes will only be able to d
171
171
172
172
Refer to the table below to see the levels with which each code host is supported:
173
173
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
Gerrit | API call | ✗ | ✓ | Requires ["delete own changes" permission](https://gerrit-review.googlesource.com/Documentation/access-control.html#category_delete_own_changes) at minimum
182
182
183
-
## Commit signing for GitHub
183
+
## Commit signing
184
184
185
-
<Callouttype="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
+
<Callouttype="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
+

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
+

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
+

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
+

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
+

217
+
218
+
### Commit signing with GitHub apps
219
+
220
+
<Callouttype="note">Commit signing with GitHub apps is currently in Beta and is supported with Sourcegraph v5.1 or more.</Callout>
186
221
187
222
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.
188
223
@@ -306,3 +341,32 @@ When a user is deleted, their Batch Changes become inaccessible in the UI but th
306
341
This allows recovering the Batch Changes if the user is restored.
307
342
308
343
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
+
<Callouttype="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.
Copy file name to clipboardExpand all lines: docs/batch-changes/configuring-credentials.mdx
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,13 +101,70 @@ Let's learn how you can do it for different code hosts.
101
101
102
102
### GitHub
103
103
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.
105
105
106
106
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.
107
107
108
108
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).
109
109
110
-
<Callouttype="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
+
<Callouttype="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
+

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
+

145
+
146
+
Under "Permissions," click on the arrows on the right-hand side to expand the list of repository and organization permissions.
147
+
148
+

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
+

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.
111
168
112
169
### GitHub Enterprise
113
170
@@ -129,7 +186,7 @@ When working with organizations that have SAML SSO (Single Sign On) enabled, con
129
186
130
187
<Callouttype="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>
131
188
132
-
<Callouttype="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
+
<Callouttype="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>
133
190
134
191
### GitLab
135
192
@@ -239,4 +296,4 @@ To remove a GitHub app from your Sourcegraph instance, navigate back to the same
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.
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.
144
144
145
145
### Previewing workspaces
146
146
@@ -180,6 +180,14 @@ You can view a list by clicking the **Batch Changes** icon in the top navigation
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.
<pclassName="subtitle">Learn how to rebase your existing changesets.</p>
4
+
5
+
<Callouttype="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
+
<Callouttype="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
+

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
+

29
+
30
+
Confirm the popup to start the rebase bulk operation.
31
+
32
+

33
+
34
+
You can see the progress of the rebase operation in the **Bulk Actions** tab.
35
+
36
+

Copy file name to clipboardExpand all lines: docs/batch-changes/site-admin-configuration.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ Using Batch Changes requires a [code host connection](/admin/external_services/)
17
17
-[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
18
18
-[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
19
19
-[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
0 commit comments