You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a group is configured as an approver, individual members of that group can submit their approval by adding their response to the `users` array under the group entry. Multiple group members can approve independently, and each approval counts toward the `approvalsReceived` total.
121
151
152
+
Initially, the group approver entry does not have a `users` field:
153
+
154
+
```yaml
155
+
spec:
156
+
approvers:
157
+
- name: alice
158
+
type: User
159
+
input: pending
160
+
message: ""
161
+
- name: release-managers
162
+
type: Group
163
+
input: pending
164
+
message: ""
165
+
numberOfApprovalsRequired: 2
166
+
```
167
+
168
+
The first group member creates the `users` array and sets the group's `input` to approve:
169
+
170
+
```bash
171
+
# First member (bob) from release-managers group approves
The first command helps you determine the array index for your approver entry. The JSON patches then update only the matched entry's `input` and `message`, whether it represents a user (`alice` in the example) or a user impersonating a group (`bob` acting for `release-managers`). The controller sets the corresponding `CustomRun` and `PipelineRun` to `Succeeded` or `Failed` accordingly: approvals accumulate until `numberOfApprovalsRequired` is satisfied, while any rejection immediately fails that section of the pipeline.
213
+
After these patches, check the group entry and status to see all members' responses:
In this example, both `bob` and `carol` from the `release-managers` group have approved. Each approval from a group member increments `approvalsReceived` separately, so two group member approvals count as two approvals toward the required total. The `status.approversResponse` shows detailed approval information including individual group members' responses.
268
+
269
+
**Key points for group approvals:**
270
+
271
+
- Each group member must perform **two required operations**: add their entry to the `users` array AND set the group's `input` (either `approve` or `reject`). Optionally, they can also set the group's `message`
272
+
- The first group member creates the `users` array using path `/spec/approvers/<index>/users` with an array value
273
+
- Subsequent members append to the array using path `/spec/approvers/<index>/users/-` where `-` appends to the array end
274
+
- Each user entry in the `users` array contains only `name` and `input` fields (no `message` field within the user entry)
275
+
- The group-level `message` field is optional and shared; it will be overwritten by subsequent responses if they provide a new message
276
+
- Each group member approval increments `approvalsReceived` independently
277
+
- Multiple members from the same group can approve, and each counts toward the required total
278
+
- The `status.approversResponse` field tracks detailed approval information including individual group members
279
+
- Use `--as <username> --as-group <groupname>` to identify as a group member when patching
280
+
281
+
The controller sets the corresponding `CustomRun` and `PipelineRun` to `Succeeded` or `Failed` accordingly: approvals accumulate until `numberOfApprovalsRequired` is satisfied, while any rejection immediately fails that section of the pipeline.
133
282
134
-
> **Tip:** Use `--as <username>` (required) and optionally `--as-group <group>` when you need to approve as a specific identity. The validation webhook allows you to modify only the entry that matches that impersonated user, so you often impersonate a user while also attaching the relevant group. RBAC must grant you impersonation rights. For example, `kubectl patch ... --as release-robot --as-group release-managers` simulates a service account acting for the `release-managers` group.
283
+
> **Tip:** Use `--as <username>` (required) and `--as-group <group>` when you need to approve as a specific identity. The validation webhook allows you to modify only the entry that matches that impersonated user and group. RBAC must grant you impersonation rights. For example, `kubectl patch ... --as bob --as-group release-managers` identifies you as user `bob` acting within the `release-managers` group.
135
284
136
285
### 4. Extend `PipelineRun` timeouts for long approvals
0 commit comments