a8n: Allow closing and deleting of Campaigns
Created by: mrnugget
This is a follow-up to https://github.com/sourcegraph/sourcegraph/issues/6727 and the first PR that fixes it https://github.com/sourcegraph/sourcegraph/pull/7015.
In this comment (and the following) we noticed that in order to meet base level expectations of customers, we need to implement the proper closing and deleting of Campaigns.
@christinaforney proposed the following:
- Add the ability to comment on a changeset in a code host
- When closing a campaign, comment on the changeset to indicate that the campaign that created it has been closed.
- Close the changeset on the code host when a campaign is deleted.
But the "Campaigns can be closed" section in RFC 36 describes the behavior as follows:
Campaigns can be closed. After a campaign is closed, any user visiting the campaign will be prompted to close all changesets in the campaign if any are open. Upon clicking this button, all of those changesets will be closed on the code host.
- A closed campaign has the same UI styling as a closed PR on GitHub (e.g., red).
- Site admins can delete a campaign, which completely removes it (but does not affect the underlying changesets or branches on the code host).
What @christinaforney and I agreed on in a meeting yesterday was that the minimal thing we need to implement:
-
When a Campaign
is closed itsChangesets
will be closed on the codehost
That we're sure of. What we still need to answer:
-
What happens to Changesets on the codehost when a campaign is deleted? -
Should we comment on Changesets when closing a Campaign? -
Should we comment on Changesets when deleting a Campaign? -
Is there a difference in behavior when closing/deleting a campaign if the Campaign is a "manual" campaign and the changesets have not been created by Sourcegraph?
(I personally think we should go with the proposal from RFC 36 since that is the least invasive and from a users perspective the most expected behavior. I don't think we need to post comments, since the timeline on the codehost will show "$user-associated-with-token closed PR" anyway.)