@atlashub/smartstack-cli 1.6.1 → 1.8.0

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.
@@ -335,37 +335,98 @@ AskUserQuestion({
335
335
 
336
336
  ---
337
337
 
338
- ## STEP 9: Summary
338
+ ## STEP 9: Resume
339
+
340
+ **Afficher un resume apres la creation de la migration:**
339
341
 
340
342
  ```
341
- ================================================================================
342
- MIGRATION CREATED
343
- ================================================================================
343
+ ===============================================================================
344
+ MIGRATION CRÉÉE
345
+ ===============================================================================
346
+
347
+ DÉTAILS MIGRATION
348
+ -------------------------------------------------------------------------------
349
+ • Nom: {MIGRATION_NAME}
350
+ • Branche: {CURRENT_BRANCH}
351
+ • Version: {VERSION}
352
+ • Context: {CONTEXT}
353
+
354
+ FICHIERS GÉNÉRÉS
355
+ -------------------------------------------------------------------------------
356
+ ✓ {timestamp}_{MIGRATION_NAME}.cs
357
+ ✓ {timestamp}_{MIGRATION_NAME}.Designer.cs
358
+ ✓ ApplicationDbContextModelSnapshot.cs (mis à jour)
359
+
360
+ VALIDATIONS
361
+ -------------------------------------------------------------------------------
362
+ ✓ Règle "1 migration par feature" respectée
363
+ ✓ Convention de nommage respectée
364
+ ✓ Traçabilité branche/version assurée
365
+
366
+ ===============================================================================
367
+ PROCHAINES ÉTAPES
368
+ ===============================================================================
369
+
370
+ 1. Vérifier le code généré:
371
+ Ouvrir Migrations/{timestamp}_{MIGRATION_NAME}.cs
372
+
373
+ 2. Appliquer la migration en local:
374
+ /efcore:db-deploy
375
+
376
+ 3. Committer les changements:
377
+ /gitflow:3-commit
378
+
379
+ 4. Avant le merge: Rebaser sur develop si nécessaire:
380
+ /efcore:rebase-snapshot
381
+
382
+ ===============================================================================
383
+ ```
344
384
 
345
- NAME: {MIGRATION_NAME}
346
- BRANCH: {CURRENT_BRANCH}
347
- VERSION: {VERSION}
385
+ **Si des opérations destructives sont détectées:**
348
386
 
349
- FILES:
350
- OK {timestamp}_{MIGRATION_NAME}.cs
351
- OK {timestamp}_{MIGRATION_NAME}.Designer.cs
352
- OK ApplicationDbContextModelSnapshot.cs (updated)
387
+ ```
388
+ ===============================================================================
389
+ MIGRATION CRÉÉE (AVEC AVERTISSEMENTS)
390
+ ===============================================================================
353
391
 
354
- RULES FOLLOWED:
355
- OK 1 migration per feature
356
- OK Standardized naming
357
- OK Branch/version traceability
392
+ DÉTAILS MIGRATION
393
+ -------------------------------------------------------------------------------
394
+ Nom: {MIGRATION_NAME}
395
+ Branche: {CURRENT_BRANCH}
396
+ • Version: {VERSION}
358
397
 
359
- ================================================================================
360
- NEXT STEPS
361
- ================================================================================
398
+ FICHIERS GÉNÉRÉS
399
+ -------------------------------------------------------------------------------
400
+ ✓ {timestamp}_{MIGRATION_NAME}.cs
401
+ ✓ {timestamp}_{MIGRATION_NAME}.Designer.cs
402
+ ✓ ApplicationDbContextModelSnapshot.cs (mis à jour)
362
403
 
363
- 1. Review generated code in Migrations/
364
- 2. /efcore:db-deploy -> Apply to local DB
365
- 3. /gitflow:3-commit -> Commit changes
366
- 4. Before merge: rebase on develop + recreate if conflicts
404
+ AVERTISSEMENTS
405
+ -------------------------------------------------------------------------------
406
+ Opérations destructives détectées:
407
+ - DropColumn("OldField", "Users") [Ligne 42]
408
+ - DropIndex("IX_Users_Email") [Ligne 48]
367
409
 
368
- ================================================================================
410
+ Ces opérations causeront une PERTE DE DONNÉES.
411
+ Assurez-vous d'avoir un backup avant le déploiement.
412
+
413
+ ===============================================================================
414
+ PROCHAINES ÉTAPES
415
+ ===============================================================================
416
+
417
+ 1. VÉRIFIER les opérations destructives:
418
+ Ouvrir Migrations/{timestamp}_{MIGRATION_NAME}.cs
419
+
420
+ 2. Créer un backup de la base si nécessaire:
421
+ Via SSMS ou Azure Portal
422
+
423
+ 3. Appliquer la migration en local:
424
+ /efcore:db-deploy
425
+
426
+ 4. Committer les changements:
427
+ /gitflow:3-commit
428
+
429
+ ===============================================================================
369
430
  ```
370
431
 
371
432
  ---
@@ -207,39 +207,97 @@ echo " Script: OK"
207
207
 
208
208
  ---
209
209
 
210
- ## STEP 8: Summary
210
+ ## STEP 8: Resume
211
+
212
+ **Afficher un resume apres le rebase:**
213
+
214
+ ```
215
+ ===============================================================================
216
+ REBASE-SNAPSHOT TERMINÉ
217
+ ===============================================================================
218
+
219
+ DÉTAILS
220
+ -------------------------------------------------------------------------------
221
+ • Branche: {current_branch}
222
+ • Backup: {backup_dir}
223
+
224
+ AVANT LE REBASE
225
+ -------------------------------------------------------------------------------
226
+ • Migrations: {old_migrations}
227
+ • Snapshot: {old_hash}
228
+
229
+ APRÈS LE REBASE
230
+ -------------------------------------------------------------------------------
231
+ • Migration: {new_migration_name}
232
+ • Snapshot: {new_hash} (= develop)
233
+
234
+ VALIDATIONS
235
+ -------------------------------------------------------------------------------
236
+ ✓ ModelSnapshot synchronisé avec develop
237
+ ✓ Migration consolidée créée
238
+ ✓ Build vérifié
239
+ ✓ Script de migration valide
240
+
241
+ ===============================================================================
242
+ PROCHAINES ÉTAPES
243
+ ===============================================================================
244
+
245
+ 1. Vérifier le contenu de la migration:
246
+ Ouvrir Migrations/{new_migration_name}.cs
247
+
248
+ 2. Tester sur la base locale:
249
+ /efcore:db-reset
250
+ /efcore:db-deploy
251
+
252
+ 3. Committer les changements:
253
+ /gitflow:3-commit
254
+
255
+ ===============================================================================
256
+ RESTAURATION (si nécessaire)
257
+ ===============================================================================
258
+
259
+ Si le rebase a causé des problèmes, restaurez le backup:
260
+
261
+ cp {backup_dir}/*.cs {migrations_dir}/
262
+
263
+ ===============================================================================
264
+ ```
265
+
266
+ **Si le rebase échoue:**
211
267
 
212
268
  ```
213
- ================================================================================
214
- REBASE-SNAPSHOT COMPLETE
215
- ================================================================================
269
+ ===============================================================================
270
+ ÉCHEC DU REBASE-SNAPSHOT
271
+ ===============================================================================
216
272
 
217
- BRANCH: {current_branch}
218
- BACKUP: {backup_dir}
273
+ ERREUR
274
+ -------------------------------------------------------------------------------
275
+ ✗ {error_message}
219
276
 
220
- BEFORE:
221
- Migrations: {old_migrations}
222
- ModelSnapshot: {old_hash}
277
+ DÉTAILS
278
+ -------------------------------------------------------------------------------
279
+ • Branche: {current_branch}
280
+ • Backup: {backup_dir}
223
281
 
224
- AFTER:
225
- Migration: {new_migration_name}
226
- ModelSnapshot: {new_hash} (= develop)
282
+ RESTAURATION AUTOMATIQUE
283
+ -------------------------------------------------------------------------------
284
+ Backup restauré automatiquement
285
+ ✓ Fichiers originaux récupérés
227
286
 
228
- ================================================================================
229
- NEXT STEPS
230
- ================================================================================
287
+ ===============================================================================
288
+ ACTIONS SUGGÉRÉES
289
+ ===============================================================================
231
290
 
232
- 1. Check migration content
233
- 2. Test: /efcore:db-reset && /efcore:db-deploy
234
- 3. Commit: /gitflow:3-commit
291
+ 1. Vérifier les erreurs de build:
292
+ dotnet build
235
293
 
236
- ================================================================================
237
- RESTORE (if needed)
238
- ================================================================================
294
+ 2. Vérifier les conflits de modèle:
295
+ /efcore:conflicts
239
296
 
240
- cp {backup_dir}/*.cs {migrations_dir}/
297
+ 3. Si problème persistant, contacter le support:
298
+ support@atlshub.ch
241
299
 
242
- ================================================================================
300
+ ===============================================================================
243
301
  ```
244
302
 
245
303
  ---
@@ -102,45 +102,110 @@ Based on conflict analysis, recommend merge order:
102
102
 
103
103
  ---
104
104
 
105
- ## STEP 5: Display Report
105
+ ## STEP 5: Resume
106
+
107
+ **Afficher le rapport de scan:**
106
108
 
107
109
  ```
108
- ================================================================================
109
- EF CORE CROSS-BRANCH SCAN (via MCP)
110
- ================================================================================
110
+ ===============================================================================
111
+ SCAN CROSS-BRANCH EF CORE
112
+ ===============================================================================
111
113
 
112
- DETECTED WORKTREES ({count})
114
+ WORKTREES DÉTECTÉS ({count})
115
+ -------------------------------------------------------------------------------
113
116
  main/ [main]
114
- develop/ [develop] <- REFERENCE
117
+ develop/ [develop] RÉFÉRENCE
115
118
  features/user-auth/ [feature/user-auth]
116
119
  features/add-products/ [feature/add-products]
117
120
  hotfixes/login-fix/ [hotfix/login-fix]
118
121
 
119
- MIGRATIONS PER BRANCH
120
- --------------------------------------------------------------------------------
121
- Branch | Migrations | Snapshot | vs Develop
122
- --------------------------------------------------------------------------------
123
- develop | 12 | a1b2c3d4 | REFERENCE
122
+ MIGRATIONS PAR BRANCHE
123
+ -------------------------------------------------------------------------------
124
+ Branche | Migrations | Snapshot | vs Develop
125
+ -------------------------------------------------------------------------------
126
+ develop | 12 | a1b2c3d4 | RÉFÉRENCE
124
127
  feature/user-auth | 13 | e5f6g7h8 | +1 migration
125
128
  feature/add-products | 13 | i9j0k1l2 | +1 migration
126
- hotfix/login-fix | 12 | a1b2c3d4 | identical
127
- --------------------------------------------------------------------------------
128
-
129
- RISK ANALYSIS
130
- --------------------------------------------------------------------------------
131
- feature/user-auth : LOW (different tables)
132
- feature/add-products : MEDIUM (FK to same table)
133
- hotfix/login-fix : NONE (snapshot = develop)
134
- --------------------------------------------------------------------------------
135
-
136
- RECOMMENDED MERGE ORDER
137
- --------------------------------------------------------------------------------
138
- 1. hotfix/login-fix -> NONE (direct merge OK)
139
- 2. feature/user-auth -> LOW (merge OK)
140
- 3. feature/add-products -> MEDIUM (after user-auth, then rebase)
141
- --------------------------------------------------------------------------------
142
-
143
- ================================================================================
129
+ hotfix/login-fix | 12 | a1b2c3d4 | identique
130
+ -------------------------------------------------------------------------------
131
+
132
+ ANALYSE DES RISQUES
133
+ -------------------------------------------------------------------------------
134
+ Branche | Risque | Raison
135
+ -------------------------------------------------------------------------------
136
+ hotfix/login-fix | AUCUN | Snapshot = develop
137
+ feature/user-auth | FAIBLE | Tables différentes
138
+ feature/add-products | MOYEN | FK vers même table
139
+ -------------------------------------------------------------------------------
140
+
141
+ ===============================================================================
142
+ ORDRE DE MERGE RECOMMANDÉ
143
+ ===============================================================================
144
+
145
+ # | Branche | Risque | Action
146
+ -------------------------------------------------------------------------------
147
+ 1. | hotfix/login-fix | AUCUN | ✓ Merge direct OK
148
+ 2. | feature/user-auth | FAIBLE | ✓ Merge OK
149
+ 3. | feature/add-products | MOYEN | ⚠ Après user-auth, puis rebase
150
+ -------------------------------------------------------------------------------
151
+
152
+ ===============================================================================
153
+ PROCHAINES ÉTAPES
154
+ ===============================================================================
155
+
156
+ 1. Pour merger une branche sans risque:
157
+ /gitflow:9-merge {branch_name}
158
+
159
+ 2. Pour rebaser avant un merge à risque:
160
+ /efcore:rebase-snapshot
161
+
162
+ 3. Pour analyser une branche spécifique:
163
+ /efcore:conflicts --branch {branch_name}
164
+
165
+ ===============================================================================
166
+ ```
167
+
168
+ **Si des conflits critiques sont détectés:**
169
+
170
+ ```
171
+ ===============================================================================
172
+ SCAN CROSS-BRANCH - CONFLITS DÉTECTÉS
173
+ ===============================================================================
174
+
175
+ WORKTREES DÉTECTÉS ({count})
176
+ -------------------------------------------------------------------------------
177
+ {liste des worktrees}
178
+
179
+ CONFLITS CRITIQUES
180
+ -------------------------------------------------------------------------------
181
+ ⛔ {count} branche(s) avec des conflits HIGH ou CRITICAL
182
+
183
+ DÉTAILS
184
+ -------------------------------------------------------------------------------
185
+ {for each branch with HIGH risk}
186
+ [{branch_name}]
187
+ Risque: ÉLEVÉ
188
+ Raison: {conflict_reason}
189
+ Action: Rebase OBLIGATOIRE avant merge
190
+ {end for}
191
+
192
+ ===============================================================================
193
+ ACTIONS REQUISES
194
+ ===============================================================================
195
+
196
+ ⛔ Des conflits critiques empêchent le merge de certaines branches.
197
+
198
+ 1. Pour chaque branche à risque ÉLEVÉ:
199
+ git checkout {branch}
200
+ /efcore:rebase-snapshot
201
+
202
+ 2. Recréer les migrations après rebase:
203
+ /efcore:migration
204
+
205
+ 3. Re-scanner pour vérifier:
206
+ /efcore:scan
207
+
208
+ ===============================================================================
144
209
  ```
145
210
 
146
211
  ---
@@ -183,63 +183,119 @@ echo " Migration list OK"
183
183
 
184
184
  ---
185
185
 
186
- ## STEP 7: Summary
186
+ ## STEP 7: Resume
187
+
188
+ **Afficher un resume apres le squash:**
187
189
 
188
190
  ```
189
- ================================================================================
190
- SQUASH COMPLETE
191
- ================================================================================
191
+ ===============================================================================
192
+ MIGRATIONS CONSOLIDÉES
193
+ ===============================================================================
194
+
195
+ DÉTAILS
196
+ -------------------------------------------------------------------------------
197
+ • Branche: {current_branch}
198
+ • Backup: {backup_dir} (local uniquement)
199
+
200
+ AVANT LE SQUASH
201
+ -------------------------------------------------------------------------------
202
+ • Migrations: {old_count} fichiers
203
+
204
+ APRÈS LE SQUASH
205
+ -------------------------------------------------------------------------------
206
+ • Migration: {migration_name}
207
+
208
+ VALIDATIONS
209
+ -------------------------------------------------------------------------------
210
+ ✓ Migrations fusionnées avec succès
211
+ ✓ Build vérifié
212
+ ✓ Liste des migrations valide
213
+
214
+ CONFORMITÉ
215
+ -------------------------------------------------------------------------------
216
+ ✓ EF Core CLI uniquement
217
+ ✓ Pas de scripts SQL dans le repository
218
+
219
+ ===============================================================================
220
+ DÉPLOIEMENT EN PRODUCTION
221
+ ===============================================================================
192
222
 
193
- BRANCH: {current_branch}
194
- BACKUP: {backup_dir} (local only)
223
+ OPTION 1 - EF Core CLI (Recommandé):
224
+ -------------------------------------------------------------------------------
225
+ dotnet ef database update {migration_name} \
226
+ --project "{INFRA_PROJECT}" \
227
+ --startup-project "{STARTUP_PROJECT}" \
228
+ --connection "Server=...;Database=...;..."
195
229
 
196
- BEFORE:
197
- Migrations: {old_count}
230
+ OPTION 2 - Si les migrations sont déjà appliquées:
231
+ -------------------------------------------------------------------------------
232
+ Insérer manuellement dans __EFMigrationsHistory via SSMS/Azure:
198
233
 
199
- AFTER:
200
- Migration: {migration_name}
234
+ INSERT INTO __EFMigrationsHistory (MigrationId, ProductVersion)
235
+ VALUES ('{migration_name}', '10.0.0')
201
236
 
202
- COMPLIANT: EF Core CLI only (no SQL scripts in repository)
237
+ ⚠️ NE PAS générer de scripts SQL dans le repository!
203
238
 
204
- ================================================================================
205
- IMPORTANT - PRODUCTION DEPLOYMENT
206
- ================================================================================
239
+ ===============================================================================
240
+ PROCHAINES ÉTAPES
241
+ ===============================================================================
207
242
 
208
- Pour déployer en production, vous avez DEUX options:
243
+ 1. Vérifier le contenu de la migration consolidée:
244
+ Ouvrir Migrations/{migration_name}.cs
209
245
 
210
- OPTION 1 - EF Core CLI (Recommandé):
211
- ────────────────────────────────────────────────────────────────────────────────
212
- dotnet ef database update {migration_name} \
213
- --project "$INFRA_PROJECT" \
214
- --startup-project "$STARTUP_PROJECT" \
215
- --connection "Server=...;Database=...;..."
216
- ────────────────────────────────────────────────────────────────────────────────
246
+ 2. Tester sur la base de développement:
247
+ /efcore:db-reset
248
+ /efcore:db-deploy
217
249
 
218
- OPTION 2 - Si migrations déjà appliquées (mark as applied):
219
- ────────────────────────────────────────────────────────────────────────────────
220
- # Insérer manuellement dans __EFMigrationsHistory via SSMS/Azure
221
- # INSERT INTO __EFMigrationsHistory (MigrationId, ProductVersion)
222
- # VALUES ('{migration_name}', '10.0.0')
223
- ────────────────────────────────────────────────────────────────────────────────
250
+ 3. Committer les changements:
251
+ /gitflow:3-commit
224
252
 
225
- ⚠️ NE PAS générer de scripts SQL dans le repository!
226
- Utilisez toujours EF Core CLI pour les déploiements.
253
+ ===============================================================================
254
+ RESTAURATION (si nécessaire)
255
+ ===============================================================================
256
+
257
+ Si le squash a causé des problèmes, restaurez le backup:
258
+
259
+ cp {backup_dir}/*.cs {migrations_dir}/
260
+
261
+ ===============================================================================
262
+ ```
263
+
264
+ **Si le squash échoue:**
265
+
266
+ ```
267
+ ===============================================================================
268
+ ÉCHEC DU SQUASH
269
+ ===============================================================================
270
+
271
+ ERREUR
272
+ -------------------------------------------------------------------------------
273
+ ✗ {error_message}
274
+
275
+ DÉTAILS
276
+ -------------------------------------------------------------------------------
277
+ • Branche: {current_branch}
278
+ • Backup: {backup_dir}
279
+
280
+ RESTAURATION AUTOMATIQUE
281
+ -------------------------------------------------------------------------------
282
+ ✓ Backup restauré automatiquement
283
+ ✓ Migrations originales récupérées
227
284
 
228
- ================================================================================
229
- NEXT STEPS
230
- ================================================================================
285
+ ===============================================================================
286
+ ACTIONS SUGGÉRÉES
287
+ ===============================================================================
231
288
 
232
- 1. Vérifier le contenu de la migration consolidée
233
- 2. Tester sur dev DB: /efcore:db-reset && /efcore:db-deploy
234
- 3. Commit: /gitflow:3-commit
289
+ 1. Vérifier les erreurs de build:
290
+ dotnet build
235
291
 
236
- ================================================================================
237
- RESTORE (if needed)
238
- ================================================================================
292
+ 2. Vérifier le ModelSnapshot:
293
+ /efcore:conflicts
239
294
 
240
- cp {backup_dir}/*.cs {migrations_dir}/
295
+ 3. Si problème persistant:
296
+ support@atlshub.ch
241
297
 
242
- ================================================================================
298
+ ===============================================================================
243
299
  ```
244
300
 
245
301
  ---