-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@@ -1,90 +1,121 @@ | |||
# Campaigns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc page is much easier to read at http://docs.sourcegraph.com/@campaigns-new-flow/user/campaigns than in this diff.
|
||
## What are campaigns? | ||
The changes made by campaigns usually fit into a few general categories: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to clarify that YOU (the user) choose what type of changes to make, it’s not something automatic or (yet) built in
Like it so far! One note though on something that has been a source of confusion in the past too: we should settle on a terminology to describe the There's a few different phrases we use around that and they're often used interchangeably:
|
275917e
to
2c59c72
Compare
I started on the wireframes for the new flow, but I got stuck on how to handle the fact that both editing name/description or patches can trigger an update to all changesets. Need to work on this some more, hopefully tomorrow morning PDT. |
4df6736
to
8d10c36
Compare
@@ -893,6 +936,52 @@ type ChangesetConnection { | |||
|
|||
# Pagination information. | |||
pageInfo: PageInfo! | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore the rest of the GraphQL diff below here. It was just for the UI mockup, it's not an important part of the proposed API for the new campaigns flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the consistency of the updated API!
Further general thoughts:
- I don't think "do we need to keep track of IDs on the client?" is a problem anymore.
- Adding to my previous comment (https://github.com/sourcegraph/sourcegraph/pull/10921#discussion_r440854517) I'm worried that adding
ChangesetSpec
s as separate entities (addressable by ID) would not simplify things a lot on the backend. One idea I had was to have something likecreateChangeset(spec: ChangesetSpecInput): Changeset!
but then have the reconciler only pick up the changeset as soon as it's attached to a campaign. Thespec
would be saved in a column on changeset. That would've been the changeset-equivalent tocreateCampaign(spec: CampaignSpecInput: changesets: [ID!]): Campaign
. That would simplify things in the backend, I think. But feel free to ignore that.
(I renamed I don't like Anyway, if this helps, in the backend, you can still create a |
Got it! That's a good way of thinking about it (and, in hindsight, the obvious way 😉 ) |
@sqs okay, that sounds good! I'm trying to keep track of what I'm stilling missing here and what we need to define. Since I found it helpful to summarise my comments above, let me add the list here too, even though it's duplicating some of the comments:
cc @eseliger |
From here:
That makes me wonder whether we should add a "close flag" to the spec as well. The desired state would be |
I removed all impl changes from this PR because they are in https://github.com/sourcegraph/sourcegraph/pull/11675. This PR now contains only docs changes and GraphQL API changes, to make it easier to review. |
No, I don't think this is necessary. The source of truth for "desire for a changeset to be closed" is the code host, not the campaign spec. (In contrast, the source of truth for "desire for a changeset to be published" is the campaign spec.) If you "close" a changeset in a campaign, that should translate directly into closing the (eg) pull request on GitHub. So, then, consider this case: You just closed (either on GitHub or via Sourcegraph, which are 100% equivalent) the campaign's pull request in repository What happens? Well, here's what we want to happen: nothing. The campaign should respect that its changeset was closed.
So, what if we implement a nice, multi-select batch operation UI for changesets, and then you select 500 changesets and click "Close 500 selected changesets"? That is a distributed operation, and it may be tempting to say "at least for implementation purposes, we should model that as though those changeset templates had ("A-ha", you might say, "this is true--but if you close a campaign and want to close associated changesets, that is another distributed operation, and we should (for implementation purposes) represent that as though you set |
@eseliger @LawnGnome Check out my updates:
Feedback appreciated! I am working down the checkboxes at https://github.com/sourcegraph/sourcegraph/pull/11675. (@mrnugget is on vacation.) |
This contains doc and GraphQL API changes only. See https://github.com/sourcegraph/sourcegraph/pull/11675 for the implementation.
This incorporates the docs changes from #10921. These changes are what we're implementing now, so merging them in now will make it easier to review any changes from here.
Replying here to both changes ( If I understand the changes correctly, it would mean that a lot of the fields that are defined in
Correct? If so, that would be a change from what I've started to implement in https://github.com/sourcegraph/sourcegraph/pull/11675 — a slight change, since I've left that part under-defined on purpose. In the current implementation, the I think your proposal is a good step forward and answers multiple of my conceptual/graphql questions in https://github.com/sourcegraph/sourcegraph/pull/11675 but to clarify our shared understanding, I think we really need to answer these two questions in particular:
I think the answer to (1) is the And the answer to (2) is practically the What do you think? (Implementation note: I'm slightly worried about all the "write" overhead to the database, since |
Here is my response based on my thinking. Feel free to challenge my assumptions if you have better ideas.
Yes, validated and evaluated client-side. The
Yes.
Yes, although it could be confusing to allow specifying the namespace in the YAML file and in a CLI flag. See kubernetes/kubernetes#7789 for discussion of how this works for
Yes. I think it's good to make the ChangesetSpecs comprehensive. This will increase their expressive power. Right now, we don't have a way to have different changeset titles, descriptions, commit messages, etc., among the various changesets in a campaign, but I can certainly see that being useful. (Think of a lint campaign where the changesets say which lint problems were actually found, or where there are different manual steps to revoke different types of tokens leaked in code in addition to just removing them.)
Yes.
Yes. |
I just pushed c346293, which adds a |
See slack for storybook access. After yesterdays call, I've filled the properties of the The branch also includes changeset state updates, but don't look at them yet, they were based on Adams state diagram. I've created a separate one here: https://docs.google.com/drawings/d/1hicy46Cct9bU3DYdy-uskp1lxQ0KLj5rYdHBYVp7hh8/edit, please take a look there and once we are happy with how it turned out, I'll update the schema and the storybook page here: https://5f078f888555130022c12385-qnepitfatb.chromatic.com/?path=/story/web-changesetnode--visible-changeset Work items
|
@LawnGnome @sqs I just discussed Erik's proposed schema (https://github.com/sourcegraph/sourcegraph/commit/44bb1e1e8ec15dee8177971e1787613ff8fafc47) and state diagram on a Zoom call. Can you both also take a look and see if you can spot something that's wrong/could be improved? The one big thought that just came up in our discussion was: should we create "empty" changesets when we create a changesetSpec (or: do we use a single table for both)? The reasoning behind this question is that the preview-delta-API as proposed by Erik above used |
I thought about this ☝️ some more. The two biggest question marks we have left in this new flow are:
Erik's proposal above combines them, by re-using the preview query to get the current status of the campaign. After thinking about this since Friday, I don't think that's a good idea. It mixes two previously unrelated concepts ("status" and "preview") with the hope of getting making things simpler by making them conform to a single concept. The result is complex, though, and would require us to bend over backwards to fit the preview API into the concept of a status API (by requiring us to create changesets for changeset specs that haven't been applied yet, for example). Instead I think we should take Erik's proposed status API (which, in fact, is more a storybook right now) which would allow API consumers to get the "status" of a campaign by querying its changesets and fully design that. And then we should design a separate Let's discuss who's going to own the design of these two parts of the API on today's sync, because I think we need more and clearer ownership here :) |
Regarding CampaignDelta (requested by @mrnugget):
|
I think it should compare current status to the new spec. Why? Because we're not 100% declarative, meaning that the state of a changeset can change on a code host (from open to closed, for example) and we won't try to re-open it.
Can you expand on that? Do you think a first solution that has "a way to visually see a single campaign spec and all of its changesets" would just be that: the If that is acceptable as a first solution, I'd prefer to doing just that for now and defer the |
@sqs Did you have any ideas as to what the "preview" page for a campaign spec would look like? Now that we said we don't show a delta view there, I suppose it's a list of the CampaignSpec and its ChangesetSpecs. But when talking to @eseliger we realised that there might be different ideas here. Erik, for example, thought along the lines of "preview page is a variation of the campaign page". I think it should be a standalone page that looks decidedly different in its layout (so we don't get into the problem that we had with the CampaignDetails view where it was used to display a patchset and patches, a campaign and changesets, a campaign with a patchset and patches and changesets, etc.). And since we want to eventually implement a delta view, I assume, I don't think we should invest too much into the preview page. On the other hand, though, it's likely the first "campaigns" page that customers will see with the new flow. |
I agree it should look very different in its layout, kind of like how the Amazon checkout flow cuts out a lot of the noisy nav junk. I think it should have no search bar (GlobalNavbar variant I also think it should show all diffs and data, without the need to selectively expand/collapse.
I think many of the components will be reused between the preview page today, the campaign view page today, and the future delta view. So I don't think this is a dichotomy. The preview page today should look and feel really nice, but I don't think that will take a ton of work. Making it simple (as mentioned above) will go a long way to making it look nice. Another way in which it'll be simpler than in the past is that there will just be changesets, not patches+changesets. |
This adds back the examples we previously had, adopted to the new campaign specs. Where and how the examples are referenced follows what was proposed in https://github.com/sourcegraph/sourcegraph/pull/10921 but temporarily removed.
* Add examples to campaign docs This adds back the examples we previously had, adopted to the new campaign specs. Where and how the examples are referenced follows what was proposed in https://github.com/sourcegraph/sourcegraph/pull/10921 but temporarily removed. * Add the campaign spec YAML reference * Add -namespace argument to src commands and fix other things * Add note about combining tracking/creating changesets * Fix formatting and "user name" to "username" * Fix multiline YAML string in campaign spec reference
I am pre-writing the docs so we have a concise description of the new flow from the user's POV.
Preview as rendered docs at:
Figma mock (slightly behind the docs pages above): https://www.figma.com/file/kRf5i7xf1p4zs3OyX0DUVp/Campaigns
Docs that led to this change: RFC 157 and Campaigns CLI and naming/concepts idea. The proposals and motivations from those docs will be fully incorporated into this PR's
.md
doc changes.