Skip to content

Conversation

@stefanhengl
Copy link
Member

@stefanhengl stefanhengl commented Jul 8, 2024

This adds documentation for the new batch spec version.

Relates to https://github.com/sourcegraph/sourcegraph/pull/63613

Closes SPLF-130

This adds documentation for the new batch spec version.

Relates to https://github.com/sourcegraph/sourcegraph/pull/63613
@vercel
Copy link

vercel bot commented Jul 8, 2024

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 10, 2024 7:43am

@MaedahBatool
Copy link
Contributor

@stefanhengl content looks good. Are we ready to merge this to working branch?

@stefanhengl
Copy link
Member Author

@stefanhengl content looks good. Are we ready to merge this to working branch?

I am waiting for https://github.com/sourcegraph/sourcegraph/pull/63613 to merge. It shouldn't take much longer

stefanhengl added a commit to sourcegraph/sourcegraph-public-snapshot that referenced this pull request Jul 9, 2024
This is part of the Keyword GA Project.

Batch Changes uses Sourcegraph queries to define the list of repositories on which the batch change will run.

With this change we default to pattern type "keyword" instead of "standard". 

To make this a backward compatible change, we also introduce a version identifier to batch specs. Authors can specify `version: 2` in the spec, in which case we default to pattern type "keyword". Existing specs (without a specified version) and specs with `version: 1` will keep using pattern type "standard".

Notes:
- Corresponding doc update [PR](sourcegraph/docs#477)
- We don't have a query input field, but instead the query is defined in a batch spec YAML. It didn't feel right to edit the YAML and append "patternType: " on save, which is what we do for Code Monitors and Insights.
- I misuse the pattern type query parameter to effectively override the version. Once we introduce "V4" we should come back here and clean up. I left a TODO in the code.

Test plan:
- New and updated unit tests
- manual testing
  - new batch changes use `version: 2` by default.
  - using an unsupported version returns an error
  - I ran various "on:" queries to verify that version 2 uses keyword search and version 1 uses standard search.
@stefanhengl stefanhengl marked this pull request as ready for review July 9, 2024 13:17
@stefanhengl stefanhengl requested review from a team and jtibshirani and removed request for jtibshirani July 9, 2024 13:17
Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

Looks good to me! Left a small suggestion.


### Version 1

default
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this a bit confusing, because we actually want users to consider Version 2 the default choice. Maybe we could say "The schema version before Sourcegraph version 5.5. For now, if no version is specified, batch changes will use this schema version. It is recommended to switch to version 2."

@stefanhengl stefanhengl merged commit b5bf42d into sg-next-release Jul 10, 2024
@stefanhengl stefanhengl deleted the sh/batches/version branch July 10, 2024 07:45
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