Transition capability group: set_vote and transition_change behind write gates - #32
Merged
Conversation
SubmitChange, AbandonChange, RestoreChange, SetWorkInProgress, and SetReadyForReview cover the five change-state transitions, each behind the same write gate as reviews. go-gerrit exposes no /wip endpoint, so SetWorkInProgress rides a review via ReviewInput.work_in_progress -- same wire effect. Gerrit refusals (blocked submit, restore of a merged change) reach the caller verbatim through the recovered error body. Refs: #18
Sets a label vote with an optional message, riding the gated SetReview call as a labels map -- value 0 clears an own vote. The label name is required; range and label validation stay with Gerrit, whose rejection (unknown label, value outside the permitted range, vote on a merged change) is reported verbatim. Refs: #17
transition_change moves a change's state behind one action enum: submit (NEW -> MERGED), abandon (NEW -> ABANDONED), restore (ABANDONED -> NEW), wip, and ready. An optional message accompanies every action except submit -- Gerrit's submit endpoint takes none, so a message there is refused rather than dropped. The ack carries the resulting status when the endpoint returns one; Gerrit refusals (blocked submit) are reported verbatim. The transition capability group bundles get_change, set_vote, and transition_change -- the minimal read subset the flow needs to stand on its own. Refs: #17, #18
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.
Adds the transition capability group: label voting and change-state transitions, gated identically to the comment group.
SubmitChange,AbandonChange,RestoreChange,SetWorkInProgress,SetReadyForReview) sit behind the samecheckWriteScopegate as reviews; Gerrit refusals (blocked submit, restore of a merged change) surface verbatim from the recovered error body. go-gerrit exposes no/wipendpoint, so WIP rides a review viaReviewInput.work_in_progress.set_votesubmits a label vote (optional message) through the gatedSetReviewcall as alabelsmap; value 0 clears an own vote; label/range validation stays with Gerrit and its rejection is reported verbatim.transition_changemaps the action enumsubmit | abandon | restore | wip | readyonto the five endpoints; the description carries the state diagram. Submit takes no message in Gerrit's API — a message there is refused rather than dropped. The ack reports the resulting status when the endpoint returns one.get_change,set_vote, andtransition_change, so--groups transitionalone is self-sufficient.Closes #17
Closes #18