Backend: New campaign flow
Created by: eseliger
Docs/Schema in PR #10921
STATUS: WIP pull request is https://github.com/sourcegraph/sourcegraph/pull/11675 and the tasks below as a WIP until we've done 3.19 planning.
Conceptual/Docs/GraphQL Schema
The PR in which these higher-level changes should be proposed/made/discussed is https://github.com/sourcegraph/sourcegraph/pull/10921
-
Schema for tracking existing changesets in campaign-spec.yml
Implementation Backend
The list below is not complete, but a rough overview of what has been done and needs to be done:
-
Pull in the GraphQL schema from https://github.com/sourcegraph/sourcegraph/pull/10921 as a skeleton (with only "TODOs" as implementation) -
Remove GraphQL resolvers and majority of campaigns.Servicemethods that were only used in old workflow (I decided to keep the type definitions and database tables forPatch/PatchSet/ChangesetJobaround, even though I anticipate that we will need to remove them) -
Add campaign_specs&changeset_specsdatabase tables, Go type definitions and methods incampaigns.Store -
Add CampaignSpecByIDquery andCampaignSpecresolver (some methods still have TODOs) -
Add ChangesetSpecByIDquery andChangesetSpecresolver (some methods still have TODOs) -
Implement createChangesetSpecmutation -
Implement createCampaignSpecmutation -
Implement applyCampaignSpec -
Implement moveCampaignmutation -
Update the GraphQL API to reflect newest state in #10921 -
Move fields from CampaignSpec.SpectoChangesetSpec.Descriptionafter newest updates to #10921 -
Validate CampaignSpecin(*Service).CreateCampaignSpec(depends on schema, see above) -
Validate ChangesetSpecin(*Service).CreateChangesetSpec(depends on schema, see above) -
Allow on:(unquoted!) in YAML definition ofCampaignSpec -
Expire {Campaign,Changeset}Specs-
Return proper value in {Campaign,Changeset} Spec.ExpiresAt
-
-
Implement ChangesetSpec/CampaignSpecresolvers so thatCampaignSpec.PreviewURLworks -
In createCampaignSpeccheck the user has access to the namespace it's creating the spec for. -
In moveCampaigncheck the user has access to the new namespace. -
Implement Changeset.StatusAPI-
Add new statefield toChangeset -
Create "pending"/"unpublished" changesets when applying a CampaignSpec-
Add internal statefield tochangesets -
Add changeset_spec_idtochangesets
-
-
... many more things I have in a separate list
-
-
Implement the Reconcilerthat picks up unreconciled campaigns and creates the desired state -
Implement tracking/importing of manual changesets