batches: add upsert mutation for SSBC
Created by: LawnGnome
This PR adds an upsert batch spec from raw mutation, which both speeds up and simplifies the logic in https://github.com/sourcegraph/src-cli/pull/671.
Logic is basically pulled from the existing create and replace mutations: the checks and behaviour should be identical to doing:
spec = getBatchSpecFor(namespace, raw.name)
if spec:
replaceBatchSpecInput(spec, raw)
else:
createBatchSpecFromRaw(raw)
Related to #26503 (closed).