batches: support new version field#1100
Merged
Merged
Conversation
stefanhengl
commented
Jul 9, 2024
| // tag don't exist locally, regardless of the format. | ||
| var digest string | ||
| if digest, err = inspectDigest(); errors.HasType(err, &fastCommandTimeoutError{}) { | ||
| if digest, err = inspectDigest(); errors.HasType[*fastCommandTimeoutError](err) { |
Member
Author
There was a problem hiding this comment.
errors.HasType was changed in Sourcegraph so I had to update the call here. (See https://github.com/sourcegraph/sourcegraph/pull/63024)
stefanhengl
commented
Jul 9, 2024
Comment on lines
-509
to
+511
| const exampleSpecTmpl = `name: NAME-OF-YOUR-BATCH-CHANGE | ||
| const exampleSpecTmpl = `# "version" determines how the batch spec is interpreted. | ||
| version: 2 | ||
| name: NAME-OF-YOUR-BATCH-CHANGE |
Member
Author
There was a problem hiding this comment.
This is returned by src batch new -f <file>
There was a problem hiding this comment.
Tiny comment, as a user I would find # "version" determines how the batch spec is interpreted to be a bit mysterious. Maybe we could say
version: 2 # Use the latest schema version
name: ...
jtibshirani
approved these changes
Jul 9, 2024
Comment on lines
-509
to
+511
| const exampleSpecTmpl = `name: NAME-OF-YOUR-BATCH-CHANGE | ||
| const exampleSpecTmpl = `# "version" determines how the batch spec is interpreted. | ||
| version: 2 | ||
| name: NAME-OF-YOUR-BATCH-CHANGE |
There was a problem hiding this comment.
Tiny comment, as a user I would find # "version" determines how the batch spec is interpreted to be a bit mysterious. Maybe we could say
version: 2 # Use the latest schema version
name: ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This bumps sourcegraph/sourcegraph/lib to pull in the latest changes from https://github.com/sourcegraph/sourcegraph/pull/63613 to support the new
versionfield for batch specs.Notes:
resolveWorkspacesForBatchSpec, which takes the serialized spec. This means all the logic to resolve repos is outsourced to Sourcegraph. This is great news for this PR because we don't have to worry howon.RepositoriesMatchingQueryis interpreted. The code path in which src-cli itself resolves the workspaces was removed in Remove src-cli workspace resolution #819.Test plan
src batch new -f test.spec.yaml(-> spec containsversion: 2)src batch apply -f test.spec.yaml(-> validation passes, batch spec shows up in Sourcegraph db)src batch validate -f test.spec.yaml(-> validation passes or fails if I change the version to an unsupported value)src batch repos -f test.spec.yaml(-> checked that returned repos match with expected pattern type)Closes SPLF-126