batches: add src batch remote -f spec.yml for SSBC execution#671
Conversation
This is fragile, and probably sub-optimal in a bunch of ways right now. The UI progress reporting is shoddy, the construction of the final preview link is terrifying, and there's no separation of SSBC/CSBC services. But, there's one thing that is ready for us all to talk about: what noun and verb do we use in the command structure? I've chosen `remote` and `run`, respectively. `run` matches the UI. `remote` is there because users won't really think of "server" or "SSBC" as concepts, but "remote" feels like a good description of what's going on. An open question: should the existing commands move to a `src batch local` namespace, with everything aliased for now to make it work? Another open question: should there even _be_ namespaces there? Please discuss.
|
Just to reiterate the draftiness of all this: I think I'm going to move the get/create/replace logic into a new mutation on the backend, after sleeping on it. So, again, don't get too hung up on how this works just yet. |
Why do we need a
IMHO: No
I'd use a different command, not a flag. |
I could see status commands being under I don't love @malomarrec, since you wrote the original issue here with a flag, what are your thoughts? |
I could see this being integrated in CI or another automation, and users using SSBC as part of a longer toolchain and scripting around it. That said, none of the options are incompatible with this, it's just that having |
|
One reason I had in adding the With that in mind, I actually like Adam's proposal: |
|
I'm also on board with the proposal for I also would have voted for using the Personally, I'd love if users were able to configure which environment the alias |
|
My question regarding (I somehow assumed we're only talking about a command that "submits" a batch spec to Sourcegraph and prints a URL to watch the execution.)
My thinking here is kinda: the CLI is a local tool (and not required for SSBC) so local execution should be the first-class citizen there and on Sourcegraph itself SSBC is the #1 thing, so it's the recommended way there. |
src batch remote -f spec.yml for SSBC execution
| "github.com/cockroachdb/errors" | ||
| ) | ||
|
|
||
| var ErrServerSideBatchChangesUnsupported = errors.New("server side batch changes are not available on this Sourcegraph instance") |
There was a problem hiding this comment.
I had a meta question about the user-facing way that refer to the feature known internally as SSBC, but it's not at all a specific concern about this PR, so I realized it's probably better suited to a team sync and will put it there instead. 🙂
Closes sourcegraph/sourcegraph#26503.
This PR depends on sourcegraph/sourcegraph#30448.
Given the feedback from the draft version of this PR, the new command is
src batch remote -f spec.yml. I promise that I'll figure out how to have commander handle optional sub-sub-commands if we decide to add asrc batch remote listor similar later.Although it's a few hundred lines, this is basically 95% boilerplate — the bulk of the logic is really in the backend PR, and backend service methods that were created early in the SSBC development process. We just have lots of (IMHO) uninteresting code to set up the command, wrap the GraphQL queries and mutations, and report progress.
Closes sourcegraph/sourcegraph#26503.