Add BaseRef field to CampaignPlanPatch and use commitID in BaseRevision#158
Merged
Add BaseRef field to CampaignPlanPatch and use commitID in BaseRevision#158
Conversation
This implements the src CLI tasks of sourcegraph/sourcegraph#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.
eseliger
approved these changes
Mar 11, 2020
ryanslade
approved these changes
Mar 12, 2020
Co-Authored-By: Erik Seliger <erikseliger@me.com>
mrnugget
added a commit
to sourcegraph/sourcegraph-public-snapshot
that referenced
this pull request
Mar 12, 2020
This is part of sourcegraph/sourcegraph#8846 and bumps the src CLI so that sourcegraph/src-cli#158 is included.
mrnugget
added a commit
to sourcegraph/sourcegraph-public-snapshot
that referenced
this pull request
Mar 12, 2020
This is part of sourcegraph/sourcegraph#8846 and bumps the src CLI so that sourcegraph/src-cli#158 is included.
scjohns
pushed a commit
that referenced
this pull request
Apr 24, 2023
…on (#158) * Add BaseRef field to CampaignPlanPlatch and use commitID in BaseRevision This implements the src CLI tasks of sourcegraph/sourcegraph#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. * Update cmd/src/campaign_plans_create_from_patches.go Co-Authored-By: Erik Seliger <erikseliger@me.com> Co-authored-by: Erik Seliger <erikseliger@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.BaseRevisionwhen creating aCampaignPlan.It also adds the additional
baseReffield toCampaignPlanPatchandsends that to the GraphQL.
Since Sourcegraph <3.14 expects the
baseRevisionof aCampaignPlanPatchto contain a ref (e.g. "refs/heads/master") we checkthe 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.