src-cli: Implement new campaigns workflow
Created by: mrnugget
Docs/Schema in PR #10921
Tasks
-
Implement src campaigns apply
(see this comment https://github.com/sourcegraph/sourcegraph/pull/10921#issuecomment-648599857) -
Validate campaign spec YAML according to schema - I think duplicating that schema between here and
src-cli
is fine for now. If we can find a better solution that hassrc-cli
fetch the schema from Sourcegraph: great.
- I think duplicating that schema between here and
-
Create changesetSpecs
with thecreateChangesetSpec
mutation (see schema here), remembering their IDs -
Create campaignSpec
, using the IDs as input -
Print preview URL if user doesn't want to apply -
Call applyCampaign
if user wants to apply
Plus: clean up the code, possibly add tests, move code to smaller packages instead of the ./cmd
folder, etc.
First deliverable
A draft PR that implements the new command and flow for us to test to validate how the UX feels.