Skip to content

Commit 088e28c

Browse files
docs/batches: Document batchChanges.restrictMergeToAdmins setting
Adds documentation for the new batchChanges.restrictMergeToAdmins site config option which restricts merge and auto-merge actions to site admins only. This is useful when using the Batch Changes GitHub App with elevated access, where the App may have write permissions to repositories that individual users do not. See sourcegraph/sourcegraph#9559 Note: This PR should only be merged once Sourcegraph 6.13 is released. Amp-Thread-ID: https://ampcode.com/threads/T-019c2344-7386-702e-8b12-7ec2de618f53 Co-authored-by: Amp <amp@ampcode.com>
1 parent 10dfa40 commit 088e28c

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

docs/admin/config/batch-changes.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ Batch Changes is [RBAC-enabled](/admin/access-control/) <span class="badge badge
1010

1111
By default, only a batch change's author or a site admin can administer (apply, close, rename, etc.) a batch change. However, admins can use [organizations](/admin/organizations) to facilitate closer collaboration and shared administrative control over batch changes by enabling the `orgs.allMembersBatchChangesAdmin` setting for an organization. When enabled, members of the organization will be able to administer all batch changes created in that organization's namespace. Batch changes created in other namespaces (user or organization) will still be restricted to the author and site admins.
1212

13+
### Restrict merge actions to site admins
14+
15+
When using the [Batch Changes GitHub App](#commit-signing-with-github-apps) with elevated access, the App may have write access to repositories that individual users do not. To restrict who can merge changesets via the Batch Changes UI, set the `batchChanges.restrictMergeToAdmins` site configuration option to `true`:
16+
17+
```json
18+
{
19+
"batchChanges.restrictMergeToAdmins": true
20+
}
21+
```
22+
23+
When enabled, only site admins can use the "Merge changesets" and "Enable auto-merge" actions. Non-admin users will receive an error message directing them to contact a site admin.
24+
1325
## Rollout windows
1426

1527
By default, Sourcegraph attempts to reconcile (create, update, or close) changesets as quickly as the rate limits on the code host allow. This can result in CI systems being overwhelmed if hundreds or thousands of changesets are being handled as part of a single batch change.

docs/admin/config/site-config.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ All site configuration options and their default values are shown below.
7979
// Reject unverified commits when creating a Batch Change
8080
"batchChanges.rejectUnverifiedCommit": false,
8181

82+
// When enabled, only site admins can merge changesets or enable auto-merge via the Batch Changes UI.
83+
"batchChanges.restrictMergeToAdmins": false,
84+
8285
// When enabled, only site admins can create and apply batch changes.
8386
"batchChanges.restrictToAdmins": false,
8487

docs/batch-changes/permissions-in-batch-changes.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,9 @@ A site admin can disable Batch Changes for a Sourcegraph instance by setting the
9090
## Disabling Batch Changes for non-site-admin users
9191

9292
A site admin can disable batch changes for regular users by setting the [site configuration](/admin/config/site-config) property `"batch-changes.restrictToAdmins"` to `true`.
93+
94+
## Restricting merge actions to site admins
95+
96+
When using the [Batch Changes GitHub App](/admin/config/batch-changes#commit-signing-with-github-apps) with elevated access, the App may have write access to repositories that individual users do not. To prevent non-admin users from merging changesets through the Batch Changes UI in repositories they wouldn't normally have merge permissions for, a site admin can set the [site configuration](/admin/config/site-config) property `"batchChanges.restrictMergeToAdmins"` to `true`.
97+
98+
When enabled, only site admins can use the "Merge changesets" and "Enable auto-merge" actions. Non-admin users will see an error directing them to contact a site admin to perform these actions.

0 commit comments

Comments
 (0)