Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow previewing of changesets for unsupported code hosts #11193

Closed
sqs opened this issue Jun 1, 2020 · 1 comment · Fixed by #11793
Closed

Allow previewing of changesets for unsupported code hosts #11193

sqs opened this issue Jun 1, 2020 · 1 comment · Fixed by #11793
Assignees
Labels
batch-changes Issues related to Batch Changes estimate/1.5d planned/3.18
Milestone

Comments

@sqs
Copy link
Member

sqs commented Jun 1, 2020

Right now, if you try to create a patch on a repo that is not supported (eg because it's on GitLab or another non-supported code host), it is silently discarded:

https://sourcegraph.com/github.com/sourcegraph/sourcegraph@615077bc91a6208bb60288fedba19a0adc5d6d1d/-/blob/enterprise/internal/campaigns/service.go#L82:17

This is surprising and prevents someone from trying out campaigns if their code host is not yet supported.

Proposed behavior: You can create patches on any repository (that you can view). In the list of patches, a patch that is against an unsupported repository will not have a publish button and instead will have an indication that it can't be published because the code host is not yet supported. If you try to publish them via the GraphQL API, the publish operation will fail with an error (as it does currently).

TODO(sqs): make a mock for this

@sqs sqs added the campaigns label Jun 1, 2020
@sqs sqs added this to the 3.17 milestone Jun 1, 2020
@sqs sqs modified the milestones: 3.17, Backlog Jun 1, 2020
@sqs sqs changed the title Allow drafting of changesets for unsupported code hosts Allow previewing of changesets for unsupported code hosts Jun 1, 2020
@mrnugget mrnugget assigned eseliger and unassigned LawnGnome and mrnugget Jun 18, 2020
@mrnugget mrnugget added batch-changes Issues related to Batch Changes estimate/1d labels Jun 18, 2020
@mrnugget
Copy link
Contributor

mrnugget commented Jun 18, 2020

We just discussed this in planning meeting and @eseliger is going to work on this as preparation for the new campaigns flow.

What we're going to do is to accept patches for unsupported code hosts but not allow their publication. That'll still be necessary once we have the flow in place.

Tasks:

  • Move the IsRepoSupported checks so that patches from unsupported repositories are accepted, but not published (checks need to be moved to the Service and possibly the ExecChangesetJobs function)
  • In publishChangeset mutation we should return an error
  • In publishCampaignChangesets mutation we should skip them
  • We should add a Publishable: boolean property to Patch in the GraphQL API
  • We need to remove the "is supported" check in src-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batch-changes Issues related to Batch Changes estimate/1.5d planned/3.18
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants