Skip to content

Transition capability group: set_vote and transition_change behind write gates - #32

Merged
xobotyi merged 3 commits into
mainfrom
feat/transition-group
Jul 10, 2026
Merged

Transition capability group: set_vote and transition_change behind write gates#32
xobotyi merged 3 commits into
mainfrom
feat/transition-group

Conversation

@xobotyi

@xobotyi xobotyi commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Adds the transition capability group: label voting and change-state transitions, gated identically to the comment group.

  • Client transition operations (SubmitChange, AbandonChange, RestoreChange, SetWorkInProgress, SetReadyForReview) sit behind the same checkWriteScope gate as reviews; Gerrit refusals (blocked submit, restore of a merged change) surface verbatim from the recovered error body. go-gerrit exposes no /wip endpoint, so WIP rides a review via ReviewInput.work_in_progress.
  • set_vote submits a label vote (optional message) through the gated SetReview call as a labels map; value 0 clears an own vote; label/range validation stays with Gerrit and its rejection is reported verbatim.
  • transition_change maps the action enum submit | abandon | restore | wip | ready onto 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.
  • The transition group bundles get_change, set_vote, and transition_change, so --groups transition alone is self-sufficient.

Closes #17
Closes #18

xobotyi added 3 commits July 10, 2026 22:29
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
@xobotyi
xobotyi merged commit 98a8246 into main Jul 10, 2026
4 checks passed
@xobotyi
xobotyi deleted the feat/transition-group branch July 10, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement transition_change tool Implement set_vote tool

1 participant