Skip to content

Commit 46e2f12

Browse files
committed
feat: Update check categories and definitions for CI workflows
1 parent 4f0a086 commit 46e2f12

3 files changed

Lines changed: 122 additions & 113 deletions

File tree

src/checks/definitions.rs

Lines changed: 96 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,187 @@
11
use crate::models::{Check, CheckCategory};
22

3-
/// Returns all check definitions organized by category
3+
/// Returns all check definitions organized by domain category
44
pub fn all_checks() -> Vec<Check> {
55
vec![
6-
// ── Fundamentals ──
6+
// ── Pipeline CI ──
77
Check {
88
id: "pipeline_exists".into(),
99
name: "Pipeline CI existe".into(),
1010
description: "Au moins un workflow YAML présent dans .github/workflows/".into(),
11-
category: CheckCategory::Fundamentals,
11+
category: CheckCategory::Pipeline,
1212
},
1313
Check {
1414
id: "pipeline_green".into(),
1515
name: "Pipeline vert sur main".into(),
1616
description: "Le dernier run du workflow sur main est en succès".into(),
17-
category: CheckCategory::Fundamentals,
17+
category: CheckCategory::Pipeline,
1818
},
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 ──
1950
Check {
2051
id: "tests_exist".into(),
2152
name: "Tests présents".into(),
2253
description: "Des fichiers de test existent et sont exécutés dans la CI".into(),
23-
category: CheckCategory::Fundamentals,
54+
category: CheckCategory::QualiteTests,
2455
},
2556
Check {
2657
id: "tests_pass".into(),
2758
name: "Tests passent dans CI".into(),
2859
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,
3061
},
3162
Check {
3263
id: "lint_in_ci".into(),
3364
name: "Lint dans la CI".into(),
3465
description: "Un step de lint/format est configuré dans le pipeline".into(),
35-
category: CheckCategory::Fundamentals,
66+
category: CheckCategory::QualiteTests,
3667
},
3768
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,
4273
},
4374
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,
4879
},
80+
// ── Sécurité ──
4981
Check {
5082
id: "no_secrets_in_code".into(),
5183
name: "Pas de secrets dans le code".into(),
5284
description: "Aucun secret hardcodé détecté dans les fichiers source".into(),
53-
category: CheckCategory::Fundamentals,
85+
category: CheckCategory::Securite,
5486
},
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 ──
6287
Check {
6388
id: "security_scan".into(),
6489
name: "Scan de sécurité".into(),
6590
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,
7392
},
7493
Check {
7594
id: "dependabot_configured".into(),
7695
name: "Dependabot / Renovate".into(),
7796
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,
8598
},
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 ──
9399
Check {
94100
id: "branch_protection".into(),
95101
name: "Protection de branche".into(),
96102
description: "La branche main est protégée avec PR obligatoire".into(),
97-
category: CheckCategory::Advanced,
103+
category: CheckCategory::Securite,
98104
},
105+
// ── Conteneurisation ──
99106
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,
104111
},
105112
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,
110117
},
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 ──
111125
Check {
112126
id: "auto_deploy".into(),
113127
name: "Déploiement automatique".into(),
114128
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,
122130
},
123131
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,
128136
},
129137
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,
134142
},
135143
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,
140148
},
141-
// ── Bonus ──
149+
// ── Bonnes Pratiques ──
142150
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,
147155
},
148156
Check {
149157
id: "gitignore_exists".into(),
150158
name: ".gitignore présent".into(),
151159
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,
159161
},
160162
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,
165167
},
166168
Check {
167169
id: "conventional_commits".into(),
168170
name: "Commits conventionnels (≥ 80%)".into(),
169171
description: "Au moins 80% des commits suivent la convention Conventional Commits (feat:, fix:, chore:, etc.)".into(),
170-
category: CheckCategory::Bonus,
172+
category: CheckCategory::BonnesPratiques,
171173
},
172174
Check {
173175
id: "auto_changelog".into(),
174176
name: "Changelog automatisé".into(),
175177
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,
177179
},
178180
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,
183185
},
184186
]
185187
}

src/checks/engine.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ impl CheckEngine {
4242
.push(result);
4343
}
4444

45-
// Build category scores
45+
// Build category scores — ordered to match the UI presentation
4646
let category_order = [
47-
CheckCategory::Fundamentals,
48-
CheckCategory::Intermediate,
49-
CheckCategory::Advanced,
50-
CheckCategory::Bonus,
47+
CheckCategory::Pipeline,
48+
CheckCategory::QualiteTests,
49+
CheckCategory::Securite,
50+
CheckCategory::Conteneurisation,
51+
CheckCategory::Deploiement,
52+
CheckCategory::BonnesPratiques,
5153
];
5254

5355
let mut categories = Vec::new();

src/models/check.rs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,39 @@ pub enum CheckStatus {
99
Skipped,
1010
}
1111

12-
/// Category grouping checks by difficulty level
12+
/// Category grouping checks by domain
1313
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1414
pub enum CheckCategory {
15-
Fundamentals,
16-
Intermediate,
17-
Advanced,
18-
Bonus,
15+
Pipeline,
16+
QualiteTests,
17+
Securite,
18+
Conteneurisation,
19+
Deploiement,
20+
BonnesPratiques,
1921
}
2022

2123
impl CheckCategory {
2224
pub fn label(&self) -> &'static str {
2325
match self {
24-
Self::Fundamentals => "Fondamentaux",
25-
Self::Intermediate => "Intermédiaire",
26-
Self::Advanced => "Avancé",
27-
Self::Bonus => "Bonus",
26+
Self::Pipeline => "Pipeline CI",
27+
Self::QualiteTests => "Qualité & Tests",
28+
Self::Securite => "Sécurité",
29+
Self::Conteneurisation => "Conteneurisation",
30+
Self::Deploiement => "Déploiement",
31+
Self::BonnesPratiques => "Bonnes Pratiques",
2832
}
2933
}
3034

3135
pub fn icon(&self) -> &'static str {
3236
match self {
33-
Self::Fundamentals => "🟢",
34-
Self::Intermediate => "🔵",
35-
Self::Advanced => "🟡",
36-
Self::Bonus => "⭐",
37+
Self::Pipeline => "🔄",
38+
Self::QualiteTests => "🧪",
39+
Self::Securite => "🔒",
40+
Self::Conteneurisation => "🐳",
41+
Self::Deploiement => "🚀",
42+
Self::BonnesPratiques => "📋",
3743
}
3844
}
39-
4045
}
4146

4247
/// Definition of a check to perform

0 commit comments

Comments
 (0)