Skip to content

a8n: Implement skeleton API and CRUD layer for running campaigns

Administrator requested to merge a8n/prototyping into master

Created by: mrnugget

This implements the skeleton of the API described in https://github.com/sourcegraph/sourcegraph/pull/6135/files

Differences:

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
      }
    }
  }
}

Merge request reports

Loading