Skip to content

feat(batches): docs for batch spec library labels #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/admin/config/batch_changes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,42 @@ batchSpecLibrary(first: 100) {
}
}
```

### Featured Templates

<span class="badge badge-note">Sourcegraph 6.4+</span>

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

<span class="badge badge-note">Sourcegraph 6.4+</span>

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
}
}
```