Repository navigation
Conversation
26a371b to
6bb502c
Compare
0860d50 to
a546036
Compare
|
Réouverte : couverture des familles restantes pour #1889 — le fermeture précédente était un tri, pas un rejet du travail. |
|
Réouverte : famille requise pour #1889. Branche recréée depuis le SHA d'origine (l'ancienne ref avait été supprimée). |
f6fef1e to
03b632b
Compare
Aggregates plugin health from the terminus health services of each plugin module (ArgoCD/Gitlab/Harbor/Keycloak/Nexus/Sonarqube/Vault), gated by ConditionalModule.registerWhen like the healthz module (Keycloak always on). No dependency on @cpn-console/*-plugin packages or the hooks services registry, both scheduled for removal. Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I2bd222e76a19ded2c0fabcc5a69a31c86a6a6964
03b632b to
121da4a
Compare
cb741bd to
c2033d0
Compare
| @@ -0,0 +1,28 @@ | |||
| import type { ServiceMonitorService } from './service-monitor.service' | |||
There was a problem hiding this comment.
🔴 bug: DI casse au boot : import type { ServiceMonitorService } efface le type de design:paramtypes — Nest ne résout pas le param service. Ajouter @Inject(ServiceMonitorService) (cf log.controller.ts / system-config.controller.ts).
| const probes: Array<[string, (() => Promise<unknown>) | undefined]> = [ | ||
| ['argocd', argocd && (() => argocd.check())], | ||
| ['gitlab', gitlab && (() => gitlab.check())], | ||
| ['harbor', harbor && (() => harbor.check())], |
There was a problem hiding this comment.
🔴 bug: Drift name : le legacy (services.getStatus() dans packages/hooks/src/services.ts) renvoie serviceInfos.title (« Keycloak », « ArgoCD », « Harbor », « SonarQube »…), pas la clé lowercase ; le front affiche service.name en tooltip et data-testid (ServicesHealth.vue L86-88). Mapper les sondes vers les titres legacy.
| const up = detail.status === 'up' | ||
| return [{ | ||
| name, | ||
| status: up ? 'OK' : 'En échec', |
There was a problem hiding this comment.
🟡 risk: « Dégradé » et « Inconnu » inatteignables alors que l'interface les déclare — les monitors legacy retournent WARNING (dégradation partielle gitlab/harbor/nexus/sonarqube) et UNKNOW (erreur réseau), et le front bannit sur ces deux statuts. Distinguer via httpStatus (5xx → « Dégradé », fetch KO → « Inconnu »).
| return this.collect() | ||
| } | ||
|
|
||
| onModuleInit(): void { |
There was a problem hiding this comment.
🟡 risk: Drift refresh : le legacy met en cache lastStatus et Monitor.refresh() réarme un setInterval (packages/shared/src/utils/plugins.ts) ; ici les 3 endpoints sont identiques (= collect() live à chaque GET), interval: INTERVAL_MS cosmétique, onModuleInit jette le résultat. Cacher le dernier statut + scheduler, sinon retirer onModuleInit et l'interval factice.
| status: up ? 'OK' : 'En échec', | ||
| interval: INTERVAL_MS, | ||
| lastUpdateTimestamp: timestamp, | ||
| message: up ? 'OK' : detail.message ?? 'Service en erreur', |
There was a problem hiding this comment.
🟡 risk: cause absent sur la branche down (5xx / indicator.down) : le legacy pose cause sur les erreurs et /complete-services l'expose aux admins (contrat cause: z.any().optional()). Ajouter cause: detail.message sur le retour down.
| argocd.check.mockResolvedValue({ argocd: { status: 'up', httpStatus: 200 } }) | ||
| const keycloak = mockDeep<KeycloakHealthService>() | ||
| keycloak.check.mockResolvedValue({ keycloak: { status: 'down', httpStatus: 500 } }) | ||
| const service = new ServiceMonitorService(keycloak, argocd, undefined, undefined, undefined, undefined, undefined) |
There was a problem hiding this comment.
🔵 nit: 7 positionnels undefined dans new ServiceMonitorService(...) (aussi L27, L37, L51) : un réordonnancement du constructeur passe inaperçu. Objet d'options ou builder de fixtures.
…down Co-authored-by: Automata <automata@shikanime.studio>
|
shikanime
left a comment
There was a problem hiding this comment.
Revue rapide : l'agrégation de probes est propre (ConditionalModule + probes optionnels). Un point de scope hors migration, détaillé inline.
|
🟠 Important : la suppression des 7 deps |
|
Scindée en deux PR empilées :
|
|
🤖 Hey ! A preview of the application is available at : https://console-pr-2488.dso.cpin-hp.numerique-interieur.fr Please be patient, deployment may take a few minutes. |

1 New Issue
0 Fixed Issues
0 Accepted Issues
Issues liées
Refs #1889
Quel est le comportement actuel ?
Les routes
GET /api/v1/health-services,GET /api/v1/complete-servicesetGET /api/v1/refresh-servicessont servies par l'ancienne application Fastifyapps/server, via le registreservicesde@cpn-console/hooks.Quel est le nouveau comportement ?
Migration du module
service-monitorversapps/server-nestjs:ServiceMonitorController: routesGET /health-services,GET /complete-services(adminListSystem),GET /refresh-services(adminManageSystem).ServiceMonitorService: agrège les services de santé terminus de chaque module plugin (ArgoCDHealthService,GitlabHealthService,RegistryHealthService,KeycloakHealthService,NexusHealthService,SonarqubeHealthService,VaultHealthService). Aucune dépendance aux paquets@cpn-console/*-pluginni au registreservicesde@cpn-console/hooks, tous deux appelés à être supprimés.PluginModuleetHealthzModule:ConditionalModule.registerWhensur les variablesUSE_*, Keycloak toujours actif ; les sondes sont exécutées à l'initialisation du module.apps/nginx-strangler) :/api/v1/health-services,/complete-services,/refresh-servicesroutées versserver-nestjs.Cette PR introduit-elle un breaking change ?
Non.
Autres informations
Parité avec l'ancien serveur : mêmes routes, même schéma de réponse (
ServiceHealthSchema), mêmes permissions admin. Le nom affiché est letitledu plugin (ex.ArgoCD), comme avec le registre hooks.