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

Décision §26 + briefing + API Gitea. Les merges --no-ff #167/#168 restent inchangés.

Co-authored-by: Julien Martin <julien.martin@ptits-pas.fr>
This commit was merged in pull request #190.
This commit is contained in:
2026-09-23 22:56:04 +00:00
committed by jmartin
parent f9fd8d73a8
commit 6a586110e7
3 changed files with 46 additions and 14 deletions
+24 -9
View File
@@ -1,7 +1,7 @@
# 📋 Décisions Projet - P'titsPas # 📋 Décisions Projet - P'titsPas
**Version** : 1.2 **Version** : 1.3
**Date** : 16 Juin 2026 **Date** : 24 Septembre 2026
**Auteur** : Équipe PtitsPas **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** : **Justification** :
- Simplicité (petite équipe) - Simplicité (petite équipe)
- Flexibilité - Historique lisible sur `develop` / `master` (1 commit = 1 ticket)
- Déploiement prod uniquement depuis `master`
**Branches** : **Branches** :
- `master` : Production - `master` : Production (déploiement auto)
- `archive/*` : Archives (ex: maquette initiale) - `develop` : Intégration / recette
- `migration/*` : Migrations (ex: intégration YNOV) - `feature/*` : Ticket en cours (depuis `develop`)
- `feature/*` : Nouvelles fonctionnalités - `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 d’historique.
**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 . "https://git.ptits-pas.fr/api/v1/repos/jmartin/petitspas/pulls?state=open" | jq .
# Créer une PR (head = branche source, base = branche cible) # 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" \ curl -s -X POST -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \ -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" "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 ### 3.4 Branches
+14 -4
View File
@@ -194,6 +194,9 @@ frontend/lib/
## Workflow Git ## 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 ```bash
# 1. Créer une branche feature # 1. Créer une branche feature
git checkout develop git checkout develop
@@ -204,15 +207,22 @@ git checkout -b feature/XX-nom-ticket
git add . git add .
git commit -m "feat(#XX): Description courte" 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 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 \ curl -X POST \
-H "Authorization: token giteabu_1796c6aace0e2ef7e4fdb49cdc3bc1bf8ee31fbc" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \ -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" "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"
``` ```
--- ---