@atlashub/smartstack-cli 1.11.0 → 1.13.1
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/agents.html +7 -2
- package/.documentation/apex.html +7 -2
- package/.documentation/business-analyse.html +7 -2
- package/.documentation/cli-commands.html +871 -0
- package/.documentation/commands.html +7 -2
- package/.documentation/efcore.html +7 -2
- package/.documentation/gitflow.html +7 -2
- package/.documentation/hooks.html +7 -2
- package/.documentation/index.html +7 -2
- package/.documentation/init.html +7 -2
- package/.documentation/installation.html +7 -2
- package/.documentation/ralph-loop.html +7 -2
- package/.documentation/test-web.html +7 -2
- package/dist/index.js +1932 -336
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
- package/templates/agents/efcore/squash.md +67 -31
- package/templates/agents/gitflow/finish.md +68 -56
- package/templates/commands/business-analyse/0-orchestrate.md +72 -556
- package/templates/commands/business-analyse/1-init.md +23 -193
- package/templates/commands/business-analyse/2-discover.md +85 -462
- package/templates/commands/business-analyse/3-analyse.md +40 -342
- package/templates/commands/business-analyse/4-specify.md +72 -537
- package/templates/commands/business-analyse/5-validate.md +43 -237
- package/templates/commands/business-analyse/6-handoff.md +93 -682
- package/templates/commands/business-analyse/7-doc-html.md +45 -544
- package/templates/commands/business-analyse/_shared.md +176 -0
- package/templates/commands/business-analyse/bug.md +50 -257
- package/templates/commands/business-analyse/change-request.md +59 -283
- package/templates/commands/business-analyse/hotfix.md +36 -120
- package/templates/commands/business-analyse.md +55 -574
- package/templates/commands/efcore/_shared.md +206 -0
- package/templates/commands/efcore/conflicts.md +39 -201
- package/templates/commands/efcore/db-deploy.md +28 -237
- package/templates/commands/efcore/db-reset.md +41 -390
- package/templates/commands/efcore/db-seed.md +44 -323
- package/templates/commands/efcore/db-status.md +31 -210
- package/templates/commands/efcore/migration.md +45 -368
- package/templates/commands/efcore/rebase-snapshot.md +38 -241
- package/templates/commands/efcore/scan.md +35 -204
- package/templates/commands/efcore/squash.md +158 -251
- package/templates/commands/efcore.md +49 -177
- package/templates/commands/gitflow/1-init.md +94 -1318
- package/templates/commands/gitflow/10-start.md +86 -990
- package/templates/commands/gitflow/11-finish.md +264 -454
- package/templates/commands/gitflow/12-cleanup.md +40 -213
- package/templates/commands/gitflow/2-status.md +51 -386
- package/templates/commands/gitflow/3-commit.md +108 -801
- package/templates/commands/gitflow/4-plan.md +42 -13
- package/templates/commands/gitflow/5-exec.md +60 -5
- package/templates/commands/gitflow/6-abort.md +54 -277
- package/templates/commands/gitflow/7-pull-request.md +74 -717
- package/templates/commands/gitflow/8-review.md +51 -178
- package/templates/commands/gitflow/9-merge.md +74 -404
- package/templates/commands/gitflow/_shared.md +196 -0
- package/templates/commands/quickstart.md +154 -0
- package/templates/commands/ralph-loop/ralph-loop.md +104 -2
- package/templates/hooks/hooks.json +13 -0
- package/templates/hooks/ralph-mcp-logger.sh +46 -0
- package/templates/hooks/ralph-session-end.sh +69 -0
- package/templates/ralph/README.md +91 -0
- package/templates/ralph/ralph.config.yaml +113 -0
- package/templates/scripts/setup-ralph-loop.sh +173 -0
- package/templates/skills/_shared.md +117 -0
- package/templates/skills/ai-prompt/SKILL.md +87 -654
- package/templates/skills/application/SKILL.md +76 -499
- package/templates/skills/controller/SKILL.md +38 -165
- package/templates/skills/documentation/SKILL.md +2 -1
- package/templates/skills/feature-full/SKILL.md +107 -732
- package/templates/skills/notification/SKILL.md +85 -474
- package/templates/skills/ui-components/SKILL.md +62 -762
- package/templates/skills/workflow/SKILL.md +85 -489
- package/templates/commands/gitflow/rescue.md +0 -867
- package/templates/skills/business-analyse/SKILL.md +0 -191
|
@@ -4,473 +4,144 @@ agent: gitflow-merge
|
|
|
4
4
|
model: sonnet
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Phase 9: MERGE - Merge PR avec validation
|
|
7
|
+
# Phase 9: MERGE - Merge PR avec validation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Argument:** `$ARGUMENTS` = numéro PR (optionnel, SCAN si absent)
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
> **Ref:** Fonction `detect_git_provider()` dans [_shared.md](_shared.md)
|
|
12
|
+
> **Ref:** Fonction `determine_base_branch()` dans [efcore/_shared.md](../efcore/_shared.md)
|
|
12
13
|
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
##
|
|
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 0.5: SYNCHRONISATION AVEC REMOTE
|
|
41
|
-
|
|
42
|
-
> **CRITIQUE:** Toujours synchroniser avec le remote avant toute opération de merge.
|
|
16
|
+
## Étape 0: Synchronisation et Branche Parente
|
|
43
17
|
|
|
44
18
|
```bash
|
|
45
|
-
echo "Synchronisation avec remote..."
|
|
46
19
|
git fetch --all --quiet
|
|
47
20
|
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# Afficher état AHEAD/BEHIND pour information
|
|
53
|
-
if [[ "$CURRENT" != "main" && "$CURRENT" != "develop" ]]; then
|
|
54
|
-
AHEAD=$(git rev-list --count origin/$CURRENT..HEAD 2>/dev/null || echo "0")
|
|
55
|
-
BEHIND=$(git rev-list --count HEAD..origin/$CURRENT 2>/dev/null || echo "0")
|
|
56
|
-
|
|
57
|
-
if [ "$BEHIND" -gt 0 ]; then
|
|
58
|
-
echo "⚠️ Attention: Votre branche locale est en retard de $BEHIND commit(s)"
|
|
59
|
-
echo "→ Recommandation: git pull origin $CURRENT"
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
if [ "$AHEAD" -gt 0 ]; then
|
|
63
|
-
echo "ℹ️ Votre branche locale a $AHEAD commit(s) non poussé(s)"
|
|
64
|
-
fi
|
|
65
|
-
fi
|
|
21
|
+
# Determiner branche parente selon type
|
|
22
|
+
determine_base_branch
|
|
23
|
+
# → BASE_BRANCH = develop (feature) ou main (release/hotfix)
|
|
66
24
|
```
|
|
67
25
|
|
|
68
|
-
| État | Signification | Action recommandée |
|
|
69
|
-
|------|---------------|-------------------|
|
|
70
|
-
| BEHIND > 0 | Commits remote non récupérés | `git pull origin {branch}` |
|
|
71
|
-
| AHEAD > 0 | Commits locaux non poussés | `git push origin {branch}` |
|
|
72
|
-
| BEHIND = AHEAD = 0 | Parfaitement synchronisé | ✅ Prêt |
|
|
73
|
-
|
|
74
26
|
---
|
|
75
27
|
|
|
76
|
-
##
|
|
77
|
-
|
|
78
|
-
> **COMPORTEMENT PROACTIF:** Si aucun numero de PR fourni, scanner TOUTES les PRs ouvertes pour proposer celles qui sont pretes a merger.
|
|
79
|
-
|
|
80
|
-
### 1.1 Scanner les PRs ouvertes
|
|
28
|
+
## Étape 1: Scan Proactif (si pas d'argument)
|
|
81
29
|
|
|
82
30
|
```bash
|
|
83
|
-
# Lister
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
az repos pr list \
|
|
87
|
-
--repository "$AZURE_REPO" \
|
|
88
|
-
--status active \
|
|
89
|
-
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
90
|
-
--project "$AZURE_PROJECT" \
|
|
91
|
-
--query "[].{number:pullRequestId, title:title, branch:sourceRefName, status:status, mergeStatus:mergeStatus}" \
|
|
92
|
-
-o json
|
|
93
|
-
else
|
|
94
|
-
# GitHub
|
|
95
|
-
gh pr list --state open --json number,title,headRefName,mergeable,reviewDecision,statusCheckRollup \
|
|
96
|
-
--jq '.[] | {
|
|
97
|
-
number: .number,
|
|
98
|
-
title: .title,
|
|
99
|
-
branch: .headRefName,
|
|
100
|
-
mergeable: .mergeable,
|
|
101
|
-
review: .reviewDecision,
|
|
102
|
-
checks: (.statusCheckRollup | if . then (map(select(.conclusion == "SUCCESS")) | length) else 0 end)
|
|
103
|
-
}'
|
|
104
|
-
fi
|
|
105
|
-
```
|
|
31
|
+
# Lister PRs ouvertes et catégoriser
|
|
32
|
+
# GitHub
|
|
33
|
+
gh pr list --state open --json number,title,headRefName,mergeable,reviewDecision
|
|
106
34
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
for PR in $ALL_PRS; do
|
|
111
|
-
# Extraire les infos
|
|
112
|
-
NUMBER=$(echo "$PR" | jq -r '.number')
|
|
113
|
-
MERGEABLE=$(echo "$PR" | jq -r '.mergeable')
|
|
114
|
-
REVIEW=$(echo "$PR" | jq -r '.review')
|
|
115
|
-
CHECKS_OK=$(echo "$PR" | jq -r '.checks')
|
|
116
|
-
|
|
117
|
-
# Categoriser
|
|
118
|
-
if [[ "$MERGEABLE" == "MERGEABLE" && "$REVIEW" == "APPROVED" ]]; then
|
|
119
|
-
READY_TO_MERGE+=("$PR")
|
|
120
|
-
elif [[ "$REVIEW" == "CHANGES_REQUESTED" ]]; then
|
|
121
|
-
NEEDS_CHANGES+=("$PR")
|
|
122
|
-
elif [[ "$REVIEW" != "APPROVED" ]]; then
|
|
123
|
-
NEEDS_REVIEW+=("$PR")
|
|
124
|
-
elif [[ "$MERGEABLE" != "MERGEABLE" ]]; then
|
|
125
|
-
HAS_CONFLICTS+=("$PR")
|
|
126
|
-
else
|
|
127
|
-
WAITING_CI+=("$PR")
|
|
128
|
-
fi
|
|
129
|
-
done
|
|
35
|
+
# Azure DevOps
|
|
36
|
+
az repos pr list --repository "$AZURE_REPO" --status active --query "[].{number:pullRequestId,title:title,branch:sourceRefName,mergeStatus:mergeStatus}"
|
|
130
37
|
```
|
|
131
38
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
================================================================================
|
|
138
|
-
|
|
139
|
-
✅ PRETES A MERGER (approuvees + CI vert):
|
|
140
|
-
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
141
|
-
│ PR # │ Titre │ Branche │ Reviews │
|
|
142
|
-
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
143
|
-
│ #42 │ feat: add user auth │ feature/user-auth │ 2 approvals │
|
|
144
|
-
│ #45 │ release: v1.5.0 │ release/v1.5.0 │ 1 approval │
|
|
145
|
-
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
146
|
-
|
|
147
|
-
⏳ EN ATTENTE DE REVIEW:
|
|
148
|
-
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
149
|
-
│ PR # │ Titre │ Branche │ Statut │
|
|
150
|
-
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
151
|
-
│ #43 │ feat: add orders │ feature/add-orders │ Awaiting review │
|
|
152
|
-
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
153
|
-
|
|
154
|
-
⚠️ CHANGEMENTS DEMANDES:
|
|
155
|
-
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
156
|
-
│ PR # │ Titre │ Branche │ Reviewer │
|
|
157
|
-
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
158
|
-
│ #44 │ fix: login bug │ hotfix/login │ @john requested │
|
|
159
|
-
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
160
|
-
|
|
161
|
-
❌ CONFLITS A RESOUDRE:
|
|
162
|
-
┌────────┬─────────────────────────────┬─────────────────────┬─────────────────┐
|
|
163
|
-
│ PR # │ Titre │ Branche │ Action │
|
|
164
|
-
├────────┼─────────────────────────────┼─────────────────────┼─────────────────┤
|
|
165
|
-
│ #46 │ feat: refactor api │ feature/refactor │ Rebase requis │
|
|
166
|
-
└────────┴─────────────────────────────┴─────────────────────┴─────────────────┘
|
|
167
|
-
|
|
168
|
-
================================================================================
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### 0.4 Proposition interactive
|
|
172
|
-
|
|
173
|
-
```javascript
|
|
174
|
-
if (READY_TO_MERGE.length > 0) {
|
|
175
|
-
// Trier par priorite: hotfixes > releases > features
|
|
176
|
-
const sorted = READY_TO_MERGE.sort((a, b) => {
|
|
177
|
-
const priority = { 'hotfix': 0, 'release': 1, 'feature': 2 }
|
|
178
|
-
return priority[getType(a.branch)] - priority[getType(b.branch)]
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
AskUserQuestion({
|
|
182
|
-
questions: [{
|
|
183
|
-
question: "Quelle PR voulez-vous merger ?",
|
|
184
|
-
header: "Merge",
|
|
185
|
-
options: sorted.map(pr => ({
|
|
186
|
-
label: `#${pr.number}`,
|
|
187
|
-
description: `${pr.title} (${pr.branch})`
|
|
188
|
-
})).concat([{
|
|
189
|
-
label: "Toutes",
|
|
190
|
-
description: "Merger toutes les PRs pretes (dans l'ordre recommande)"
|
|
191
|
-
}]),
|
|
192
|
-
multiSelect: false
|
|
193
|
-
}]
|
|
194
|
-
})
|
|
195
|
-
} else if (NEEDS_REVIEW.length > 0 || NEEDS_CHANGES.length > 0) {
|
|
196
|
-
console.log("❌ Aucune PR prete a merger.")
|
|
197
|
-
console.log("")
|
|
198
|
-
if (NEEDS_REVIEW.length > 0) {
|
|
199
|
-
console.log("→ PRs en attente de review: " + NEEDS_REVIEW.map(p => '#'+p.number).join(', '))
|
|
200
|
-
console.log(" Demandez une review ou utilisez: /gitflow:8-review <numero>")
|
|
201
|
-
}
|
|
202
|
-
if (NEEDS_CHANGES.length > 0) {
|
|
203
|
-
console.log("→ PRs avec changements demandes: " + NEEDS_CHANGES.map(p => '#'+p.number).join(', '))
|
|
204
|
-
console.log(" Adressez le feedback puis re-demandez une review")
|
|
205
|
-
}
|
|
206
|
-
if (HAS_CONFLICTS.length > 0) {
|
|
207
|
-
console.log("→ PRs avec conflits: " + HAS_CONFLICTS.map(p => '#'+p.number).join(', '))
|
|
208
|
-
console.log(" Resolvez les conflits avec: git rebase origin/<target>")
|
|
209
|
-
}
|
|
210
|
-
exit(1)
|
|
211
|
-
} else {
|
|
212
|
-
console.log("✅ Aucune PR ouverte!")
|
|
213
|
-
console.log("→ Creez une PR avec: /gitflow:7-pull-request")
|
|
214
|
-
exit(0)
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### 0.5 Ordre recommande pour "Toutes"
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
ORDRE DE MERGE RECOMMANDE:
|
|
222
|
-
1. Hotfixes (urgents, patches production)
|
|
223
|
-
2. Releases (vers main, puis merge back)
|
|
224
|
-
3. Features (par date de creation, plus anciennes d'abord)
|
|
225
|
-
```
|
|
39
|
+
**Catégories:**
|
|
40
|
+
- ✅ PRÊTES: mergeable + approved
|
|
41
|
+
- ⏳ ATTENTE REVIEW: pas encore reviewée
|
|
42
|
+
- ⚠️ CHANGEMENTS DEMANDÉS: feedback à adresser
|
|
43
|
+
- ❌ CONFLITS: rebase requis
|
|
226
44
|
|
|
227
45
|
---
|
|
228
46
|
|
|
229
|
-
## Pre-merge
|
|
230
|
-
|
|
231
|
-
### 1. Status PR
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
235
|
-
az repos pr show --id {number} \
|
|
236
|
-
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
237
|
-
--project "$AZURE_PROJECT" \
|
|
238
|
-
--query "{status:status, mergeStatus:mergeStatus, reviewers:reviewers}"
|
|
239
|
-
else
|
|
240
|
-
gh pr view {number} --json state,mergeable,mergeStateStatus,reviews,checks
|
|
241
|
-
fi
|
|
242
|
-
```
|
|
47
|
+
## Étape 2: Pre-merge Checks
|
|
243
48
|
|
|
244
|
-
| Check | Requis | Action si
|
|
49
|
+
| Check | Requis | Action si échec |
|
|
245
50
|
|-------|--------|-----------------|
|
|
246
|
-
| State = OPEN
|
|
247
|
-
| Mergeable
|
|
248
|
-
|
|
|
249
|
-
|
|
250
|
-
### 2. Reviews
|
|
251
|
-
|
|
252
|
-
| Check | Condition | Action |
|
|
253
|
-
|-------|-----------|--------|
|
|
254
|
-
| Min approvals | Config: `minReviewers` | Attendre reviews |
|
|
255
|
-
| No changes requested | Aucun "Request changes" actif | Resoudre feedback |
|
|
256
|
-
| Required reviewers | Si configure | Verifier presence |
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
# Verifier reviews
|
|
260
|
-
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
261
|
-
az repos pr show --id {number} \
|
|
262
|
-
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
263
|
-
--project "$AZURE_PROJECT" \
|
|
264
|
-
--query "reviewers[?vote>0]"
|
|
265
|
-
else
|
|
266
|
-
gh pr view {number} --json reviews --jq '.reviews[] | select(.state=="APPROVED")'
|
|
267
|
-
fi
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### 3. CI/CD Checks
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
if [ "$GIT_PROVIDER" = "azuredevops" ]; then
|
|
274
|
-
# Azure DevOps - checks via policy status
|
|
275
|
-
az repos pr policy list --id {number} \
|
|
276
|
-
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
277
|
-
--project "$AZURE_PROJECT"
|
|
278
|
-
else
|
|
279
|
-
gh pr checks {number}
|
|
280
|
-
fi
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
| Status | Action |
|
|
284
|
-
|--------|--------|
|
|
285
|
-
| Tous ✓ | Continuer |
|
|
286
|
-
| En cours | Attendre |
|
|
287
|
-
| Echec | BLOQUER - afficher details |
|
|
288
|
-
|
|
289
|
-
### 4. Branch Protection
|
|
290
|
-
|
|
291
|
-
| Rule | Verification |
|
|
292
|
-
|------|--------------|
|
|
293
|
-
| Up-to-date | `git rev-list --count HEAD..origin/{base}` = 0 |
|
|
294
|
-
| Linear history | Si requis, rebase avant merge |
|
|
295
|
-
| Signed commits | Si requis, verifier signatures |
|
|
51
|
+
| State = OPEN | OUI | "PR déjà mergée" |
|
|
52
|
+
| Mergeable | OUI | "Résoudre conflits" |
|
|
53
|
+
| CI vert | OUI | "Attendre ou corriger" |
|
|
54
|
+
| Reviews OK | OUI | "Demander review" |
|
|
296
55
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
## EF Core Pre-merge (si applicable)
|
|
56
|
+
### EF Core (si migrations)
|
|
300
57
|
|
|
301
|
-
|
|
58
|
+
| Check | Bloquant | Note |
|
|
59
|
+
|-------|----------|------|
|
|
60
|
+
| ModelSnapshot sync avec `$BASE_BRANCH` | OUI | develop pour feature, main pour release/hotfix |
|
|
61
|
+
| `dotnet ef migrations script` OK | OUI | Script idempotent generable |
|
|
62
|
+
| Pas de data loss non confirmé | WARNING | DropTable, DropColumn, DeleteData |
|
|
302
63
|
|
|
303
64
|
```bash
|
|
304
|
-
#
|
|
305
|
-
git diff origin
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
| Check | Validation | Bloquant |
|
|
309
|
-
|-------|------------|----------|
|
|
310
|
-
| Sync ModelSnapshot | Pas de conflit avec develop | OUI |
|
|
311
|
-
| Build migrations | `dotnet ef migrations script` OK | OUI |
|
|
312
|
-
| Pas de data loss | Scan DropTable/DropColumn | WARNING |
|
|
313
|
-
|
|
314
|
-
### Si conflit ModelSnapshot detecte
|
|
315
|
-
|
|
316
|
-
```
|
|
317
|
-
⚠️ CONFLIT MODELSNAPSHOT DETECTE
|
|
318
|
-
────────────────────────────────
|
|
319
|
-
Le ModelSnapshot a diverge de develop.
|
|
320
|
-
|
|
321
|
-
Options:
|
|
322
|
-
1. Rebase + recreer migration (recommande)
|
|
323
|
-
2. Merge manuel (risque)
|
|
324
|
-
|
|
325
|
-
Commande recommandee:
|
|
326
|
-
git rebase origin/develop
|
|
327
|
-
dotnet ef migrations remove
|
|
328
|
-
dotnet ef migrations add {MigrationName}
|
|
329
|
-
────────────────────────────────
|
|
65
|
+
# Verifier sync ModelSnapshot avec branche parente
|
|
66
|
+
git diff "origin/$BASE_BRANCH" -- Migrations/*ModelSnapshot.cs
|
|
67
|
+
# Si diff > 0 lignes sur sections non liees a cette branche → CONFLIT
|
|
330
68
|
```
|
|
331
69
|
|
|
332
70
|
---
|
|
333
71
|
|
|
334
|
-
##
|
|
335
|
-
|
|
336
|
-
### Strategie selon type
|
|
72
|
+
## Étape 3: Exécution
|
|
337
73
|
|
|
338
|
-
|
|
339
|
-
|--------------|----------------|--------|--------------|
|
|
340
|
-
| `feature/*` | Squash | `--squash` | `--squash true` |
|
|
341
|
-
| `hotfix/*` | Merge commit | `--merge` | `--squash false` |
|
|
342
|
-
| `release/*` | Merge commit | `--merge` | `--squash false` |
|
|
74
|
+
### Stratégie
|
|
343
75
|
|
|
344
|
-
|
|
76
|
+
| Type | Stratégie | Raison |
|
|
77
|
+
|------|-----------|--------|
|
|
78
|
+
| `feature/*` | Squash | Historique propre |
|
|
79
|
+
| `hotfix/*` | Merge commit | Traçabilité |
|
|
80
|
+
| `release/*` | Merge commit | Traçabilité |
|
|
345
81
|
|
|
82
|
+
### GitHub
|
|
346
83
|
```bash
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
gh pr merge {number} --squash --delete-branch
|
|
350
|
-
|
|
351
|
-
# Merge commit (hotfix/release)
|
|
352
|
-
gh pr merge {number} --merge --delete-branch
|
|
353
|
-
fi
|
|
84
|
+
gh pr merge {number} --squash --delete-branch # feature
|
|
85
|
+
gh pr merge {number} --merge --delete-branch # hotfix/release
|
|
354
86
|
```
|
|
355
87
|
|
|
356
|
-
###
|
|
357
|
-
|
|
88
|
+
### Azure DevOps
|
|
358
89
|
```bash
|
|
359
|
-
|
|
360
|
-
# Complete la PR (merge)
|
|
361
|
-
az repos pr update --id {number} \
|
|
362
|
-
--organization "https://dev.azure.com/$AZURE_ORG" \
|
|
363
|
-
--project "$AZURE_PROJECT" \
|
|
364
|
-
--status completed \
|
|
365
|
-
--squash {true|false} \
|
|
366
|
-
--delete-source-branch true
|
|
367
|
-
|
|
368
|
-
# Note: Si merge policies bloquent, utiliser --bypass-policy (admin requis)
|
|
369
|
-
fi
|
|
90
|
+
az repos pr update --id {number} --status completed --squash {true|false} --delete-source-branch true
|
|
370
91
|
```
|
|
371
92
|
|
|
372
|
-
### Options supplementaires
|
|
373
|
-
|
|
374
|
-
| Option | GitHub | Azure DevOps |
|
|
375
|
-
|--------|--------|--------------|
|
|
376
|
-
| Auto-merge quand CI vert | `--auto` | `--auto-complete true` |
|
|
377
|
-
| Supprimer branche source | `--delete-branch` | `--delete-source-branch true` |
|
|
378
|
-
| Override protections | `--admin` | `--bypass-policy` (danger) |
|
|
379
|
-
|
|
380
93
|
---
|
|
381
94
|
|
|
382
|
-
## Post-merge
|
|
383
|
-
|
|
384
|
-
### 1. Versioning (si release/hotfix)
|
|
95
|
+
## Étape 4: Post-merge
|
|
385
96
|
|
|
386
97
|
```bash
|
|
387
|
-
#
|
|
388
|
-
VERSION=$(cat package.json | jq -r '.version')
|
|
389
|
-
|
|
390
|
-
# Creer tag
|
|
98
|
+
# Si release/hotfix → créer tag
|
|
391
99
|
git tag -a "v$VERSION" -m "Release v$VERSION"
|
|
392
100
|
git push origin "v$VERSION"
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
### 2. Changelog (optionnel)
|
|
396
|
-
|
|
397
|
-
```bash
|
|
398
|
-
# Ajouter entree CHANGELOG
|
|
399
|
-
echo "## v$VERSION - $(date +%Y-%m-%d)" >> CHANGELOG.md
|
|
400
|
-
gh pr view {number} --json title,body >> CHANGELOG.md
|
|
401
|
-
```
|
|
402
101
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
| Canal | Message |
|
|
406
|
-
|-------|---------|
|
|
407
|
-
| Slack | "PR #{number} merged to {base}" |
|
|
408
|
-
| Teams | Idem |
|
|
409
|
-
| Email | Idem |
|
|
410
|
-
|
|
411
|
-
### 4. Cleanup
|
|
412
|
-
|
|
413
|
-
```bash
|
|
414
|
-
# Supprimer branche locale
|
|
102
|
+
# Cleanup
|
|
415
103
|
git branch -d {branch}
|
|
416
|
-
|
|
417
|
-
# Fetch et prune
|
|
418
104
|
git fetch --prune
|
|
419
105
|
```
|
|
420
106
|
|
|
421
107
|
---
|
|
422
108
|
|
|
423
|
-
##
|
|
109
|
+
## Résumé
|
|
424
110
|
|
|
425
111
|
```
|
|
426
112
|
MERGE COMPLETE
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
Checks passes:
|
|
434
|
-
✓ Reviews: {count} approvals
|
|
435
|
-
✓ CI: All green
|
|
436
|
-
✓ Conflicts: None
|
|
437
|
-
✓ EF Core: {OK|N/A}
|
|
438
|
-
|
|
439
|
-
Post-merge:
|
|
440
|
-
✓ Branch deleted: {branch}
|
|
441
|
-
✓ Tag created: {tag|N/A}
|
|
442
|
-
|
|
443
|
-
════════════════════════════════════════
|
|
113
|
+
- PR: #{number} | {title}
|
|
114
|
+
- Base: {base} | Strategy: {squash|merge}
|
|
115
|
+
- Reviews: {count} ✓ | CI: ✓
|
|
116
|
+
- Branch deleted: {branch}
|
|
117
|
+
- Tag: {v1.2.3|N/A}
|
|
444
118
|
```
|
|
445
119
|
|
|
446
|
-
|
|
120
|
+
**PROCHAINE ÉTAPE**
|
|
447
121
|
|
|
448
|
-
|
|
122
|
+
Finaliser la branche (cleanup worktree, merge back si release/hotfix):
|
|
449
123
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
| "Checks failing" | CI rouge | Corriger et re-push |
|
|
454
|
-
| "Review required" | Pas d'approval | Demander review |
|
|
455
|
-
| "Branch protected" | Rules non respectees | Verifier requirements |
|
|
456
|
-
| "az: command not found" | Azure CLI manquant | `winget install Microsoft.AzureCLI` |
|
|
457
|
-
| "gh: command not found" | GitHub CLI manquant | https://cli.github.com |
|
|
458
|
-
| "Please run 'az login'" | Non authentifie | `az login` |
|
|
124
|
+
```
|
|
125
|
+
/gitflow:11-finish {branch}
|
|
126
|
+
```
|
|
459
127
|
|
|
460
|
-
|
|
128
|
+
---
|
|
461
129
|
|
|
462
|
-
|
|
463
|
-
|----------|-----|---------------|
|
|
464
|
-
| **GitHub** | `gh pr merge` | Squash/Merge/Rebase |
|
|
465
|
-
| **Azure DevOps** | `az repos pr update --status completed` | Squash ou Merge |
|
|
130
|
+
## Erreurs courantes
|
|
466
131
|
|
|
467
|
-
|
|
132
|
+
| Erreur | Solution |
|
|
133
|
+
|--------|----------|
|
|
134
|
+
| "Not mergeable" | `git rebase origin/{base}` |
|
|
135
|
+
| "Checks failing" | Corriger et re-push |
|
|
136
|
+
| "Review required" | Demander review |
|
|
137
|
+
| "az: not found" | `winget install Microsoft.AzureCLI` |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Rollback
|
|
468
142
|
|
|
469
143
|
```bash
|
|
470
|
-
# Identifier commit merge
|
|
471
144
|
MERGE_COMMIT=$(git log --merges -1 --format="%H")
|
|
472
|
-
|
|
473
|
-
# Revert
|
|
474
145
|
git revert -m 1 $MERGE_COMMIT
|
|
475
146
|
git push origin {base}
|
|
476
147
|
```
|
|
@@ -482,6 +153,5 @@ git push origin {base}
|
|
|
482
153
|
| Commande | Action |
|
|
483
154
|
|----------|--------|
|
|
484
155
|
| `/gitflow:9-merge 123` | Merge PR #123 |
|
|
485
|
-
| `/gitflow:9-merge
|
|
486
|
-
| `/gitflow:9-merge 123 --
|
|
487
|
-
| `/gitflow:9-merge 123 --admin` | Override protections (danger) |
|
|
156
|
+
| `/gitflow:9-merge` | Scan et proposer |
|
|
157
|
+
| `/gitflow:9-merge 123 --auto` | Auto quand CI vert |
|