From 7267294f1ab8042024e44ad18512ca27278b1234 Mon Sep 17 00:00:00 2001 From: Michael Bahr Date: Mon, 2 Jun 2025 16:44:26 +0200 Subject: [PATCH 1/3] feat(batches): docs for batch spec library labels --- docs/admin/config/batch_changes.mdx | 44 +++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/docs/admin/config/batch_changes.mdx b/docs/admin/config/batch_changes.mdx index 16ae529d3..d3eb91f57 100644 --- a/docs/admin/config/batch_changes.mdx +++ b/docs/admin/config/batch_changes.mdx @@ -353,20 +353,58 @@ Site admins can manage the library through the GraphQL mutations `createBatchSpe ```graphql createBatchSpecLibraryRecord(name: "example", spec: "version: 2\nname: example") { id + labels } updateBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4", name: "example-2", spec: "version: 2\nname: example-2") { id + labels } -deleteBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4") { - alwaysNil +batchSpecLibrary(first: 100) { + nodes { + id + name + labels + } } +``` -batchSpecLibrary(first: 100) { +### Featured Templates + +Sourcegraph 6.4+ + +Site-admins can mark a template as featured by either clicking the star button next to the list of library records. Featured records will automatically move to a section atop the remaining library records. + +### Labels + +Sourcegraph 6.4+ + +Batch Spec Library records support an optional `labels` field for categorization and filtering. Common labels include: + +- `"featured"` - Marks popular or recommended batch specs that are displayed in a "Featured Templates" section above the remaining examples +- Custom labels for organizational categorization (not exposed to Batch Changes users yet) + +To remove the featured status, you can update the library record with an empty list of labels (`[]`). + +```graphql +createBatchSpecLibraryRecord(name: "example", spec: "version: 2\nname: example", labels: ["featured"]) { + id + labels +} + +updateBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4", name: "example-2", spec: "version: 2\nname: example-2", labels: ["featured"]) { + id + labels +} + +# Query only featured batch specs +batchSpecLibrary(first: 100, labels: ["featured"]) { nodes { id name + labels + spec } } ``` From aee38d38bc625e3bf8872e229ba0d4b6287b9f2d Mon Sep 17 00:00:00 2001 From: Michael Bahr Date: Mon, 2 Jun 2025 18:40:41 +0200 Subject: [PATCH 2/3] smol update --- docs/admin/config/batch_changes.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/admin/config/batch_changes.mdx b/docs/admin/config/batch_changes.mdx index d3eb91f57..92eda3b71 100644 --- a/docs/admin/config/batch_changes.mdx +++ b/docs/admin/config/batch_changes.mdx @@ -353,19 +353,20 @@ Site admins can manage the library through the GraphQL mutations `createBatchSpe ```graphql createBatchSpecLibraryRecord(name: "example", spec: "version: 2\nname: example") { id - labels } updateBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4", name: "example-2", spec: "version: 2\nname: example-2") { id - labels +} + +deleteBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4") { + alwaysNil } batchSpecLibrary(first: 100) { nodes { id name - labels } } ``` From b64f7c30f3106b215bca20ffcf5264525a93993e Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 24 Jun 2025 12:33:42 -0700 Subject: [PATCH 3/3] Add some tweaks --- docs/admin/config/batch_changes.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/admin/config/batch_changes.mdx b/docs/admin/config/batch_changes.mdx index 92eda3b71..92caebee9 100644 --- a/docs/admin/config/batch_changes.mdx +++ b/docs/admin/config/batch_changes.mdx @@ -373,13 +373,13 @@ batchSpecLibrary(first: 100) { ### Featured Templates -Sourcegraph 6.4+ +Featured templates are supported in Sourcegraph v6.4 and more. Site-admins can mark a template as featured by either clicking the star button next to the list of library records. Featured records will automatically move to a section atop the remaining library records. ### Labels -Sourcegraph 6.4+ +Labels are supported in Sourcegraph v6.4 and more. Batch Spec Library records support an optional `labels` field for categorization and filtering. Common labels include: