In src/batch_remote.go we create the batch spec but we forget to make sure the batch change exists first. 🙃 It was previously possible to view a remote execution in isolation without a parent batch change, but this is no longer possible. However, with src-cli, it's possible to run a remote execution for a batch change that already exists or doesn't yet exist, whilst the mutation that the frontend UI uses to create the empty batch change (CreateEmptyBatchChange) fails if a batch change by that name already exists, so we either need to:
- Create a new mutation like
UpsertEmptyBatchChange that doesn't fail if a batch change by that name already exists, or
- Add a new parameter to
CreateEmptyBatchChange like allowUpsert that changes the behavior of the mutation so that it doesn't fail.
We should then call that mutation from src/batch_remote.go before we call CreateBatchSpecFromRaw, so that the batch change exists to load from for the preview link.
In
src/batch_remote.gowe create the batch spec but we forget to make sure the batch change exists first. 🙃 It was previously possible to view a remote execution in isolation without a parent batch change, but this is no longer possible. However, with src-cli, it's possible to run a remote execution for a batch change that already exists or doesn't yet exist, whilst the mutation that the frontend UI uses to create the empty batch change (CreateEmptyBatchChange) fails if a batch change by that name already exists, so we either need to:UpsertEmptyBatchChangethat doesn't fail if a batch change by that name already exists, orCreateEmptyBatchChangelikeallowUpsertthat changes the behavior of the mutation so that it doesn't fail.We should then call that mutation from
src/batch_remote.gobefore we callCreateBatchSpecFromRaw, so that the batch change exists to load from for the preview link.