Review and Approve Changes
A change in ConfigHub is reviewed the way a pull request is reviewed on GitHub: the author asks people to review it, reviewers comment on lines of the diff, and each records an approval or a rejection, which a gate can require before the change goes further. What is reviewed is a named change. A ChangeSet groups the revisions of one change, in one or more Spaces, and is reviewed before it is closed, much as a pull request is reviewed before it is merged. A ChangeOrder carries a change from stage to stage, and is reviewed as it stands in each stage before it is promoted further or released. An approval or rejection is recorded as an Attestation, a record of who approved which revisions that cannot be edited afterwards, and a ChangeWorkflow says which approvals each step requires.
This guide covers asking for reviews, finding the ones that wait for you, commenting, approving, and requiring approval. Make Changes and Track and Promote Changes describe ChangeSets and ChangeOrders themselves.
Asking for a review
Name reviewers by username when you create a ChangeSet, a draft's proposal or a ChangeOrder, or later:
cub changeset create --space acme-home release-v452 --description "Release 452" --request-review alice
cub changeset update --space acme-home release-v452 --request-review bob
cub changeset update --space acme-home release-v452 --withdraw-review-request bob
cub draft propose acme-dev/raise-memory --description "Raise the web container's memory to 1Gi" --request-review alice
cub changeorder update --space acme-base release-v452 --request-review staging:alice,prod:carol
A ChangeOrder's request names the stage where the reviewer should look, as <stage>:<user>. With no stage, it asks for a review in the ChangeOrder's Origins, the Spaces the change comes from. Asking again re-requests the review.
A request is not cleared when the review is given. Whether a reviewer has reviewed is read from the Attestations they recorded, so a change made after an approval leaves that approval out of date, and the review waits again.
Finding what waits for you
cub inbox list
lists the reviews that wait for you, longest wait first: a ChangeSet or ChangeOrder whose gate names you, or one someone asked you to review, in a Space where you may approve. A review your approval would not count for, such as one of a change you wrote, is not listed. Each row gives the reason, the change as <space>/<slug>, the stage or how many Spaces wait or who asked, and how long it has waited. With CONFIGHUB_AGENT set, each row is followed by the command that opens the change, so an agent can run cub inbox list at the start of a task and work through the list.
Commenting on a change
In the UI, the pages of a ChangeSet and a ChangeOrder show the diffs of the change, Unit by Unit, and a review comment can be left on a line of a diff or on a whole resource, and answered in a thread. A comment made on an earlier revision than the diff shows is marked outdated.
The same comments are made and read with cub review-comment. A comment is on one revision of a Unit, and optionally about one resource and one path in it:
cub review-comment create acme-dev/web --revision-num 4 \
--resource apps/v1/Deployment:acme/web --path spec.replicas --text "Why 5 replicas?"
cub review-comment list acme-dev/web
cub review-comment create acme-dev/web --revision-num 4 \
--reply-to <comment-id> --text "Load test results; see the change description."
Comments on the revisions a ChangeSet made are part of its review, since those revisions are marked with it. A ChangeOrder's review can also be about a Unit it has not changed yet, such as one in a later stage: pass --change-order to make the comment part of its review. Review comments are discussion of the change. Explaining why the configuration is what it is belongs in the configuration itself, as a comment in the Unit's data, or in the change description.
Approving and rejecting
cub variant approve records an approval of the revisions a change made, in one or more Spaces:
# Approve a ChangeSet's change in the Space it changed
cub variant approve acme-dev --all --revision ChangeSet:acme-home/release-v452
# Approve a ChangeOrder's change as it stands in every staging Space
cub variant approve --change-order acme-base/release-v452 --stage staging
# Reject it, with the reason
cub variant approve acme-staging-euw1 --change-order acme-base/release-v452 \
--reject --note "breaks the EU ingress"
The UI offers the same as Approve and Reject on the ChangeSet's page and on each stage of the ChangeOrder's page. Three rules decide what an approval counts for:
- An approval covers content. It covers the revisions it names, and any later revision of the same Unit with identical content. A revision with different content needs approving again.
- The authors of a change don't count. Whoever wrote a revision of the change in a Space can't approve it there, which is the separation of duties a review is for. A ChangeWorkflow can turn this off with
AllowAuthors, for a team of one. - A rejection blocks a requirement until it is revoked. Attestations can't be edited or deleted:
cub attestation revokerecords a revocation beside one, and a new one records the changed mind.
Recording approvals describes the flags: --note, --claim for a change ticket, --expires-in, --where and --revision. cub attestation create --type records other kinds of sign-off, such as a security review, which a workflow can require the same way.
Requiring approval
Approvals are only advice until a ChangeWorkflow requires them. Its AttestationPrerequisites name how many approvals are needed and from whom, and where they are named decides what they gate:
- Closing a ChangeSet, when they are named in the
Finalof the workflow the ChangeSet was created with. See gating the close with a ChangeWorkflow, and proposing a draft, which gates landing the draft the same way. - Promoting a ChangeOrder into a stage, when they are named in the stage's
Prerequisites, and releasing it in a stage, when they are named in itsReleasePrerequisites. See requiring approvals.
A refusal names the requirement and the revision that falls short. A ChangeSet's close can be forced with a reason, which is recorded on the ChangeSet with the gates that did not hold.
To make review mandatory, the way a protected branch accepts changes only through a pull request, require it on the Component. --require-change-workflow refuses a promotion, a release or a ChangeSet with no ChangeWorkflow, --allowed-change-workflow limits which workflows may govern changes to its variants, and --require-change-tracking refuses a change to their configuration that is made outside a ChangeSet or ChangeOrder:
cub component update --patch acme --require-change-tracking --require-change-workflow \
--allowed-change-workflow acme-workflows/acme-main-line,acme-workflows/release-review
See requiring a workflow and requiring a ChangeSet or ChangeOrder.
Related reading
- Attestation and ChangeWorkflow, the entities behind approvals and their requirements
- Audit Who Did What, for the record of who approved, forced or changed what
- Protect Precious Entities, for keeping entities from being changed or deleted at all