Skip to content

Conversation

bahrmichael
Copy link
Contributor

@bahrmichael bahrmichael commented Jul 7, 2025

This PR updates the documentation for the batch spec library following the introduction of batch spec templates.

Most notably it

  • gives an explanation of library examples vs templates for admins, along with a new section on how to use variables,
  • restructures the page about creating a batch change to show server side batch changes on the top with info about templates, and moves the info on how to use the src-cli to the bottom,
  • moves info on viewing batch changes into a dedicated page.

For easier reviewing of the new content, I created two PDFs:

Batch Changes site admin configuration reference - Sourcegraph docs.pdf
Creating a Batch Change - Sourcegraph docs.pdf

Pull Request approval

You will need to get your PR approved by at least one member of the Sourcegraph team. For reviews of docs formatting, styles, and component usage, please tag the docs team via the #docs Slack channel.

Copy link

vercel bot commented Jul 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sourcegraph-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 7:58am

@bahrmichael bahrmichael marked this pull request as ready for review July 7, 2025 12:45
@bahrmichael bahrmichael requested review from aulorbe and peterguy July 8, 2025 06:13
@MaedahBatool
Copy link
Contributor

Hi @bahrmichael thanks for the updates. Are these related to 6.6 release?

@bahrmichael
Copy link
Contributor Author

Hi @bahrmichael thanks for the updates. Are these related to 6.6 release?

Yes! Do you want to take over the PR and point it to a release branch?

@MaedahBatool
Copy link
Contributor

Hi @bahrmichael thanks for the updates. Are these related to 6.6 release?

Yes! Do you want to take over the PR and point it to a release branch?

Cool, yes I can take over. Just for everyone else's visibility can you also please open a GTM ticket: https://linear.app/sourcegraph/issue-label/gtm%20enablement

Copy link
Contributor

@aulorbe aulorbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think this is looking really good! I'm super excited about this feature. I think we can improve clarity a little bit throughout just by using more succinct and specific language. LMK if you have any Qs about my feedback!

## Batch Spec Library

<Callout type="note"> Batch Spec Library is currently in Experimental.</Callout>
The Batch Spec Library accelerates batch change adoption by offering curated examples and guided templates that make large-scale code modifications accessible to developers at every skill level.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, this sounds like it should be internal because of the word "adoption" -- like, it seems like we're saying leaving a note for our marketing team that the Library aims to increase BC adoptions b/c XYZ. Maybe rephrase to something like "The Batch Spec Library offers curated examples..." ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page is for the site-admin, so I was comfortable with telling them "use this feature to make it easier for folks who use the product you operate". I'll replace the acceleration part.

The Batch Spec Library accelerates batch change adoption by offering curated examples and guided templates that make large-scale code modifications accessible to developers at every skill level.

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.
The library distinguishes between [templates](#templates) and [library examples](#library-examples), where library examples are complete batch specs and templates are library examples with variables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just say "examples" (not "library examples") here, since you say library @ the start of the sentence.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence strikes me as a little bit confusing:

where library examples are complete batch specs and templates are library examples > with variables.

Maybe we could rephrase to something like "[new sentence] Examples are batch specs (link to specs documentation) that are meant to be modified by power users who are comfortable writing code; Templates, on the other hand, are batch specs that contain variables that the user can inject data dynamically into (e.g. a form), and are meant to be used by general users."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your suggestion!

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.
The library distinguishes between [templates](#templates) and [library examples](#library-examples), where library examples are complete batch specs and templates are library examples with variables.

Sourcegraph instances come with a couple of library examples out of the box. You can use the GraphQL APIs to [manage the Batch Spec Library](#managing-the-batch-spec-library).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say "Examples" and "Templates" (capitalized) instead of "library examples" and "templates" throughout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about capitalizing the words, and can't really explain why. I'll push an update so we can see how it reads.


Sourcegraph instances come with a couple of library examples out of the box. You can use the GraphQL APIs to [manage the Batch Spec Library](#managing-the-batch-spec-library).

As a site admin, you can [feature records](#featured-records) to highlight the most useful examples for your organization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do this w/templates too?

And if you like a template, can you turn it into a canonical example when the variables are filled out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you can! I've updated the wording to mention both templates and examples

And if you like a template, can you turn it into a canonical example when the variables are filled out?

You can do that, but need to create it under a different name. I haven't thought about customers turning templates into examples though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! I mean, this is tangential to this PR of course, but I think that'd be awesome! Like, look, I created a dope batch spec, lemme put that into the canonical lib of examples for my org (given some review)


### Library examples

Library examples are complete batch specs intended for advanced users who are comfortable working with YAML and writing code. These examples serve as inspiration and starting points for custom batch changes, providing reference implementations that can be adapted to specific use cases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"reference implementations" is a bit abstract here -- what does this mean exactly? Aren't Examples themselves "reference implementations"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think that part of the sentence doesn't add any value. It's the same as the first half, but more generic words :D


1. On your local machine, with the [Sourcegraph CLI](#create-a-batch-change-with-the-sourcegraph-cli)
2. Remotely, with [server-side execution](/batch-changes/server-side)
When the spec is ready to run, ensure the preview is up to date and then click **Run batch spec**. This takes you to the execution screen. On this page, you see:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have documentation for previewing, maybe link out to that here? As a reader, I asked myself "how do I ensure my preview is up to date" when I read this 1st sentence


### Previewing and applying the batch spec

On this page, you can review the proposed changes and the operations taken by Sourcegraph on each changeset. Once satisfied, click **Apply**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"taken by Sourcegraph" seems unnecessary here IMO


## Viewing batch changes

You can view a list by clicking the **Batch Changes** icon in the top navigation bar:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View a list of what? (Just being pedantic here to highlight that it's a little unclear)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added Batch Changes to clarify


### Title-based search

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd remove "much" from "much easier" b/c it implies finding your spec w/o search is a huge PITA, which I don't think we want to promote


## Filtering Batch Changes

You can also use the filters to switch between showing all open or closed Batch Changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd remove "the" from "the filters" (and "the" from "the keywords" above) b/c it's just unnecessary to specify IMO

Copy link
Contributor

@aulorbe aulorbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP IT WOOO!

@MaedahBatool MaedahBatool marked this pull request as draft July 14, 2025 20:38
@MaedahBatool
Copy link
Contributor

Hi everyone, for now I have converted it to a draft PR till I point it to the 6.6 release branch.

@MaedahBatool MaedahBatool marked this pull request as ready for review July 21, 2025 06:24
@MaedahBatool MaedahBatool merged commit 353b920 into main Jul 21, 2025
7 checks passed
@MaedahBatool MaedahBatool deleted the bahrmichael/templates-doc-update branch July 21, 2025 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants