docs: norme merge squash (feature→develop→master)

Propagation depuis develop.

Co-authored-by: Julien Martin <julien.martin@ptits-pas.fr>
This commit was merged in pull request #191.
This commit is contained in:
2026-09-23 22:56:25 +00:00
committed by jmartin
parent d127ab4ecb
commit 77832d53c4
3 changed files with 46 additions and 14 deletions
+24 -9
View File
@@ -1,7 +1,7 @@
# 📋 Décisions Projet - P'titsPas
**Version** : 1.2
**Date** : 16 Juin 2026
**Version** : 1.3
**Date** : 24 Septembre 2026
**Auteur** : Équipe PtitsPas
---
@@ -465,19 +465,34 @@ docs/
---
### 26. Branches Git
### 26. Branches Git + merge squash (norme)
**Décision** : ✅ **Stratégie simple : master + feature branches**
**Décision** : ✅ **`develop` + `master` + `feature/*`, merges en squash**
**Justification** :
- Simplicité (petite équipe)
- Flexibilité
- Historique lisible sur `develop` / `master` (1 commit = 1 ticket)
- Déploiement prod uniquement depuis `master`
**Branches** :
- `master` : Production
- `archive/*` : Archives (ex: maquette initiale)
- `migration/*` : Migrations (ex: intégration YNOV)
- `feature/*` : Nouvelles fonctionnalités
- `master` : Production (déploiement auto)
- `develop` : Intégration / recette
- `feature/*` : Ticket en cours (depuis `develop`)
- `archive/*`, `migration/*` : Archives / migrations ponctuelles
**Flux (norme à partir de #169+)** :
1. Branche `feature/N-…` depuis `develop`
2. PR **feature → `develop`** : merge **squash** (`Do: squash` côté Gitea)
3. Quand un lot est prêt : PR **`develop``master`** : merge **squash** également
4. Message squash : `feat(#N): …` / `fix(#N): …` + `Closes #N` si applicable
**Exception** : les merges `--no-ff` déjà poussés (ex. #167, #168) restent tels quels — pas de réécriture dhistorique.
**API Gitea** (rappel) :
```http
POST /repos/jmartin/petitspas/pulls/{index}/merge
{"Do":"squash","MergeTitleField":"feat(#N): ","MergeMessageField":"Closes #N"}
```
---
+8 -1
View File
@@ -116,10 +116,17 @@ curl -s -H "Authorization: token $GITEA_TOKEN" \
"https://git.ptits-pas.fr/api/v1/repos/jmartin/petitspas/pulls?state=open" | jq .
# Créer une PR (head = branche source, base = branche cible)
# Norme : feature/* → develop, puis develop → master
curl -s -X POST -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"head":"develop","base":"master","title":"Titre de la PR"}' \
-d '{"head":"feature/XX-nom","base":"develop","title":"feat(#XX): Titre","body":"Closes #XX"}' \
"https://git.ptits-pas.fr/api/v1/repos/jmartin/petitspas/pulls"
# Merger en squash (norme — voir 24_DECISIONS-PROJET.md §26)
curl -s -X POST -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"Do":"squash","MergeTitleField":"feat(#XX): Titre","MergeMessageField":"Closes #XX"}' \
"https://git.ptits-pas.fr/api/v1/repos/jmartin/petitspas/pulls/{index}/merge"
```
### 3.4 Branches
+14 -4
View File
@@ -194,6 +194,9 @@ frontend/lib/
## Workflow Git
Norme projet : **squash merge** (voir [24_DECISIONS-PROJET.md](./24_DECISIONS-PROJET.md) §26).
Cible habituelle : `feature/*``develop` ; puis `develop``master` quand le lot est prêt.
```bash
# 1. Créer une branche feature
git checkout develop
@@ -204,15 +207,22 @@ git checkout -b feature/XX-nom-ticket
git add .
git commit -m "feat(#XX): Description courte"
# 3. Pousser et créer PR
# 3. Pousser et créer PR vers develop
git push -u origin feature/XX-nom-ticket
# 4. Créer PR vers master via Gitea ou API
# 4. Créer PR (base = develop)
curl -X POST \
-H "Authorization: token giteabu_1796c6aace0e2ef7e4fdb49cdc3bc1bf8ee31fbc" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"feat(#XX): Titre","body":"Description\n\nCloses #XX","head":"feature/XX-nom-ticket","base":"master"}' \
-d '{"title":"feat(#XX): Titre","body":"Description\n\nCloses #XX","head":"feature/XX-nom-ticket","base":"develop"}' \
"https://git.ptits-pas.fr/api/v1/repos/jmartin/petitspas/pulls"
# 5. Merger en squash (pas merge commit)
curl -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"Do":"squash","MergeTitleField":"feat(#XX): Titre","MergeMessageField":"Closes #XX"}' \
"https://git.ptits-pas.fr/api/v1/repos/jmartin/petitspas/pulls/{index}/merge"
```
---