Add BaseRef field to CampaignPlanPatch and use commitID in BaseRevision
Created by: mrnugget
This implements the src CLI tasks of https://github.com/sourcegraph/sourcegraph/issues/8846
With this change src CLI uses the commit ID (instead of refspec) as the
CampaignPlanPatch.BaseRevision
when creating a CampaignPlan
.
It also adds the additional baseRef
field to CampaignPlanPatch
and
sends that to the GraphQL.
Since Sourcegraph <3.14 expects the baseRevision
of a
CampaignPlanPatch
to contain a ref (e.g. "refs/heads/master") we check
the Sourcegraph version and fall back to that behaviour so that
customers can use a newer src CLI version with their <3.14
instance.
With the addition of these fields to ActionRepo and CampaignPlanPatch the cache of src CLI is now also busted when the revision of the default branch of a repo changes.