From 7d491d5072d5f76d14421bf436fce3ba7c9cbc65 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Thu, 24 Sep 2026 00:55:55 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20norme=20merge=20squash=20(feature?= =?UTF-8?q?=E2=86=92develop=E2=86=92master).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Met à jour la décision §26, le briefing front et l’API Gitea. Les merges --no-ff déjà poussés (#167/#168) restent inchangés. Co-authored-by: Cursor --- docs/24_DECISIONS-PROJET.md | 33 ++++++++++++++++++++++++--------- docs/26_GITEA-API.md | 9 ++++++++- docs/27_BRIEFING-FRONTEND.md | 18 ++++++++++++++---- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/docs/24_DECISIONS-PROJET.md b/docs/24_DECISIONS-PROJET.md index 8525001..1aee1c6 100644 --- a/docs/24_DECISIONS-PROJET.md +++ b/docs/24_DECISIONS-PROJET.md @@ -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 d’historique. + +**API Gitea** (rappel) : +```http +POST /repos/jmartin/petitspas/pulls/{index}/merge +{"Do":"squash","MergeTitleField":"feat(#N): …","MergeMessageField":"Closes #N"} +``` --- diff --git a/docs/26_GITEA-API.md b/docs/26_GITEA-API.md index 1cbea2e..04c7d13 100644 --- a/docs/26_GITEA-API.md +++ b/docs/26_GITEA-API.md @@ -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 diff --git a/docs/27_BRIEFING-FRONTEND.md b/docs/27_BRIEFING-FRONTEND.md index 8c16c06..f74def4 100644 --- a/docs/27_BRIEFING-FRONTEND.md +++ b/docs/27_BRIEFING-FRONTEND.md @@ -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" ``` --- -- 2.54.0