@atlashub/smartstack-cli 1.5.1 → 1.5.3
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/.documentation/css/styles.css +2168 -2168
- package/.documentation/js/app.js +794 -794
- package/config/default-config.json +86 -86
- package/config/settings.json +53 -53
- package/config/settings.local.example.json +16 -16
- package/dist/index.js +0 -0
- package/dist/index.js.map +1 -1
- package/package.json +88 -88
- package/templates/agents/action.md +36 -36
- package/templates/agents/efcore/conflicts.md +84 -84
- package/templates/agents/efcore/db-deploy.md +51 -51
- package/templates/agents/efcore/db-reset.md +59 -59
- package/templates/agents/efcore/db-seed.md +56 -56
- package/templates/agents/efcore/db-status.md +64 -64
- package/templates/agents/efcore/migration.md +85 -85
- package/templates/agents/efcore/rebase-snapshot.md +62 -62
- package/templates/agents/efcore/scan.md +90 -90
- package/templates/agents/efcore/squash.md +67 -67
- package/templates/agents/explore-codebase.md +65 -65
- package/templates/agents/explore-docs.md +97 -97
- package/templates/agents/fix-grammar.md +49 -49
- package/templates/agents/gitflow/abort.md +45 -45
- package/templates/agents/gitflow/cleanup.md +85 -85
- package/templates/agents/gitflow/commit.md +40 -40
- package/templates/agents/gitflow/exec.md +48 -48
- package/templates/agents/gitflow/finish.md +92 -92
- package/templates/agents/gitflow/init.md +139 -139
- package/templates/agents/gitflow/merge.md +62 -62
- package/templates/agents/gitflow/plan.md +42 -42
- package/templates/agents/gitflow/pr.md +78 -78
- package/templates/agents/gitflow/review.md +49 -49
- package/templates/agents/gitflow/start.md +61 -61
- package/templates/agents/gitflow/status.md +32 -32
- package/templates/agents/snipper.md +36 -36
- package/templates/agents/websearch.md +46 -46
- package/templates/commands/_resources/formatting-guide.md +124 -124
- package/templates/commands/ai-prompt.md +315 -315
- package/templates/commands/apex/1-analyze.md +100 -100
- package/templates/commands/apex/2-plan.md +145 -145
- package/templates/commands/apex/3-execute.md +171 -171
- package/templates/commands/apex/4-examine.md +116 -116
- package/templates/commands/apex/5-tasks.md +209 -209
- package/templates/commands/apex.md +76 -76
- package/templates/commands/application/create.md +362 -362
- package/templates/commands/application/templates-backend.md +463 -463
- package/templates/commands/application/templates-frontend.md +517 -517
- package/templates/commands/application/templates-i18n.md +478 -478
- package/templates/commands/application/templates-seed.md +362 -362
- package/templates/commands/application.md +303 -303
- package/templates/commands/business-analyse/0-orchestrate.md +640 -640
- package/templates/commands/business-analyse/1-init.md +269 -269
- package/templates/commands/business-analyse/2-discover.md +520 -520
- package/templates/commands/business-analyse/3-analyse.md +408 -408
- package/templates/commands/business-analyse/4-specify.md +598 -598
- package/templates/commands/business-analyse/5-validate.md +326 -326
- package/templates/commands/business-analyse/6-handoff.md +746 -746
- package/templates/commands/business-analyse/7-doc-html.md +602 -602
- package/templates/commands/business-analyse/bug.md +325 -325
- package/templates/commands/business-analyse/change-request.md +368 -368
- package/templates/commands/business-analyse/hotfix.md +200 -200
- package/templates/commands/business-analyse.md +640 -640
- package/templates/commands/controller/create.md +216 -216
- package/templates/commands/controller/postman-templates.md +528 -528
- package/templates/commands/controller/templates.md +600 -600
- package/templates/commands/controller.md +337 -337
- package/templates/commands/create/agent.md +138 -138
- package/templates/commands/create/command.md +166 -166
- package/templates/commands/create/hook.md +234 -234
- package/templates/commands/create/plugin.md +329 -329
- package/templates/commands/create/project.md +507 -507
- package/templates/commands/create/skill.md +199 -199
- package/templates/commands/create.md +220 -220
- package/templates/commands/debug.md +95 -95
- package/templates/commands/documentation/module.md +202 -202
- package/templates/commands/documentation/templates.md +432 -432
- package/templates/commands/documentation.md +190 -190
- package/templates/commands/efcore/_env-check.md +153 -153
- package/templates/commands/efcore/conflicts.md +186 -186
- package/templates/commands/efcore/db-deploy.md +193 -193
- package/templates/commands/efcore/db-reset.md +426 -426
- package/templates/commands/efcore/db-seed.md +326 -326
- package/templates/commands/efcore/db-status.md +226 -226
- package/templates/commands/efcore/migration.md +400 -400
- package/templates/commands/efcore/rebase-snapshot.md +264 -264
- package/templates/commands/efcore/scan.md +198 -198
- package/templates/commands/efcore/squash.md +298 -298
- package/templates/commands/efcore.md +224 -224
- package/templates/commands/epct.md +69 -69
- package/templates/commands/explain.md +186 -186
- package/templates/commands/explore.md +45 -45
- package/templates/commands/feature-full.md +267 -267
- package/templates/commands/gitflow/1-init.md +1038 -1038
- package/templates/commands/gitflow/10-start.md +768 -768
- package/templates/commands/gitflow/11-finish.md +457 -457
- package/templates/commands/gitflow/12-cleanup.md +276 -276
- package/templates/commands/gitflow/13-sync.md +216 -216
- package/templates/commands/gitflow/14-rebase.md +251 -251
- package/templates/commands/gitflow/2-status.md +277 -277
- package/templates/commands/gitflow/3-commit.md +344 -344
- package/templates/commands/gitflow/4-plan.md +145 -145
- package/templates/commands/gitflow/5-exec.md +147 -147
- package/templates/commands/gitflow/6-abort.md +344 -344
- package/templates/commands/gitflow/7-pull-request.md +453 -355
- package/templates/commands/gitflow/8-review.md +240 -176
- package/templates/commands/gitflow/9-merge.md +451 -365
- package/templates/commands/gitflow.md +128 -128
- package/templates/commands/implement.md +663 -663
- package/templates/commands/init.md +567 -567
- package/templates/commands/mcp-integration.md +330 -330
- package/templates/commands/notification.md +129 -129
- package/templates/commands/oneshot.md +57 -57
- package/templates/commands/quick-search.md +72 -72
- package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
- package/templates/commands/ralph-loop/help.md +126 -126
- package/templates/commands/ralph-loop/ralph-loop.md +18 -18
- package/templates/commands/review.md +106 -106
- package/templates/commands/utils/test-web-config.md +160 -160
- package/templates/commands/utils/test-web.md +151 -151
- package/templates/commands/validate.md +233 -233
- package/templates/commands/workflow.md +193 -193
- package/templates/gitflow/config.json +138 -138
- package/templates/hooks/ef-migration-check.md +139 -139
- package/templates/hooks/hooks.json +25 -25
- package/templates/hooks/stop-hook.sh +177 -177
- package/templates/skills/ai-prompt/SKILL.md +778 -778
- package/templates/skills/application/SKILL.md +563 -563
- package/templates/skills/application/templates-backend.md +450 -450
- package/templates/skills/application/templates-frontend.md +531 -531
- package/templates/skills/application/templates-i18n.md +520 -520
- package/templates/skills/application/templates-seed.md +647 -647
- package/templates/skills/business-analyse/SKILL.md +191 -191
- package/templates/skills/business-analyse/questionnaire.md +283 -283
- package/templates/skills/business-analyse/templates-frd.md +477 -477
- package/templates/skills/business-analyse/templates-react.md +580 -580
- package/templates/skills/controller/SKILL.md +240 -240
- package/templates/skills/controller/postman-templates.md +614 -614
- package/templates/skills/controller/templates.md +1468 -1468
- package/templates/skills/documentation/SKILL.md +133 -133
- package/templates/skills/documentation/templates.md +476 -476
- package/templates/skills/feature-full/SKILL.md +838 -838
- package/templates/skills/notification/SKILL.md +555 -555
- package/templates/skills/ui-components/SKILL.md +870 -870
- package/templates/skills/workflow/SKILL.md +582 -582
- package/templates/test-web/api-health.json +38 -38
- package/templates/test-web/minimal.json +19 -19
- package/templates/test-web/npm-package.json +46 -46
- package/templates/test-web/seo-check.json +54 -54
|
@@ -1,365 +1,451 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Phase 9 - Merge Pull Request with all checks validated
|
|
3
|
-
agent: gitflow-merge
|
|
4
|
-
model: sonnet
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Phase 9: MERGE - Merge PR avec validation complete
|
|
8
|
-
|
|
9
|
-
Tu es expert GitFlow. Execute le merge avec tous les checks de securite.
|
|
10
|
-
|
|
11
|
-
**Argument:** `$ARGUMENTS` = numero PR (optionnel, **SCAN AUTOMATIQUE** si absent)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ETAPE 0:
|
|
16
|
-
|
|
17
|
-
> **
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
###
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
|
217
|
-
|
|
218
|
-
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
|
339
|
-
|
|
340
|
-
|
|
|
341
|
-
|
|
|
342
|
-
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
#
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Phase 9 - Merge Pull Request with all checks validated
|
|
3
|
+
agent: gitflow-merge
|
|
4
|
+
model: sonnet
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Phase 9: MERGE - Merge PR avec validation complete
|
|
8
|
+
|
|
9
|
+
Tu es expert GitFlow. Execute le merge avec tous les checks de securite.
|
|
10
|
+
|
|
11
|
+
**Argument:** `$ARGUMENTS` = numero PR (optionnel, **SCAN AUTOMATIQUE** si absent)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ETAPE 0: DETECTION DU PROVIDER GIT
|
|
16
|
+
|
|
17
|
+
> **CRITIQUE:** Detecter si le remote est GitHub ou Azure DevOps pour utiliser le bon CLI.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "")
|
|
21
|
+
|
|
22
|
+
if [[ "$REMOTE_URL" == *"dev.azure.com"* ]] || [[ "$REMOTE_URL" == *"visualstudio.com"* ]]; then
|
|
23
|
+
GIT_PROVIDER="azuredevops"
|
|
24
|
+
if [[ "$REMOTE_URL" =~ dev\.azure\.com/([^/]+)/([^/]+)/_git/([^/]+) ]]; then
|
|
25
|
+
AZURE_ORG="${BASH_REMATCH[1]}"
|
|
26
|
+
AZURE_PROJECT="${BASH_REMATCH[2]}"
|
|
27
|
+
AZURE_REPO="${BASH_REMATCH[3]}"
|
|
28
|
+
fi
|
|
29
|
+
echo "Provider: Azure DevOps (org: $AZURE_ORG, project: $AZURE_PROJECT)"
|
|
30
|
+
elif [[ "$REMOTE_URL" == *"github.com"* ]]; then
|
|
31
|
+
GIT_PROVIDER="github"
|
|
32
|
+
echo "Provider: GitHub"
|
|
33
|
+
else
|
|
34
|
+
GIT_PROVIDER="unknown"
|
|
35
|
+
fi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## ETAPE 1: SCAN PROACTIF (si pas d'argument)
|
|
41
|
+
|
|
42
|
+
> **COMPORTEMENT PROACTIF:** Si aucun numero de PR fourni, scanner TOUTES les PRs ouvertes pour proposer celles qui sont pretes a merger.
|
|
43
|
+
|
|
44
|
+
### 1.1 Scanner les PRs ouvertes
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Lister toutes les PRs ouvertes avec leur statut
|
|
48
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
49
|
+
# Azure DevOps - format different
|
|
50
|
+
az repos pr list \
|
|
51
|
+
--repository "$AZURE_REPO" \
|
|
52
|
+
--status active \
|
|
53
|
+
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
54
|
+
--project "$AZURE_PROJECT" \
|
|
55
|
+
--query "[].{number:pullRequestId, title:title, branch:sourceRefName, status:status, mergeStatus:mergeStatus}" \
|
|
56
|
+
-o json
|
|
57
|
+
else
|
|
58
|
+
# GitHub
|
|
59
|
+
gh pr list --state open --json number,title,headRefName,mergeable,reviewDecision,statusCheckRollup \
|
|
60
|
+
--jq '.[] | {
|
|
61
|
+
number: .number,
|
|
62
|
+
title: .title,
|
|
63
|
+
branch: .headRefName,
|
|
64
|
+
mergeable: .mergeable,
|
|
65
|
+
review: .reviewDecision,
|
|
66
|
+
checks: (.statusCheckRollup | if . then (map(select(.conclusion == "SUCCESS")) | length) else 0 end)
|
|
67
|
+
}'
|
|
68
|
+
fi
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 0.2 Categoriser les PRs
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
for PR in $ALL_PRS; do
|
|
75
|
+
# Extraire les infos
|
|
76
|
+
NUMBER=$(echo "$PR" | jq -r '.number')
|
|
77
|
+
MERGEABLE=$(echo "$PR" | jq -r '.mergeable')
|
|
78
|
+
REVIEW=$(echo "$PR" | jq -r '.review')
|
|
79
|
+
CHECKS_OK=$(echo "$PR" | jq -r '.checks')
|
|
80
|
+
|
|
81
|
+
# Categoriser
|
|
82
|
+
if [[ "$MERGEABLE" == "MERGEABLE" && "$REVIEW" == "APPROVED" ]]; then
|
|
83
|
+
READY_TO_MERGE+=("$PR")
|
|
84
|
+
elif [[ "$REVIEW" == "CHANGES_REQUESTED" ]]; then
|
|
85
|
+
NEEDS_CHANGES+=("$PR")
|
|
86
|
+
elif [[ "$REVIEW" != "APPROVED" ]]; then
|
|
87
|
+
NEEDS_REVIEW+=("$PR")
|
|
88
|
+
elif [[ "$MERGEABLE" != "MERGEABLE" ]]; then
|
|
89
|
+
HAS_CONFLICTS+=("$PR")
|
|
90
|
+
else
|
|
91
|
+
WAITING_CI+=("$PR")
|
|
92
|
+
fi
|
|
93
|
+
done
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 0.3 Afficher le tableau des PRs
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
================================================================================
|
|
100
|
+
GITFLOW MERGE - SCAN DES PULL REQUESTS
|
|
101
|
+
================================================================================
|
|
102
|
+
|
|
103
|
+
✅ PRETES A MERGER (approuvees + CI vert):
|
|
104
|
+
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
105
|
+
│ PR # │ Titre │ Branche │ Reviews │
|
|
106
|
+
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
107
|
+
│ #42 │ feat: add user auth │ feature/user-auth │ 2 approvals │
|
|
108
|
+
│ #45 │ release: v1.5.0 │ release/v1.5.0 │ 1 approval │
|
|
109
|
+
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
110
|
+
|
|
111
|
+
⏳ EN ATTENTE DE REVIEW:
|
|
112
|
+
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
113
|
+
│ PR # │ Titre │ Branche │ Statut │
|
|
114
|
+
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
115
|
+
│ #43 │ feat: add orders │ feature/add-orders │ Awaiting review │
|
|
116
|
+
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
117
|
+
|
|
118
|
+
⚠️ CHANGEMENTS DEMANDES:
|
|
119
|
+
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
120
|
+
│ PR # │ Titre │ Branche │ Reviewer │
|
|
121
|
+
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
122
|
+
│ #44 │ fix: login bug │ hotfix/login │ @john requested │
|
|
123
|
+
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
124
|
+
|
|
125
|
+
❌ CONFLITS A RESOUDRE:
|
|
126
|
+
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
127
|
+
│ PR # │ Titre │ Branche │ Action │
|
|
128
|
+
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
129
|
+
│ #46 │ feat: refactor api │ feature/refactor │ Rebase requis │
|
|
130
|
+
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
131
|
+
|
|
132
|
+
================================================================================
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 0.4 Proposition interactive
|
|
136
|
+
|
|
137
|
+
```javascript
|
|
138
|
+
if (READY_TO_MERGE.length > 0) {
|
|
139
|
+
// Trier par priorite: hotfixes > releases > features
|
|
140
|
+
const sorted = READY_TO_MERGE.sort((a, b) => {
|
|
141
|
+
const priority = { 'hotfix': 0, 'release': 1, 'feature': 2 }
|
|
142
|
+
return priority[getType(a.branch)] - priority[getType(b.branch)]
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
AskUserQuestion({
|
|
146
|
+
questions: [{
|
|
147
|
+
question: "Quelle PR voulez-vous merger ?",
|
|
148
|
+
header: "Merge",
|
|
149
|
+
options: sorted.map(pr => ({
|
|
150
|
+
label: `#${pr.number}`,
|
|
151
|
+
description: `${pr.title} (${pr.branch})`
|
|
152
|
+
})).concat([{
|
|
153
|
+
label: "Toutes",
|
|
154
|
+
description: "Merger toutes les PRs pretes (dans l'ordre recommande)"
|
|
155
|
+
}]),
|
|
156
|
+
multiSelect: false
|
|
157
|
+
}]
|
|
158
|
+
})
|
|
159
|
+
} else if (NEEDS_REVIEW.length > 0 || NEEDS_CHANGES.length > 0) {
|
|
160
|
+
console.log("❌ Aucune PR prete a merger.")
|
|
161
|
+
console.log("")
|
|
162
|
+
if (NEEDS_REVIEW.length > 0) {
|
|
163
|
+
console.log("→ PRs en attente de review: " + NEEDS_REVIEW.map(p => '#'+p.number).join(', '))
|
|
164
|
+
console.log(" Demandez une review ou utilisez: /gitflow:8-review <numero>")
|
|
165
|
+
}
|
|
166
|
+
if (NEEDS_CHANGES.length > 0) {
|
|
167
|
+
console.log("→ PRs avec changements demandes: " + NEEDS_CHANGES.map(p => '#'+p.number).join(', '))
|
|
168
|
+
console.log(" Adressez le feedback puis re-demandez une review")
|
|
169
|
+
}
|
|
170
|
+
if (HAS_CONFLICTS.length > 0) {
|
|
171
|
+
console.log("→ PRs avec conflits: " + HAS_CONFLICTS.map(p => '#'+p.number).join(', '))
|
|
172
|
+
console.log(" Resolvez les conflits avec: git rebase origin/<target>")
|
|
173
|
+
}
|
|
174
|
+
exit(1)
|
|
175
|
+
} else {
|
|
176
|
+
console.log("✅ Aucune PR ouverte!")
|
|
177
|
+
console.log("→ Creez une PR avec: /gitflow:7-pull-request")
|
|
178
|
+
exit(0)
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 0.5 Ordre recommande pour "Toutes"
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
ORDRE DE MERGE RECOMMANDE:
|
|
186
|
+
1. Hotfixes (urgents, patches production)
|
|
187
|
+
2. Releases (vers main, puis merge back)
|
|
188
|
+
3. Features (par date de creation, plus anciennes d'abord)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Pre-merge checks
|
|
194
|
+
|
|
195
|
+
### 1. Status PR
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
199
|
+
az repos pr show --id {number} \
|
|
200
|
+
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
201
|
+
--project "$AZURE_PROJECT" \
|
|
202
|
+
--query "{status:status, mergeStatus:mergeStatus, reviewers:reviewers}"
|
|
203
|
+
else
|
|
204
|
+
gh pr view {number} --json state,mergeable,mergeStateStatus,reviews,checks
|
|
205
|
+
fi
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
| Check | Requis | Action si echec |
|
|
209
|
+
|-------|--------|-----------------|
|
|
210
|
+
| State = OPEN/active | OUI | "PR deja mergee ou fermee" |
|
|
211
|
+
| Mergeable = true | OUI | "Resoudre conflits d'abord" |
|
|
212
|
+
| MergeStateStatus = CLEAN | OUI | Attendre CI ou resoudre |
|
|
213
|
+
|
|
214
|
+
### 2. Reviews
|
|
215
|
+
|
|
216
|
+
| Check | Condition | Action |
|
|
217
|
+
|-------|-----------|--------|
|
|
218
|
+
| Min approvals | Config: `minReviewers` | Attendre reviews |
|
|
219
|
+
| No changes requested | Aucun "Request changes" actif | Resoudre feedback |
|
|
220
|
+
| Required reviewers | Si configure | Verifier presence |
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Verifier reviews
|
|
224
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
225
|
+
az repos pr show --id {number} \
|
|
226
|
+
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
227
|
+
--project "$AZURE_PROJECT" \
|
|
228
|
+
--query "reviewers[?vote>0]"
|
|
229
|
+
else
|
|
230
|
+
gh pr view {number} --json reviews --jq '.reviews[] | select(.state=="APPROVED")'
|
|
231
|
+
fi
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 3. CI/CD Checks
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
238
|
+
# Azure DevOps - checks via policy status
|
|
239
|
+
az repos pr policy list --id {number} \
|
|
240
|
+
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
241
|
+
--project "$AZURE_PROJECT"
|
|
242
|
+
else
|
|
243
|
+
gh pr checks {number}
|
|
244
|
+
fi
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| Status | Action |
|
|
248
|
+
|--------|--------|
|
|
249
|
+
| Tous ✓ | Continuer |
|
|
250
|
+
| En cours | Attendre |
|
|
251
|
+
| Echec | BLOQUER - afficher details |
|
|
252
|
+
|
|
253
|
+
### 4. Branch Protection
|
|
254
|
+
|
|
255
|
+
| Rule | Verification |
|
|
256
|
+
|------|--------------|
|
|
257
|
+
| Up-to-date | `git rev-list --count HEAD..origin/{base}` = 0 |
|
|
258
|
+
| Linear history | Si requis, rebase avant merge |
|
|
259
|
+
| Signed commits | Si requis, verifier signatures |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## EF Core Pre-merge (si applicable)
|
|
264
|
+
|
|
265
|
+
### Validation migrations
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
# Lister migrations dans la PR
|
|
269
|
+
git diff origin/{base}...HEAD --name-only | grep -E "Migrations/.*\.cs$"
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
| Check | Validation | Bloquant |
|
|
273
|
+
|-------|------------|----------|
|
|
274
|
+
| Sync ModelSnapshot | Pas de conflit avec develop | OUI |
|
|
275
|
+
| Build migrations | `dotnet ef migrations script` OK | OUI |
|
|
276
|
+
| Pas de data loss | Scan DropTable/DropColumn | WARNING |
|
|
277
|
+
|
|
278
|
+
### Si conflit ModelSnapshot detecte
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
⚠️ CONFLIT MODELSNAPSHOT DETECTE
|
|
282
|
+
────────────────────────────────
|
|
283
|
+
Le ModelSnapshot a diverge de develop.
|
|
284
|
+
|
|
285
|
+
Options:
|
|
286
|
+
1. Rebase + recreer migration (recommande)
|
|
287
|
+
2. Merge manuel (risque)
|
|
288
|
+
|
|
289
|
+
Commande recommandee:
|
|
290
|
+
git rebase origin/develop
|
|
291
|
+
dotnet ef migrations remove
|
|
292
|
+
dotnet ef migrations add {MigrationName}
|
|
293
|
+
────────────────────────────────
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Execution Merge
|
|
299
|
+
|
|
300
|
+
### Strategie selon type
|
|
301
|
+
|
|
302
|
+
| Type branche | Merge strategy | GitHub | Azure DevOps |
|
|
303
|
+
|--------------|----------------|--------|--------------|
|
|
304
|
+
| `feature/*` | Squash | `--squash` | `--squash true` |
|
|
305
|
+
| `hotfix/*` | Merge commit | `--merge` | `--squash false` |
|
|
306
|
+
| `release/*` | Merge commit | `--merge` | `--squash false` |
|
|
307
|
+
|
|
308
|
+
### Commande GitHub
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
if [ "$GIT_PROVIDER" = "github" ]; then
|
|
312
|
+
# Squash (feature)
|
|
313
|
+
gh pr merge {number} --squash --delete-branch
|
|
314
|
+
|
|
315
|
+
# Merge commit (hotfix/release)
|
|
316
|
+
gh pr merge {number} --merge --delete-branch
|
|
317
|
+
fi
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Commande Azure DevOps
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
324
|
+
# Complete la PR (merge)
|
|
325
|
+
az repos pr update --id {number} \
|
|
326
|
+
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
327
|
+
--project "$AZURE_PROJECT" \
|
|
328
|
+
--status completed \
|
|
329
|
+
--squash {true|false} \
|
|
330
|
+
--delete-source-branch true
|
|
331
|
+
|
|
332
|
+
# Note: Si merge policies bloquent, utiliser --bypass-policy (admin requis)
|
|
333
|
+
fi
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Options supplementaires
|
|
337
|
+
|
|
338
|
+
| Option | GitHub | Azure DevOps |
|
|
339
|
+
|--------|--------|--------------|
|
|
340
|
+
| Auto-merge quand CI vert | `--auto` | `--auto-complete true` |
|
|
341
|
+
| Supprimer branche source | `--delete-branch` | `--delete-source-branch true` |
|
|
342
|
+
| Override protections | `--admin` | `--bypass-policy` (danger) |
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Post-merge actions
|
|
347
|
+
|
|
348
|
+
### 1. Versioning (si release/hotfix)
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
# Lire version actuelle
|
|
352
|
+
VERSION=$(cat package.json | jq -r '.version')
|
|
353
|
+
|
|
354
|
+
# Creer tag
|
|
355
|
+
git tag -a "v$VERSION" -m "Release v$VERSION"
|
|
356
|
+
git push origin "v$VERSION"
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### 2. Changelog (optionnel)
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# Ajouter entree CHANGELOG
|
|
363
|
+
echo "## v$VERSION - $(date +%Y-%m-%d)" >> CHANGELOG.md
|
|
364
|
+
gh pr view {number} --json title,body >> CHANGELOG.md
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### 3. Notifications (si configure)
|
|
368
|
+
|
|
369
|
+
| Canal | Message |
|
|
370
|
+
|-------|---------|
|
|
371
|
+
| Slack | "PR #{number} merged to {base}" |
|
|
372
|
+
| Teams | Idem |
|
|
373
|
+
| Email | Idem |
|
|
374
|
+
|
|
375
|
+
### 4. Cleanup
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
# Supprimer branche locale
|
|
379
|
+
git branch -d {branch}
|
|
380
|
+
|
|
381
|
+
# Fetch et prune
|
|
382
|
+
git fetch --prune
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## Resume
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
MERGE COMPLETE
|
|
391
|
+
════════════════════════════════════════
|
|
392
|
+
PR: #{number}
|
|
393
|
+
Titre: {title}
|
|
394
|
+
Base: {base}
|
|
395
|
+
Strategy: {squash|merge}
|
|
396
|
+
|
|
397
|
+
Checks passes:
|
|
398
|
+
✓ Reviews: {count} approvals
|
|
399
|
+
✓ CI: All green
|
|
400
|
+
✓ Conflicts: None
|
|
401
|
+
✓ EF Core: {OK|N/A}
|
|
402
|
+
|
|
403
|
+
Post-merge:
|
|
404
|
+
✓ Branch deleted: {branch}
|
|
405
|
+
✓ Tag created: {tag|N/A}
|
|
406
|
+
|
|
407
|
+
════════════════════════════════════════
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Erreurs et recovery
|
|
413
|
+
|
|
414
|
+
| Erreur | Cause | Solution |
|
|
415
|
+
|--------|-------|----------|
|
|
416
|
+
| "Not mergeable" | Conflits | `git rebase origin/{base}` |
|
|
417
|
+
| "Checks failing" | CI rouge | Corriger et re-push |
|
|
418
|
+
| "Review required" | Pas d'approval | Demander review |
|
|
419
|
+
| "Branch protected" | Rules non respectees | Verifier requirements |
|
|
420
|
+
| "az: command not found" | Azure CLI manquant | `winget install Microsoft.AzureCLI` |
|
|
421
|
+
| "gh: command not found" | GitHub CLI manquant | https://cli.github.com |
|
|
422
|
+
| "Please run 'az login'" | Non authentifie | `az login` |
|
|
423
|
+
|
|
424
|
+
## Providers supportes
|
|
425
|
+
|
|
426
|
+
| Provider | CLI | Merge command |
|
|
427
|
+
|----------|-----|---------------|
|
|
428
|
+
| **GitHub** | `gh pr merge` | Squash/Merge/Rebase |
|
|
429
|
+
| **Azure DevOps** | `az repos pr update --status completed` | Squash ou Merge |
|
|
430
|
+
|
|
431
|
+
### Rollback si probleme post-merge
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
# Identifier commit merge
|
|
435
|
+
MERGE_COMMIT=$(git log --merges -1 --format="%H")
|
|
436
|
+
|
|
437
|
+
# Revert
|
|
438
|
+
git revert -m 1 $MERGE_COMMIT
|
|
439
|
+
git push origin {base}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Modes
|
|
445
|
+
|
|
446
|
+
| Commande | Action |
|
|
447
|
+
|----------|--------|
|
|
448
|
+
| `/gitflow:9-merge 123` | Merge PR #123 |
|
|
449
|
+
| `/gitflow:9-merge 123 --auto` | Merge auto quand CI vert |
|
|
450
|
+
| `/gitflow:9-merge 123 --dry-run` | Simulation |
|
|
451
|
+
| `/gitflow:9-merge 123 --admin` | Override protections (danger) |
|