|
1 | 1 | use crate::models::{Check, CheckCategory}; |
2 | 2 |
|
3 | | -/// Returns all check definitions organized by category |
| 3 | +/// Returns all check definitions organized by domain category |
4 | 4 | pub fn all_checks() -> Vec<Check> { |
5 | 5 | vec![ |
6 | | - // ── Fundamentals ── |
| 6 | + // ── Pipeline CI ── |
7 | 7 | Check { |
8 | 8 | id: "pipeline_exists".into(), |
9 | 9 | name: "Pipeline CI existe".into(), |
10 | 10 | description: "Au moins un workflow YAML présent dans .github/workflows/".into(), |
11 | | - category: CheckCategory::Fundamentals, |
| 11 | + category: CheckCategory::Pipeline, |
12 | 12 | }, |
13 | 13 | Check { |
14 | 14 | id: "pipeline_green".into(), |
15 | 15 | name: "Pipeline vert sur main".into(), |
16 | 16 | description: "Le dernier run du workflow sur main est en succès".into(), |
17 | | - category: CheckCategory::Fundamentals, |
| 17 | + category: CheckCategory::Pipeline, |
18 | 18 | }, |
| 19 | + Check { |
| 20 | + id: "pipeline_fast".into(), |
| 21 | + name: "Pipeline rapide (< 5 min)".into(), |
| 22 | + description: "La durée moyenne des derniers runs est inférieure à 5 minutes".into(), |
| 23 | + category: CheckCategory::Pipeline, |
| 24 | + }, |
| 25 | + Check { |
| 26 | + id: "ci_cache".into(), |
| 27 | + name: "Cache CI optimisé".into(), |
| 28 | + description: "Le pipeline utilise un mécanisme de cache (actions/cache, Docker layer cache, etc.) pour accélérer les builds".into(), |
| 29 | + category: CheckCategory::Pipeline, |
| 30 | + }, |
| 31 | + Check { |
| 32 | + id: "matrix_testing".into(), |
| 33 | + name: "Tests en matrice (multi-version)".into(), |
| 34 | + description: "Le pipeline utilise une stratégie de matrix pour tester sur plusieurs versions ou OS".into(), |
| 35 | + category: CheckCategory::Pipeline, |
| 36 | + }, |
| 37 | + Check { |
| 38 | + id: "reusable_workflows".into(), |
| 39 | + name: "Workflows réutilisables".into(), |
| 40 | + description: "Le dépôt utilise ou définit des workflows réutilisables (workflow_call)".into(), |
| 41 | + category: CheckCategory::Pipeline, |
| 42 | + }, |
| 43 | + Check { |
| 44 | + id: "ci_notifications".into(), |
| 45 | + name: "Notifications CI (Discord/Slack)".into(), |
| 46 | + description: "Des notifications sont envoyées sur Discord ou Slack en cas de succès ou d'échec du pipeline".into(), |
| 47 | + category: CheckCategory::Pipeline, |
| 48 | + }, |
| 49 | + // ── Qualité & Tests ── |
19 | 50 | Check { |
20 | 51 | id: "tests_exist".into(), |
21 | 52 | name: "Tests présents".into(), |
22 | 53 | description: "Des fichiers de test existent et sont exécutés dans la CI".into(), |
23 | | - category: CheckCategory::Fundamentals, |
| 54 | + category: CheckCategory::QualiteTests, |
24 | 55 | }, |
25 | 56 | Check { |
26 | 57 | id: "tests_pass".into(), |
27 | 58 | name: "Tests passent dans CI".into(), |
28 | 59 | description: "Le pipeline est vert ET une étape de test a été détectée et exécutée".into(), |
29 | | - category: CheckCategory::Fundamentals, |
| 60 | + category: CheckCategory::QualiteTests, |
30 | 61 | }, |
31 | 62 | Check { |
32 | 63 | id: "lint_in_ci".into(), |
33 | 64 | name: "Lint dans la CI".into(), |
34 | 65 | description: "Un step de lint/format est configuré dans le pipeline".into(), |
35 | | - category: CheckCategory::Fundamentals, |
| 66 | + category: CheckCategory::QualiteTests, |
36 | 67 | }, |
37 | 68 | Check { |
38 | | - id: "dockerfile_exists".into(), |
39 | | - name: "Dockerfile présent".into(), |
40 | | - description: "Un Dockerfile existe à la racine du projet".into(), |
41 | | - category: CheckCategory::Fundamentals, |
| 69 | + id: "coverage_configured".into(), |
| 70 | + name: "Coverage configurée".into(), |
| 71 | + description: "La couverture de code est configurée dans le pipeline".into(), |
| 72 | + category: CheckCategory::QualiteTests, |
42 | 73 | }, |
43 | 74 | Check { |
44 | | - id: "docker_build_ci".into(), |
45 | | - name: "Docker build dans CI".into(), |
46 | | - description: "Le pipeline inclut une étape de build Docker".into(), |
47 | | - category: CheckCategory::Fundamentals, |
| 75 | + id: "quality_gate".into(), |
| 76 | + name: "Quality gate (SonarCloud, etc.)".into(), |
| 77 | + description: "Un outil d'analyse qualité (SonarCloud, CodeClimate, Codacy) est intégré dans la CI".into(), |
| 78 | + category: CheckCategory::QualiteTests, |
48 | 79 | }, |
| 80 | + // ── Sécurité ── |
49 | 81 | Check { |
50 | 82 | id: "no_secrets_in_code".into(), |
51 | 83 | name: "Pas de secrets dans le code".into(), |
52 | 84 | description: "Aucun secret hardcodé détecté dans les fichiers source".into(), |
53 | | - category: CheckCategory::Fundamentals, |
| 85 | + category: CheckCategory::Securite, |
54 | 86 | }, |
55 | | - Check { |
56 | | - id: "readme_exists".into(), |
57 | | - name: "README présent".into(), |
58 | | - description: "Un fichier README.md existe à la racine".into(), |
59 | | - category: CheckCategory::Fundamentals, |
60 | | - }, |
61 | | - // ── Intermediate ── |
62 | 87 | Check { |
63 | 88 | id: "security_scan".into(), |
64 | 89 | name: "Scan de sécurité".into(), |
65 | 90 | description: "Un outil de scan sécurité (Trivy, Snyk, Bandit, etc.) dans la CI".into(), |
66 | | - category: CheckCategory::Intermediate, |
67 | | - }, |
68 | | - Check { |
69 | | - id: "coverage_configured".into(), |
70 | | - name: "Coverage configurée".into(), |
71 | | - description: "La couverture de code est configurée dans le pipeline".into(), |
72 | | - category: CheckCategory::Intermediate, |
| 91 | + category: CheckCategory::Securite, |
73 | 92 | }, |
74 | 93 | Check { |
75 | 94 | id: "dependabot_configured".into(), |
76 | 95 | name: "Dependabot / Renovate".into(), |
77 | 96 | description: "Mise à jour automatique des dépendances configurée".into(), |
78 | | - category: CheckCategory::Intermediate, |
79 | | - }, |
80 | | - Check { |
81 | | - id: "ghcr_published".into(), |
82 | | - name: "Image publiée sur GHCR".into(), |
83 | | - description: "L'image Docker est poussée sur GitHub Container Registry (ghcr.io)".into(), |
84 | | - category: CheckCategory::Intermediate, |
| 97 | + category: CheckCategory::Securite, |
85 | 98 | }, |
86 | | - Check { |
87 | | - id: "quality_gate".into(), |
88 | | - name: "Quality gate (SonarCloud, etc.)".into(), |
89 | | - description: "Un outil d'analyse qualité (SonarCloud, CodeClimate, Codacy) est intégré dans la CI".into(), |
90 | | - category: CheckCategory::Intermediate, |
91 | | - }, |
92 | | - // ── Advanced ── |
93 | 99 | Check { |
94 | 100 | id: "branch_protection".into(), |
95 | 101 | name: "Protection de branche".into(), |
96 | 102 | description: "La branche main est protégée avec PR obligatoire".into(), |
97 | | - category: CheckCategory::Advanced, |
| 103 | + category: CheckCategory::Securite, |
98 | 104 | }, |
| 105 | + // ── Conteneurisation ── |
99 | 106 | Check { |
100 | | - id: "pipeline_fast".into(), |
101 | | - name: "Pipeline rapide (< 5 min)".into(), |
102 | | - description: "La durée moyenne des derniers runs est inférieure à 5 minutes".into(), |
103 | | - category: CheckCategory::Advanced, |
| 107 | + id: "dockerfile_exists".into(), |
| 108 | + name: "Dockerfile présent".into(), |
| 109 | + description: "Un Dockerfile existe à la racine du projet".into(), |
| 110 | + category: CheckCategory::Conteneurisation, |
104 | 111 | }, |
105 | 112 | Check { |
106 | | - id: "multi_environment".into(), |
107 | | - name: "Multi-environnements".into(), |
108 | | - description: "La CI/CD gère plusieurs environnements (staging, prod, etc.)".into(), |
109 | | - category: CheckCategory::Advanced, |
| 113 | + id: "docker_build_ci".into(), |
| 114 | + name: "Docker build dans CI".into(), |
| 115 | + description: "Le pipeline inclut une étape de build Docker".into(), |
| 116 | + category: CheckCategory::Conteneurisation, |
110 | 117 | }, |
| 118 | + Check { |
| 119 | + id: "ghcr_published".into(), |
| 120 | + name: "Image publiée sur GHCR".into(), |
| 121 | + description: "L'image Docker est poussée sur GitHub Container Registry (ghcr.io)".into(), |
| 122 | + category: CheckCategory::Conteneurisation, |
| 123 | + }, |
| 124 | + // ── Déploiement ── |
111 | 125 | Check { |
112 | 126 | id: "auto_deploy".into(), |
113 | 127 | name: "Déploiement automatique".into(), |
114 | 128 | description: "Un déploiement automatique est configuré sur push/merge main".into(), |
115 | | - category: CheckCategory::Advanced, |
116 | | - }, |
117 | | - Check { |
118 | | - id: "ci_cache".into(), |
119 | | - name: "Cache CI optimisé".into(), |
120 | | - description: "Le pipeline utilise un mécanisme de cache (actions/cache, Docker layer cache, etc.) pour accélérer les builds".into(), |
121 | | - category: CheckCategory::Advanced, |
| 129 | + category: CheckCategory::Deploiement, |
122 | 130 | }, |
123 | 131 | Check { |
124 | | - id: "ci_notifications".into(), |
125 | | - name: "Notifications CI (Discord/Slack)".into(), |
126 | | - description: "Des notifications sont envoyées sur Discord ou Slack en cas de succès ou d'échec du pipeline".into(), |
127 | | - category: CheckCategory::Advanced, |
| 132 | + id: "multi_environment".into(), |
| 133 | + name: "Multi-environnements".into(), |
| 134 | + description: "La CI/CD gère plusieurs environnements (staging, prod, etc.)".into(), |
| 135 | + category: CheckCategory::Deploiement, |
128 | 136 | }, |
129 | 137 | Check { |
130 | | - id: "matrix_testing".into(), |
131 | | - name: "Tests en matrice (multi-version)".into(), |
132 | | - description: "Le pipeline utilise une stratégie de matrix pour tester sur plusieurs versions ou OS".into(), |
133 | | - category: CheckCategory::Advanced, |
| 138 | + id: "smoke_tests".into(), |
| 139 | + name: "Tests smoke / e2e post-déploiement".into(), |
| 140 | + description: "Des tests smoke ou e2e sont exécutés après le déploiement pour valider l'environnement".into(), |
| 141 | + category: CheckCategory::Deploiement, |
134 | 142 | }, |
135 | 143 | Check { |
136 | | - id: "reusable_workflows".into(), |
137 | | - name: "Workflows réutilisables".into(), |
138 | | - description: "Le dépôt utilise ou définit des workflows réutilisables (workflow_call)".into(), |
139 | | - category: CheckCategory::Advanced, |
| 144 | + id: "rollback_strategy".into(), |
| 145 | + name: "Stratégie de rollback".into(), |
| 146 | + description: "Le dépôt dispose d'un mécanisme de rollback (workflow dédié, workflow_dispatch, revert automatique)".into(), |
| 147 | + category: CheckCategory::Deploiement, |
140 | 148 | }, |
141 | | - // ── Bonus ── |
| 149 | + // ── Bonnes Pratiques ── |
142 | 150 | Check { |
143 | | - id: "codeowners_exists".into(), |
144 | | - name: "CODEOWNERS présent".into(), |
145 | | - description: "Un fichier CODEOWNERS est configuré".into(), |
146 | | - category: CheckCategory::Bonus, |
| 151 | + id: "readme_exists".into(), |
| 152 | + name: "README présent".into(), |
| 153 | + description: "Un fichier README.md existe à la racine".into(), |
| 154 | + category: CheckCategory::BonnesPratiques, |
147 | 155 | }, |
148 | 156 | Check { |
149 | 157 | id: "gitignore_exists".into(), |
150 | 158 | name: ".gitignore présent".into(), |
151 | 159 | description: "Un fichier .gitignore est configuré pour le projet".into(), |
152 | | - category: CheckCategory::Bonus, |
153 | | - }, |
154 | | - Check { |
155 | | - id: "release_tagging".into(), |
156 | | - name: "Releases / Tags GitHub".into(), |
157 | | - description: "Au moins une release ou un tag GitHub existe pour versionner le projet".into(), |
158 | | - category: CheckCategory::Bonus, |
| 160 | + category: CheckCategory::BonnesPratiques, |
159 | 161 | }, |
160 | 162 | Check { |
161 | | - id: "smoke_tests".into(), |
162 | | - name: "Tests smoke / e2e post-déploiement".into(), |
163 | | - description: "Des tests smoke ou e2e sont exécutés après le déploiement pour valider l'environnement".into(), |
164 | | - category: CheckCategory::Bonus, |
| 163 | + id: "codeowners_exists".into(), |
| 164 | + name: "CODEOWNERS présent".into(), |
| 165 | + description: "Un fichier CODEOWNERS est configuré".into(), |
| 166 | + category: CheckCategory::BonnesPratiques, |
165 | 167 | }, |
166 | 168 | Check { |
167 | 169 | id: "conventional_commits".into(), |
168 | 170 | name: "Commits conventionnels (≥ 80%)".into(), |
169 | 171 | description: "Au moins 80% des commits suivent la convention Conventional Commits (feat:, fix:, chore:, etc.)".into(), |
170 | | - category: CheckCategory::Bonus, |
| 172 | + category: CheckCategory::BonnesPratiques, |
171 | 173 | }, |
172 | 174 | Check { |
173 | 175 | id: "auto_changelog".into(), |
174 | 176 | name: "Changelog automatisé".into(), |
175 | 177 | description: "Un outil de génération de changelog (release-please, semantic-release, etc.) est configuré".into(), |
176 | | - category: CheckCategory::Bonus, |
| 178 | + category: CheckCategory::BonnesPratiques, |
177 | 179 | }, |
178 | 180 | Check { |
179 | | - id: "rollback_strategy".into(), |
180 | | - name: "Stratégie de rollback".into(), |
181 | | - description: "Le dépôt dispose d'un mécanisme de rollback (workflow dédié, workflow_dispatch, revert automatique)".into(), |
182 | | - category: CheckCategory::Bonus, |
| 181 | + id: "release_tagging".into(), |
| 182 | + name: "Releases / Tags GitHub".into(), |
| 183 | + description: "Au moins une release ou un tag GitHub existe pour versionner le projet".into(), |
| 184 | + category: CheckCategory::BonnesPratiques, |
183 | 185 | }, |
184 | 186 | ] |
185 | 187 | } |
0 commit comments