Add WorkspacesExecutionInput to lib/batches (#24720)

`WorkspacesExecutionInput` is the struct that will be serialized on
the Sourcegraph side and de-serialized in src-cli when we run single
workspaces.

Not 100% sure yet the names will stay like this forever or whether we
run into a collision but I think they're good for now.

Co-authored-by: Erik Seliger <erikseliger@me.com>
This commit is contained in:
Thorsten Ball 2021-09-08 11:34:16 +02:00 committed by GitHub
parent d5920f2696
commit 2bfda92388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,30 @@
package batches
type WorkspacesExecutionInput struct {
RawSpec string `json:"rawSpec"`
Workspaces []*Workspace `json:"workspaces"`
}
type Workspace struct {
Repository WorkspaceRepo `json:"repository"`
Branch WorkspaceBranch `json:"branch"`
Path string `json:"path"`
OnlyFetchWorkspace bool `json:"onlyFetchWorkspace"`
Steps []Step `json:"steps"`
SearchResultPaths []string `json:"searchResultPaths"`
}
type WorkspaceRepo struct {
// ID is the GraphQL ID of the repository.
ID string `json:"id"`
Name string `json:"name"`
}
type WorkspaceBranch struct {
Name string `json:"name"`
Target Commit `json:"target"`
}
type Commit struct {
OID string `json:"oid"`
}