diff --git a/docs/admin/config/batch_changes.mdx b/docs/admin/config/batch_changes.mdx index 0da626424..232ba807d 100644 --- a/docs/admin/config/batch_changes.mdx +++ b/docs/admin/config/batch_changes.mdx @@ -306,3 +306,30 @@ When a user is deleted, their Batch Changes become inaccessible in the UI but th This allows recovering the Batch Changes if the user is restored. 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. + +## Batch Spec Library + +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. + +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. + +```graphql +createBatchSpecLibraryRecord(name: "example", spec: "version: 2\nname: example") { + id +} + +updateBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4", name: "example-2", spec: "version: 2\nname: example-2") { + id +} + +deleteBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4") { + alwaysNil +} + +batchSpecLibrary(first: 100) { + nodes { + id + name + } +} +``` diff --git a/docs/batch-changes/create-a-batch-change.mdx b/docs/batch-changes/create-a-batch-change.mdx index 64a7c4bd1..1728d0bb1 100644 --- a/docs/batch-changes/create-a-batch-change.mdx +++ b/docs/batch-changes/create-a-batch-change.mdx @@ -140,7 +140,7 @@ You should see the editor view now. This view consists of three main areas: ![ssbc_editor_panels](https://sourcegraphstatic.com/docs/images/batch_changes/2024/ssbc_editor_panels.png) -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. +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. ### Previewing workspaces diff --git a/docs/batch-changes/site-admin-configuration.mdx b/docs/batch-changes/site-admin-configuration.mdx index b7cbb95ba..57ef2a0f2 100644 --- a/docs/batch-changes/site-admin-configuration.mdx +++ b/docs/batch-changes/site-admin-configuration.mdx @@ -17,6 +17,7 @@ Using Batch Changes requires a [code host connection](/admin/external_services/) - [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 - [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 - [Commit signing for GitHub](/admin/config/batch_changes#commit-signing-for-github), which signs commits created by Batch Changes via a GitHub App (Beta) + - [Batch spec library](/admin/config/batch_changes#batch-spec-library), which help your users write batch specs and follow best practices ## Disable Batch Changes