a8n: Implement skeleton API and CRUD layer for running campaigns
Created by: mrnugget
This implements the skeleton of the API described in https://github.com/sourcegraph/sourcegraph/pull/6135/files
Differences:
- https://github.com/sourcegraph/sourcegraph/pull/6135/files#r339048480
- Didn't implement all changes from
String
toJSONCString
(see #6135)
It also adds a database CRUD layer for two new entities — CampaignPlan
and CampaignJob
— and uses those CRUD methods where easy to do so.
Most importantly: it adds a lot of placeholders and TODO(a8n)
that then need to be filled out.
It doesn't do anything yet, but having this skeleton GraphQL layer and database layer in place helps us parallelize and makes future PRs easier to review.
Requires: https://github.com/sourcegraph/sourcegraph/pull/6135/files
Run previewCampaignPlan
locally: click here
mutation PreviewCombyCampaign($spec: CampaignPlanSpecification!) {
previewCampaignPlan(specification: $spec) {
__typename
... on CampaignPlan {
...CampaignPlanFields
}
}
}
fragment CampaignPlanFields on CampaignPlan {
id
type
arguments
status {
completedCount
pendingCount
state
errors
}
changesets {
nodes {
title
body
diff {
fileDiffs {
nodes {
hunks {
body
}
}
}
}
repository {
name
url
}
}
}
}