Implement unpublish / redraft for changeset specs
Created by: eseliger
Currently, changing published
from true
to false
does nothing, which is counter-intuitive and doesn't support our claim that we "always try to reconcile the state given in the spec". Also, it might be a feature you want to have, closing open changesets, while retaining them so you can open them again later (ie. you found a problem with your campaign and want to temporarily suspend reviews).
That would include three additional state transitions of changesets:
- true => false
- draft => false
- true => draft
The first two are kind of the same, basically run operation close
, but not operation detach on those changesets.
The third case requires us to add a reconciler operation redraft
, and to implement a method on the ChangesetSources RedraftChangeset
, which would turn the changeset into draft mode again. For GitLab this would be adding the WIP:
prefix again, for GitHub calling an API to convert the PR back to draft. (As of now, I think this API doesn't exist, though... it's only available in their UI.)