Conception complete (Phase 0) pour formation-hub Acadenice : - 19 docs Merise Agile + UML + GitOps + plans (tests/deploy/ops/api) cf docs/00-readme.md pour l'index complet - Stack Docker compose (Docmost + Baserow + Postgres + Redis + MinIO local FS) compose.yml + compose.staging.yml + compose.prod.yml - CI/CD GitHub Actions skeleton (ci, deploy-staging, deploy-prod) - Bridge service skeleton (Hono + TS + Biome + Vitest + zod + pino) - Templates GitHub : PR + 3 issue types + CODEOWNERS + dependabot.yml - Scripts ops : healthcheck, backup quotidien, smoke-test post-deploy - LICENSE AGPL-3.0 + SECURITY.md + CONTRIBUTING.md + CHANGELOG.md - Diagramme drawIO archi infra (XML importable dans diagrams.net) Decisions structurelles enregistrees : - Scope CFA + Agence avec entite PERSONNE pivot multi-roles (ADR-001) - Stack composite Docmost AGPL + Baserow MIT + bridge custom (ADR-001) - Path B : UX quasi-unified via Tiptap node-views custom (ADR-002) - Monorepo trunk-based development (ADR-003) - Postgres separe Docmost/Baserow (ADR-004) - Bridge stack Node 22 + Hono (ADR-005) - Repo neuf prefere a fork Docmost - Prod-like des le jour 1 (pas MVP)
123 lines
3.3 KiB
Markdown
123 lines
3.3 KiB
Markdown
# Contributing
|
|
|
|
Merci de contribuer a `formation-hub`. Ce doc resume les conventions et le workflow.
|
|
|
|
## Code of conduct
|
|
|
|
Etre respectueux. Critiquer le code, pas les personnes. Pas de tolerance pour le harcelement.
|
|
|
|
## Workflow
|
|
|
|
### 1. Setup local
|
|
|
|
```bash
|
|
git clone git@github.com:AcadeNice/wiki.git formation-hub
|
|
cd formation-hub
|
|
cp .env.example .env
|
|
# editer .env avec tes secrets (cf SECURITY.md)
|
|
make up
|
|
```
|
|
|
|
### 2. Branches
|
|
|
|
- Branche par defaut : `main` (protegee)
|
|
- Travail sur branches features : `<type>/<description-kebab>`
|
|
- Types : `feat`, `fix`, `chore`, `docs`, `refactor`, `test`, `ops`, `sec`
|
|
- Duree de vie max d'une branche : **3 jours** (rebase ou drop si plus vieux)
|
|
|
|
Exemples :
|
|
- `feat/saisie-heures-mobile`
|
|
- `fix/baserow-rollup-cache`
|
|
- `docs/update-merise-mcd`
|
|
|
|
### 3. Commits
|
|
|
|
Format : `<type>(<scope>): <description>`
|
|
|
|
Exemples :
|
|
- `feat(bridge): add formateur mention tiptap node`
|
|
- `fix(baserow): correct rollup cache invalidation on annulation`
|
|
- `ops(ci): add SAST scan with semgrep`
|
|
- `sec(deps): bump postgres to 16.4 for CVE-2026-XXXX`
|
|
|
|
Regles :
|
|
- **Pas d'emoji** dans les commits (regle Acadenice)
|
|
- Description en anglais, concise, imperative
|
|
- Explique le WHY si non-evident dans le body
|
|
|
|
### 4. Pull request
|
|
|
|
- 1 PR = 1 sujet (pas de melange feat + fix)
|
|
- Squash merge vers main (un commit propre par PR)
|
|
- Required reviews : minimum 1 approval
|
|
- CI obligatoire (lint + type-check + test + security)
|
|
|
|
Template PR genere automatiquement (voir `.github/PULL_REQUEST_TEMPLATE.md`).
|
|
|
|
### 5. Tests obligatoires
|
|
|
|
Pour toute modification de `bridge/src/`, ajouter ou mettre a jour les tests :
|
|
- Unit tests : `bridge/tests/unit/`
|
|
- Integration tests : `bridge/tests/integration/`
|
|
|
|
Coverage minimum :
|
|
- 80% sur `bridge/src/domain/` et `bridge/src/lib/`
|
|
- 70% global
|
|
|
|
Run local :
|
|
```bash
|
|
cd bridge
|
|
npm test
|
|
npm run test:coverage
|
|
```
|
|
|
|
### 6. Lint et format
|
|
|
|
Outil : **Biome** (lint + format en un)
|
|
|
|
```bash
|
|
cd bridge
|
|
npx biome check --write . # auto-fix
|
|
npx biome ci . # verification CI
|
|
```
|
|
|
|
### 7. Docs
|
|
|
|
Si ta modif change le comportement metier ou l'API :
|
|
- Mettre a jour le doc concerne dans `docs/`
|
|
- Push aussi sur Outline (cf `docs/00-readme...` pour la convention)
|
|
- Mentionner dans `CHANGELOG.md` section `[Unreleased]`
|
|
|
|
## Quality gates (CI)
|
|
|
|
Checks bloquants pour merge :
|
|
|
|
- [ ] Lint Biome vert
|
|
- [ ] Type-check TypeScript vert
|
|
- [ ] Tests unitaires verts
|
|
- [ ] Tests integration verts
|
|
- [ ] Coverage minimum atteint
|
|
- [ ] Secret scanning (TruffleHog) zero hit
|
|
- [ ] SAST (Semgrep) zero `error`
|
|
- [ ] Dependency check (npm audit) zero `high`/`critical`
|
|
- [ ] Docker build OK
|
|
- [ ] Review humaine 1+ approval
|
|
|
|
## Conventions code
|
|
|
|
- TypeScript strict mode obligatoire
|
|
- Pas de `any` sans justification dans un commentaire
|
|
- Naming : camelCase pour vars/fonctions, PascalCase pour classes/types
|
|
- Imports : tries (Biome auto)
|
|
- Pas de console.log en prod (utiliser le logger Pino)
|
|
- Pas d'emoji dans le code, commits, ou specs (Mantra Acadenice IA-23)
|
|
- Code auto-documente, commentaires uniquement pour le POURQUOI (Mantra IA-24)
|
|
|
|
## Methodologie
|
|
|
|
`formation-hub` suit Merise Agile + 64 mantras BYAN. Voir `docs/04-cahier-des-charges-techniques.md` et `docs/03-decision-record.md` pour les decisions architecturales.
|
|
|
|
## Questions
|
|
|
|
- Ouvre une issue sur GitHub avec le label `question`
|
|
- Ou ping `@corentin` ou `@yan` directement
|