batches: document new version field#477
Conversation
This adds documentation for the new batch spec version. Relates to https://github.com/sourcegraph/sourcegraph/pull/63613
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@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 |
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.
jtibshirani
left a comment
There was a problem hiding this comment.
Looks good to me! Left a small suggestion.
|
|
||
| ### Version 1 | ||
|
|
||
| default |
There was a problem hiding this comment.
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."
This adds documentation for the new batch spec version.
Relates to https://github.com/sourcegraph/sourcegraph/pull/63613
Closes SPLF-130