@chris1807/claude-kit 2.1.55 → 2.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -10
- package/bin/cli.js +89 -4
- package/package.json +1 -1
- package/templates/agents/global/qa.md +136 -0
- package/templates/commands/cherry-pick.md +125 -14
- package/templates/commands/create-release.md +1 -1
- package/templates/commands/deploy-release.md +134 -27
- package/templates/commands/promote.md +120 -11
- package/templates/commands/qa.md +353 -0
- package/templates/hooks/sensitive-data-output-blocker.sh +56 -18
- package/templates/hooks/uat-reminder.sh +1 -0
- package/templates/infrastructure/CLAUDE-WORKFLOW.md +86 -13
- package/templates/infrastructure/settings.json +9 -0
|
@@ -83,7 +83,8 @@ This will:
|
|
|
83
83
|
1. Create a release branch: release/{N}-to-{environment}
|
|
84
84
|
2. Cherry-pick all commits for the {count} work items
|
|
85
85
|
3. Create a PR targeting `{target-branch}` — merging it triggers the {environment} pipeline
|
|
86
|
-
4.
|
|
86
|
+
4. Ask who verifies each product group on {environment} (before the merge)
|
|
87
|
+
5. Watch the pipeline — once it's green, set the work items to `{state after merge}` and assign them to the approved verifiers
|
|
87
88
|
|
|
88
89
|
Proceed? (yes/no)
|
|
89
90
|
```
|
|
@@ -126,7 +127,7 @@ Options:
|
|
|
126
127
|
Which option? (1 / 2 / 3)
|
|
127
128
|
```
|
|
128
129
|
|
|
129
|
-
- **Option 1:** Run `git cherry-pick --skip` and continue. Note the skipped item in the summary — it does **not** get its state advanced in Step
|
|
130
|
+
- **Option 1:** Run `git cherry-pick --skip` and continue. Note the skipped item in the summary — it does **not** get its state advanced or its assignee changed in Step 10.
|
|
130
131
|
- **Option 2:** Run `git cherry-pick --abort`, delete the release branch, switch back. Report which items were NOT deployed.
|
|
131
132
|
- **Option 3:** Wait for the user to resolve and run `git cherry-pick --continue`, then proceed.
|
|
132
133
|
|
|
@@ -149,7 +150,76 @@ Cherry-picking commits for Release #{N}:
|
|
|
149
150
|
- **description**: List all work items included with their IDs and titles
|
|
150
151
|
3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
|
|
151
152
|
|
|
152
|
-
## Step 8:
|
|
153
|
+
## Step 8: Pick Who Verifies Each Group (before the merge)
|
|
154
|
+
|
|
155
|
+
The release is about to land in {environment} for **someone** to verify. Decide who now, while the PR is still in review — nothing is written yet; the assignment is applied in Step 10 together with the state change, once the pipeline is green.
|
|
156
|
+
|
|
157
|
+
### 8a. Group by title prefix
|
|
158
|
+
|
|
159
|
+
Work item titles in the CSI Development project are `PREFIX - Title` (`COM`, `PAY`, `CDA`, `AUD`, `SER`, `PSSF`, `TPS`, `ILP`, `RBWO`, `MTG`, `CSI`). Group the deployed **User Stories, Bugs, and Hot Fixes** by that prefix. Titles with a missing or unrecognized prefix go in a `(no prefix)` group. Items skipped on a conflict (Step 6) or dropped at the gate (Step 3) are not on the branch — leave them out. Features and Tasks are never assigned by this command.
|
|
160
|
+
|
|
161
|
+
A release that spans products lands in several groups — one question each. Different products usually have different verifiers, but the same person may take several groups; that is the normal case, not an error.
|
|
162
|
+
|
|
163
|
+
### 8b. Build each group's candidate list from the items themselves
|
|
164
|
+
|
|
165
|
+
For every item in the group, collect the distinct identities already on it:
|
|
166
|
+
|
|
167
|
+
- **whoever set the gate state** — `wit_work_item` `action: list_revisions`, then the `System.ChangedBy` on the revision where `System.State` became the target's gate state (`Ready for Staging`, `Ready to Deploy`, …). That is the QA person or stakeholder who signed the item off, and it is usually the right verifier.
|
|
168
|
+
- `System.CreatedBy` — who asked for the work
|
|
169
|
+
- comment authors — `wit_work_item` `action: list_comments`
|
|
170
|
+
- `System.ChangedBy` — the most recent editor
|
|
171
|
+
|
|
172
|
+
Then **drop the developers**, so what remains is the non-developer names on the item:
|
|
173
|
+
|
|
174
|
+
- each item's current `System.AssignedTo` (the dev who implemented it)
|
|
175
|
+
- the PR author
|
|
176
|
+
- the authors of the release commits — `git log --format='%an <%ae>' <target-branch>..HEAD | sort -u`
|
|
177
|
+
|
|
178
|
+
Rank the survivors by how many items in the group they appear on — the gate-state signer first, then creators. **Do not invent names**, do not pull from the org directory or a team list, and do not carry a name over from another group's items — every candidate must come from the items in that group.
|
|
179
|
+
|
|
180
|
+
If the developer filter empties a group's list, say so and show the unfiltered names marked `(also a developer here)`, plus the option to type a name.
|
|
181
|
+
|
|
182
|
+
### 8c. Ask
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
## Who verifies Release #{N} on {environment}?
|
|
186
|
+
|
|
187
|
+
**COM** — 2 items (AB#1234, AB#1236)
|
|
188
|
+
1. Jane Doe (jane@caresolutions.com) — set Ready to Deploy on both
|
|
189
|
+
2. Sam Lee (sam@caresolutions.com) — commented on AB#1234
|
|
190
|
+
3. Someone else — give me a name or email
|
|
191
|
+
4. Leave the current assignee alone
|
|
192
|
+
|
|
193
|
+
**PAY** — 2 items (AB#1240, AB#1241)
|
|
194
|
+
1. Pat Ruiz (pat@caresolutions.com) — created both
|
|
195
|
+
2. Jane Doe (jane@caresolutions.com) — commented on AB#1240
|
|
196
|
+
3. Someone else
|
|
197
|
+
4. Leave the current assignee alone
|
|
198
|
+
|
|
199
|
+
Reply per group — `COM 1, PAY 1` — or `all 1` to give the whole release to one person.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 8d. Confirm the mapping
|
|
203
|
+
|
|
204
|
+
Echo the resolved plan and wait for an explicit `yes`:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
When the {environment} pipeline goes green I will apply:
|
|
208
|
+
|
|
209
|
+
| ID | Title | Prefix | Assign to | State |
|
|
210
|
+
|----|-------|--------|-----------|-------|
|
|
211
|
+
| AB#1234 | COM - Add payment export | COM | Jane Doe | Staging |
|
|
212
|
+
| AB#1236 | COM - View history | COM | Jane Doe | Staging |
|
|
213
|
+
| AB#1240 | PAY - Fix login redirect | PAY | Pat Ruiz | Staging |
|
|
214
|
+
|
|
215
|
+
Approve? (yes / change)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`change` re-asks 8c. Only after `yes` do you move on — if the PR merges before the user answers, keep waiting for the answer, then run Step 10.
|
|
219
|
+
|
|
220
|
+
## Step 9: Watch the Merge, Then the Pipeline
|
|
221
|
+
|
|
222
|
+
Do NOT merge the PR yourself, and do NOT trigger the CD pipeline — it triggers on the merge. Report the PR, then watch for the deployment:
|
|
153
223
|
|
|
154
224
|
```
|
|
155
225
|
Release #{N} PR created for {environment}.
|
|
@@ -158,53 +228,90 @@ PR: {pr-url}
|
|
|
158
228
|
Branch: release/{N}-to-{environment} → {target-branch}
|
|
159
229
|
|
|
160
230
|
Work items included:
|
|
161
|
-
- AB#1234: Add payment export
|
|
162
|
-
- AB#
|
|
163
|
-
- AB#
|
|
231
|
+
- AB#1234: COM - Add payment export
|
|
232
|
+
- AB#1236: COM - View history
|
|
233
|
+
- AB#1240: PAY - Fix login redirect
|
|
234
|
+
|
|
235
|
+
Review and approve the PR — merging it triggers the CD pipeline for {environment}.
|
|
236
|
+
I'm watching the PR and that pipeline; when it comes back green I'll set these
|
|
237
|
+
{count} items to `{state after merge}` and assign them as approved above.
|
|
238
|
+
Nothing is written until then. Say `stop watching` to leave the states alone.
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
1. **Wait for the PR to complete.** Poll `repo_pull_request` until `status` is `completed`; note the merge commit and completion time. `abandoned` → stop, change nothing, report it.
|
|
242
|
+
2. **Find the CD run.** Look up the target branch's pipeline ID(s) in the Pipeline Configuration table, then poll `pipelines_build` for runs on `refs/heads/<target-branch>` queued at or after the merge time — match the merge commit when the run exposes it — and **capture each run's id**. A run that was already completed before the merge is not this deployment; ignore it. A branch with more than one pipeline (API + Client) must have **all** of them green.
|
|
243
|
+
3. **Wait for a terminal result** on each run: `succeeded`, `partiallySucceeded`, `failed`, or `canceled`.
|
|
244
|
+
|
|
245
|
+
**How to wait.** Never block on a foreground `sleep`. If the Azure CLI with the `azure-devops` extension is available, arm a background watch that notifies you on a terminal state:
|
|
164
246
|
|
|
165
|
-
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
|
|
247
|
+
```bash
|
|
248
|
+
# <run-id> is the run identified in step 2 — never "the latest run on the branch",
|
|
249
|
+
# which can be a run queued before the merge and already completed.
|
|
250
|
+
until az pipelines runs show --org <org-url> --project <project> \
|
|
251
|
+
--id <run-id> --query status -o tsv | grep -qx completed; do
|
|
252
|
+
sleep 60
|
|
253
|
+
done
|
|
254
|
+
az pipelines runs show --org <org-url> --project <project> \
|
|
255
|
+
--id <run-id> --query "[buildNumber,status,result]" -o tsv
|
|
169
256
|
```
|
|
170
257
|
|
|
171
|
-
|
|
258
|
+
Run it with `Monitor` (or Bash `run_in_background`) so the session stays usable. Watch the **run id**, and print `result` when it exits — a guard that only greps for success is silent through a failed or canceled deploy, which looks identical to one still running. One watch per pipeline when the branch has more than one.
|
|
259
|
+
|
|
260
|
+
Without the CLI, re-poll through the Azure DevOps MCP on roughly a 60-second cadence and report progress as you go. If the deploy outlasts the session's attention, say where it stands and that `check` will re-poll immediately — never claim a pipeline succeeded that you have not seen succeed.
|
|
261
|
+
|
|
262
|
+
## Step 10: Assign and Advance States (automatic, on a green pipeline)
|
|
172
263
|
|
|
173
|
-
|
|
264
|
+
This step runs **by itself** the moment the pipeline reports success — do not ask again; the approval in Step 8d covers it. All three preconditions must hold: the PR is `completed`, **every** CD run for {environment} is `succeeded`, and a Step 8d mapping was approved.
|
|
174
265
|
|
|
175
|
-
|
|
266
|
+
- `partiallySucceeded` → not green. Report which stage failed and ask `proceed` / `hold`.
|
|
267
|
+
- `failed` / `canceled` → change nothing. Report the run, the failing stage, and the log link (`pipelines_build_log`), and offer `/rollback` if the environment is broken.
|
|
268
|
+
- No Step 8d approval yet (user hasn't answered) → do the state changes only when they answer; don't guess an assignee.
|
|
176
269
|
|
|
177
|
-
|
|
178
|
-
|
|
270
|
+
For every carried work item of type **User Story**, **Bug**, or **Hot Fix**, one `wit_work_item_write` update per item (or the batch variant) setting both fields:
|
|
271
|
+
|
|
272
|
+
1. `System.State` → the target environment's state (`Ready for Testing` / `Testing` / `Staging` / `Deployed`).
|
|
179
273
|
- **Never move backward.** An item already past the target state (e.g. `Deployed` when deploying to `staging`) keeps its state; note it.
|
|
180
|
-
- **Never touch a Feature or Task.** Features advance as their stories do; Tasks were closed at PR creation.
|
|
181
274
|
- Items skipped in Step 6 (conflict) or dropped in Step 3 are not on the branch — leave them alone.
|
|
182
275
|
- An invalid-state error means this project's template differs — confirm with `get_type`, report the item, continue with the rest. Don't silently swallow it.
|
|
183
|
-
|
|
276
|
+
2. `System.AssignedTo` → the person approved for that item's prefix group. Pass the identity's `uniqueName` / email, not the display name; if the update rejects it, resolve with `core_get_identity_ids` and retry once. A `Leave the current assignee alone` group keeps its assignee — never clear a field the user didn't ask you to clear.
|
|
277
|
+
|
|
278
|
+
**Never touch a Feature or Task** — neither state nor assignee. Features advance as their stories do; Tasks were closed at PR creation.
|
|
279
|
+
|
|
280
|
+
Report both fields, so a wrong assignment is easy to put back:
|
|
184
281
|
|
|
185
282
|
```
|
|
186
|
-
Release #{N} is on {environment}.
|
|
283
|
+
Release #{N} is on {environment} (pipeline {build-number}, succeeded).
|
|
187
284
|
|
|
188
|
-
| ID |
|
|
189
|
-
|
|
190
|
-
| AB#1234 | Ready for Staging
|
|
191
|
-
| AB#
|
|
192
|
-
| AB#1240 |
|
|
285
|
+
| ID | State: was → now | Assignee: was → now |
|
|
286
|
+
|----|------------------|---------------------|
|
|
287
|
+
| AB#1234 | Ready for Staging → Staging | Chris Waters → Jane Doe |
|
|
288
|
+
| AB#1236 | Ready for Staging → Staging | Chris Waters → Jane Doe |
|
|
289
|
+
| AB#1240 | Ready for Staging → Staging | Chris Waters → Pat Ruiz |
|
|
290
|
+
| AB#1250 | Deployed (unchanged — already ahead) | unchanged |
|
|
193
291
|
|
|
194
292
|
Next: {the human step — "QA tests on Test and sets Ready for Staging" / "stakeholders verify on Staging and set Ready to Deploy" / "verify in production, then Close"}.
|
|
195
293
|
```
|
|
196
294
|
|
|
197
|
-
If the user
|
|
295
|
+
If the user said `stop watching`, or an update fails, leave the rest alone, say exactly which items were and were not updated, and note that `/status release {N}` will flag the lag later.
|
|
198
296
|
|
|
199
|
-
## Step
|
|
297
|
+
## Step 11: Notify Team (if Teams MCP is configured)
|
|
200
298
|
|
|
201
|
-
Send a notification to the project's Teams channel via the Microsoft Teams MCP server:
|
|
299
|
+
Send a notification to the project's Teams channel via the Microsoft Teams MCP server — once when the PR is created:
|
|
202
300
|
|
|
203
301
|
```
|
|
204
302
|
🚀 Release #{N} PR created for {environment}
|
|
205
303
|
PR: {pr-url}
|
|
206
|
-
Work items: AB#1234, AB#
|
|
304
|
+
Work items: AB#1234, AB#1236, AB#1240
|
|
207
305
|
Awaiting review and merge.
|
|
208
306
|
```
|
|
209
307
|
|
|
308
|
+
…and once when Step 10 completes, so the verifiers know it's their turn:
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
✅ Release #{N} deployed to {environment}
|
|
312
|
+
COM (AB#1234, AB#1236) → Jane Doe
|
|
313
|
+
PAY (AB#1240) → Pat Ruiz
|
|
314
|
+
Items are now `{state}` — please verify.
|
|
315
|
+
```
|
|
316
|
+
|
|
210
317
|
If the Teams MCP server is not configured, skip this step silently.
|
|
@@ -92,7 +92,76 @@ Create a PR directly from the source branch to the target branch via Azure DevOp
|
|
|
92
92
|
|
|
93
93
|
Link the associated work items to the PR.
|
|
94
94
|
|
|
95
|
-
## Step 5:
|
|
95
|
+
## Step 5: Pick Who Verifies Each Group (before the merge)
|
|
96
|
+
|
|
97
|
+
The items are about to land in {target environment} for **someone** to verify. Decide who now, while the PR is still in review — nothing is written yet; the assignment is applied in Step 7 together with the state change, once the pipeline is green.
|
|
98
|
+
|
|
99
|
+
### 5a. Group by title prefix
|
|
100
|
+
|
|
101
|
+
Work item titles in the CSI Development project are `PREFIX - Title` (`COM`, `PAY`, `CDA`, `AUD`, `SER`, `PSSF`, `TPS`, `ILP`, `RBWO`, `MTG`, `CSI`). Group the carried **User Stories, Bugs, and Hot Fixes** by that prefix. Titles with a missing or unrecognized prefix go in a `(no prefix)` group. Features and Tasks are never assigned by this command — leave them out of the grouping.
|
|
102
|
+
|
|
103
|
+
One question per group. Different products usually have different verifiers, but the same person may take several groups — that is the normal case, not an error.
|
|
104
|
+
|
|
105
|
+
### 5b. Build each group's candidate list from the items themselves
|
|
106
|
+
|
|
107
|
+
For every item in the group, collect the distinct identities already on it:
|
|
108
|
+
|
|
109
|
+
- **whoever set the gate state** — `wit_work_item` `action: list_revisions`, then the `System.ChangedBy` on the revision where `System.State` became the target's gate state (`Ready for Staging`, `Ready to Deploy`, …). That is the QA person or stakeholder who signed the item off, and it is usually the right verifier.
|
|
110
|
+
- `System.CreatedBy` — who asked for the work
|
|
111
|
+
- comment authors — `wit_work_item` `action: list_comments`
|
|
112
|
+
- `System.ChangedBy` — the most recent editor
|
|
113
|
+
|
|
114
|
+
Then **drop the developers**, so what remains is the non-developer names on the item:
|
|
115
|
+
|
|
116
|
+
- each item's current `System.AssignedTo` (the dev who implemented it)
|
|
117
|
+
- the PR author
|
|
118
|
+
- the authors of the promoted commits — `git log origin/<target>..origin/<source> --format='%an <%ae>' | sort -u`
|
|
119
|
+
|
|
120
|
+
Rank the survivors by how many items in the group they appear on — the gate-state signer first, then creators. **Do not invent names**, do not pull from the org directory or a team list, and do not carry a name over from another group's items — every candidate must come from the items in that group.
|
|
121
|
+
|
|
122
|
+
If the developer filter empties a group's list, say so and show the unfiltered names marked `(also a developer here)`, plus the option to type a name.
|
|
123
|
+
|
|
124
|
+
### 5c. Ask
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
## Who verifies on {environment}?
|
|
128
|
+
|
|
129
|
+
**COM** — 2 items (AB#1234, AB#1236)
|
|
130
|
+
1. Jane Doe (jane@caresolutions.com) — created both
|
|
131
|
+
2. Sam Lee (sam@caresolutions.com) — commented on AB#1234
|
|
132
|
+
3. Someone else — give me a name or email
|
|
133
|
+
4. Leave the current assignee alone
|
|
134
|
+
|
|
135
|
+
**PAY** — 2 items (AB#1240, AB#1241)
|
|
136
|
+
1. Jane Doe (jane@caresolutions.com) — created AB#1240
|
|
137
|
+
2. Pat Ruiz (pat@caresolutions.com) — commented on both
|
|
138
|
+
3. Someone else
|
|
139
|
+
4. Leave the current assignee alone
|
|
140
|
+
|
|
141
|
+
Reply per group — `COM 1, PAY 2` — or `all 1` to give every group to the same person.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 5d. Confirm the mapping
|
|
145
|
+
|
|
146
|
+
Echo the resolved plan and wait for an explicit `yes`:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
When the {environment} pipeline goes green I will apply:
|
|
150
|
+
|
|
151
|
+
| ID | Title | Prefix | Assign to | State |
|
|
152
|
+
|----|-------|--------|-----------|-------|
|
|
153
|
+
| AB#1234 | COM - Add payment export | COM | Jane Doe | Staging |
|
|
154
|
+
| AB#1236 | COM - View history | COM | Jane Doe | Staging |
|
|
155
|
+
| AB#1240 | PAY - Fix login redirect | PAY | Pat Ruiz | Staging |
|
|
156
|
+
|
|
157
|
+
Approve? (yes / change)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`change` re-asks 5c. Only after `yes` do you move on — if the PR merges before the user answers, keep waiting for the answer, then run Step 7.
|
|
161
|
+
|
|
162
|
+
## Step 6: Watch the Merge, Then the Pipeline
|
|
163
|
+
|
|
164
|
+
Do NOT merge the PR yourself — a reviewer approves and completes it. Report the PR, then watch for the deployment:
|
|
96
165
|
|
|
97
166
|
```
|
|
98
167
|
Promotion PR created: {source} → {target}
|
|
@@ -100,22 +169,62 @@ Promotion PR created: {source} → {target}
|
|
|
100
169
|
PR: {pr-url}
|
|
101
170
|
|
|
102
171
|
{count} commits, {n} work items included.
|
|
103
|
-
Merging the PR triggers the CD pipeline for {target}.
|
|
172
|
+
Merging the PR triggers the CD pipeline for {target}. I'm watching the PR and
|
|
173
|
+
that pipeline — when it comes back green I'll set the {n} work items to
|
|
174
|
+
`{state after merge}` and assign them as approved above. Nothing is written
|
|
175
|
+
until then. Say `stop watching` to leave the states alone.
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
1. **Wait for the PR to complete.** Poll `repo_pull_request` until `status` is `completed`; note the merge commit and the completion time. `abandoned` → stop, change nothing, report it.
|
|
179
|
+
2. **Find the CD run.** Look up the target branch's pipeline ID(s) in the Pipeline Configuration table, then poll `pipelines_build` for runs on `refs/heads/<target-branch>` queued at or after the merge time — match the merge commit when the run exposes it — and **capture each run's id**. A run that was already completed before the merge is not this deployment; ignore it. A branch with more than one pipeline (API + Client) must have **all** of them green.
|
|
180
|
+
3. **Wait for a terminal result** on each run: `succeeded`, `partiallySucceeded`, `failed`, or `canceled`.
|
|
104
181
|
|
|
105
|
-
|
|
182
|
+
**How to wait.** Never block on a foreground `sleep`. If the Azure CLI with the `azure-devops` extension is available, arm a background watch that notifies you on a terminal state:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# <run-id> is the run identified in step 2 — never "the latest run on the branch",
|
|
186
|
+
# which can be a run queued before the merge and already completed.
|
|
187
|
+
until az pipelines runs show --org <org-url> --project <project> \
|
|
188
|
+
--id <run-id> --query status -o tsv | grep -qx completed; do
|
|
189
|
+
sleep 60
|
|
190
|
+
done
|
|
191
|
+
az pipelines runs show --org <org-url> --project <project> \
|
|
192
|
+
--id <run-id> --query "[buildNumber,status,result]" -o tsv
|
|
106
193
|
```
|
|
107
194
|
|
|
108
|
-
|
|
195
|
+
Run it with `Monitor` (or Bash `run_in_background`) so the session stays usable. Watch the **run id**, and print `result` when it exits — a guard that only greps for success is silent through a failed or canceled deploy, which looks identical to one still running. One watch per pipeline when the branch has more than one.
|
|
109
196
|
|
|
110
|
-
|
|
197
|
+
Without the CLI, re-poll through the Azure DevOps MCP on roughly a 60-second cadence and report progress as you go. If the deploy outlasts the session's attention, say where it stands and that `check` will re-poll immediately — never claim a pipeline succeeded that you have not seen succeed.
|
|
111
198
|
|
|
112
|
-
|
|
199
|
+
## Step 7: Assign and Advance States (automatic, on a green pipeline)
|
|
113
200
|
|
|
114
|
-
|
|
115
|
-
|
|
201
|
+
This step runs **by itself** the moment the pipeline reports success — do not ask again; the approval in Step 5d covers it. All three preconditions must hold: the PR is `completed`, **every** CD run for {target} is `succeeded`, and a Step 5d mapping was approved.
|
|
202
|
+
|
|
203
|
+
- `partiallySucceeded` → not green. Report which stage failed and ask `proceed` / `hold`.
|
|
204
|
+
- `failed` / `canceled` → change nothing. Report the run, the failing stage, and the log link (`pipelines_build_log`), and offer `/rollback` if the environment is broken.
|
|
205
|
+
- No Step 5d approval yet (user hasn't answered) → do the state changes only when they answer; don't guess an assignee.
|
|
206
|
+
|
|
207
|
+
For every carried work item of type **User Story**, **Bug**, or **Hot Fix**, one `wit_work_item_write` update per item setting both fields:
|
|
208
|
+
|
|
209
|
+
1. `System.State` → the target's state (`Ready for Testing` / `Testing` / `Staging` / `Deployed`).
|
|
116
210
|
- **Never move backward** — an item already past the target state keeps it; note it.
|
|
117
|
-
- **Never touch a Feature or Task.**
|
|
118
211
|
- An invalid-state error means this project's template differs — confirm with `get_type`, report the item, continue with the rest. Don't silently swallow it.
|
|
119
|
-
|
|
212
|
+
2. `System.AssignedTo` → the person approved for that item's prefix group. Pass the identity's `uniqueName` / email, not the display name; if the update rejects it, resolve with `core_get_identity_ids` and retry once. A `Leave the current assignee alone` group keeps its assignee — never clear a field the user didn't ask you to clear.
|
|
213
|
+
|
|
214
|
+
**Never touch a Feature or Task** — neither state nor assignee.
|
|
215
|
+
|
|
216
|
+
Report both fields, so a wrong assignment is easy to put back:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
{source} → {target} is deployed (pipeline {build-number}, succeeded).
|
|
220
|
+
|
|
221
|
+
| ID | State: was → now | Assignee: was → now |
|
|
222
|
+
|----|------------------|---------------------|
|
|
223
|
+
| AB#1234 | Ready for Staging → Staging | Chris Waters → Jane Doe |
|
|
224
|
+
| AB#1240 | Ready for Staging → Staging | Chris Waters → Pat Ruiz |
|
|
225
|
+
| AB#1250 | Deployed (unchanged — already ahead) | unchanged |
|
|
226
|
+
|
|
227
|
+
Next: {the human step — "QA tests on Test and sets Ready for Staging" / "stakeholders verify on Staging and set Ready to Deploy" / "verify in production, then Close"}.
|
|
228
|
+
```
|
|
120
229
|
|
|
121
|
-
If the user
|
|
230
|
+
If the user said `stop watching`, or an update fails, leave the rest alone, say exactly which items were and were not updated, and note that `/status` will flag the lag later.
|