@roomi-fields/grillhouse 0.47.1 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +116 -0
- package/agents/direct.md +9 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +24 -38
- package/cadre/templates/projet/.github/workflows/machine-vierge.yml +5 -0
- package/cadre/templates/projet/.github/workflows/nuit.yml +14 -2
- package/cadre/templates/projet/CLAUDE.md +31 -10
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/turbo/paquets.json +3 -1
- package/cadre/templates/turbo/sans-paquets.json +3 -1
- package/charte.md +46 -13
- package/dist/temporal/circuit/appel.d.ts +4 -1
- package/dist/temporal/circuit/appel.js +15 -1
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +7 -1
- package/dist/temporal/circuit/client.js +54 -1
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +35 -60
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +2 -1
- package/dist/temporal/circuit/contrat.js +2 -1
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +9 -2
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +2 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/deroules.d.ts +1 -1
- package/dist/temporal/deroules.js +2 -2
- package/dist/temporal/deroules.js.map +1 -1
- package/dist/temporal/file/activites.d.ts +1 -4
- package/dist/temporal/file/activites.js +13 -14
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +34 -91
- package/dist/temporal/file/contrat.js +33 -5
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.d.ts +1 -9
- package/dist/temporal/file/deroule.js +57 -166
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +26 -1
- package/dist/temporal/installation.js +111 -2
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +5 -10
- package/dist/temporal/nuits/activites.js +9 -57
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/choix.d.ts +15 -0
- package/dist/temporal/nuits/choix.js +20 -0
- package/dist/temporal/nuits/choix.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +11 -16
- package/dist/temporal/nuits/deroule.js +38 -67
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/client.d.ts +9 -11
- package/dist/temporal/places/client.js +11 -19
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +25 -24
- package/dist/temporal/places/contrat.js +5 -7
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +26 -36
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/tickets/activites.js +4 -2
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +2 -1
- package/docs/ARCHITECTURE.md +453 -133
- package/docs/CADRE.md +16 -13
- package/docs/INTERFACE.md +100 -25
- package/hooks/hooks.json +9 -0
- package/hooks/register.tsx +59 -5
- package/package.json +1 -1
- package/scripts/activites.mjs +319 -52
- package/scripts/aiguillage.mjs +5 -1
- package/scripts/attente-a-l-arret.mjs +2 -5
- package/scripts/attente-au-tour.mjs +2 -5
- package/scripts/bilan.mjs +125 -2
- package/scripts/branche-de-nuit.mjs +32 -44
- package/scripts/ci-de-main.mjs +215 -16
- package/scripts/circuit.mjs +275 -189
- package/scripts/circuits-cles.d.mts +3 -3
- package/scripts/circuits-cles.mjs +6 -5
- package/scripts/coeurs-dedies.mjs +4 -4
- package/scripts/commandes-composees.mjs +12 -5
- package/scripts/composition-des-langages.mjs +2 -0
- package/scripts/crochets.mjs +2 -2
- package/scripts/dette.d.ts +2 -1
- package/scripts/dette.mjs +49 -6
- package/scripts/direct.mjs +343 -0
- package/scripts/droits.mjs +19 -0
- package/scripts/effets.mjs +6 -5
- package/scripts/engendres.mjs +2 -1
- package/scripts/enveloppe/enveloppe.mjs +127 -18
- package/scripts/enveloppe/lancer.sh +14 -3
- package/scripts/enveloppe/paquets-du-plan.mjs +9 -0
- package/scripts/enveloppe/travail-de-la-copie.mjs +121 -21
- package/scripts/etapes.mjs +14 -4
- package/scripts/etat-du-depot.mjs +23 -0
- package/scripts/faits-du-circuit.mjs +24 -34
- package/scripts/fermeture-de-la-machine.d.mts +27 -0
- package/scripts/fermeture-de-la-machine.mjs +98 -0
- package/scripts/fichiers-nommes.mjs +27 -1
- package/scripts/file-des-tickets.d.mts +18 -1
- package/scripts/file-des-tickets.mjs +63 -15
- package/scripts/greffons.mjs +1 -1
- package/scripts/grillhouse-maj.mjs +13 -25
- package/scripts/groupe-cles.d.mts +6 -0
- package/scripts/groupe-cles.mjs +29 -1
- package/scripts/integration/file.mjs +162 -48
- package/scripts/integration/integrer.mjs +2 -0
- package/scripts/jointure.d.ts +22 -3
- package/scripts/journal-des-etats.d.mts +16 -0
- package/scripts/journal-des-etats.mjs +44 -2
- package/scripts/journal.mjs +3 -0
- package/scripts/langages/c/commandes.mjs +5 -5
- package/scripts/langages/c/composants.mjs +13 -5
- package/scripts/langages/c/index.mjs +2 -0
- package/scripts/langages/c/squelette.mjs +1 -1
- package/scripts/langages/cargo/commandes.mjs +5 -6
- package/scripts/langages/cargo/index.mjs +2 -0
- package/scripts/langages/python/commandes.mjs +5 -5
- package/scripts/langages/python/composants.mjs +10 -2
- package/scripts/langages/python/index.mjs +2 -0
- package/scripts/langages/typescript/composants.mjs +10 -3
- package/scripts/langages/typescript/construire.mjs +2 -0
- package/scripts/langages/typescript/exemples.mjs +33 -1
- package/scripts/langages/typescript/index.mjs +22 -0
- package/scripts/langages/typescript/migrations/0.49.0-tests-equipes.mjs +32 -0
- package/scripts/langages/typescript/module-absent.mjs +24 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +152 -32
- package/scripts/langages/typescript/tests-du-poste.mjs +65 -23
- package/scripts/langages/typescript/titres-de-tests.mjs +11 -7
- package/scripts/langages/typescript/turbo-des-paquets.mjs +40 -5
- package/scripts/langages/typescript/verifier.mjs +3 -5
- package/scripts/langages/typescript/verrou-des-dependances.mjs +161 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +57 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +3 -1
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +11 -5
- package/scripts/langages/typescript/vitest.nuit.config.mjs +53 -5
- package/scripts/langages.mjs +25 -3
- package/scripts/machine.mjs +103 -0
- package/scripts/matieres-cles.mjs +17 -0
- package/scripts/matieres-lues.mjs +104 -0
- package/scripts/mesure/base-de-passe.mjs +2 -1
- package/scripts/migrations/0.48.0-ci-declenchee-par-la-file.mjs +32 -0
- package/scripts/migrations/0.48.0-poussee-retiree.mjs +31 -0
- package/scripts/migrations/0.49.0-reservation-de-trois-coeurs.mjs +30 -0
- package/scripts/migrations.mjs +6 -0
- package/scripts/nuit.sh +113 -46
- package/scripts/paquet.mjs +16 -5
- package/scripts/paquets.d.ts +4 -0
- package/scripts/paquets.mjs +57 -0
- package/scripts/passe-de-la-machine.mjs +13 -14
- package/scripts/places-de-la-machine.mjs +120 -44
- package/scripts/places-du-serveur.mjs +29 -8
- package/scripts/plafond-de-la-machine.d.mts +7 -13
- package/scripts/plafond-de-la-machine.mjs +19 -35
- package/scripts/poussee-retiree.mjs +18 -0
- package/scripts/prefixe-des-tickets.mjs +1 -1
- package/scripts/references-changees.mjs +159 -0
- package/scripts/registre.d.mts +2 -2
- package/scripts/regles-des-places.d.mts +20 -12
- package/scripts/regles-des-places.mjs +27 -30
- package/scripts/repli-de-la-nuit.mjs +112 -0
- package/scripts/reponses-du-circuit.d.mts +4 -2
- package/scripts/reponses-du-circuit.mjs +44 -9
- package/scripts/reprise.mjs +27 -8
- package/scripts/resultats.mjs +61 -9
- package/scripts/seances.mjs +258 -40
- package/scripts/services-du-noyau.mjs +3 -0
- package/scripts/sous-commandes.mjs +37 -7
- package/scripts/superviseur.mjs +241 -88
- package/scripts/tableau.mjs +327 -131
- package/scripts/taches-du-graphe.mjs +84 -4
- package/scripts/ticket.mjs +345 -0
- package/scripts/transitions.d.mts +52 -0
- package/scripts/transitions.mjs +194 -16
- package/scripts/un-commit-par-ticket.mjs +4 -3
- package/scripts/verdict-de-la-nuit.mjs +47 -20
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrous/ecriture-hors-enveloppe.mjs +86 -0
- package/scripts/verrous/verrou.mjs +17 -1
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/direct/SKILL.md +57 -0
- package/skills/explorateur/SKILL.md +10 -6
- package/skills/pitmaster/SKILL.md +37 -14
- package/skills/pitmaster/references/consigne-agent.md +7 -1
- package/skills/relecteur/SKILL.md +11 -1
- package/skills/testwriter/SKILL.md +10 -0
- package/scripts/poussee-cles.mjs +0 -46
- package/scripts/ticket.sh +0 -25
|
@@ -99,6 +99,7 @@ import { langageDe } from '../langages.mjs';
|
|
|
99
99
|
import { prefixe } from '../prefixe-des-tickets.mjs';
|
|
100
100
|
import { commitsDelivering, gitLog } from '../un-commit-par-ticket.mjs';
|
|
101
101
|
import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
|
|
102
|
+
import { matieresDeclareesDe } from '../matieres-cles.mjs';
|
|
102
103
|
import { avecLesOutils, empreintesDe, outilsDe } from '../outils-cles.mjs';
|
|
103
104
|
import { lacherVerrou, prendreVerrou } from '../verrou-de-fichier.mjs';
|
|
104
105
|
import { ouvrirCopie, RETIRER_COPIE } from './rejeu.mjs';
|
|
@@ -382,6 +383,7 @@ function main(argv) {
|
|
|
382
383
|
outils = outilsDe(racine);
|
|
383
384
|
empreintes = empreintesDe(racine);
|
|
384
385
|
donnees = donneesDe(racine);
|
|
386
|
+
matieresDeclareesDe(racine);
|
|
385
387
|
} catch (e) {
|
|
386
388
|
return refuser(`Une clé grillhouse du package.json est refusée :\n${e.message}`);
|
|
387
389
|
}
|
package/scripts/jointure.d.ts
CHANGED
|
@@ -250,6 +250,11 @@ export interface Composition {
|
|
|
250
250
|
* whatever the task that bears it — the build task, or the test task with no report
|
|
251
251
|
* (grillhouse-lv9). Every module answers it; a language with no compilation step answers false. */
|
|
252
252
|
echecDeCompilation(texte: string): boolean;
|
|
253
|
+
/** The absolute path of the module the load failure `message` of the test file `fichier` names
|
|
254
|
+
* as absent, null when it names none: the proof of the red reads a test that imports a module
|
|
255
|
+
* the ticket creates as red, as a test target that does not compile. A language whose compiler
|
|
256
|
+
* bears it (`echecDeCompilation`) answers null. */
|
|
257
|
+
moduleAbsent(message: string, fichier: string): string | null;
|
|
253
258
|
estUnTest(chemin: string, racine: string): ClasseDeTest;
|
|
254
259
|
/** Whether the test file `chemin` (from `racine`) is out of the day, one that only the night
|
|
255
260
|
* plays (a night test, a time budget bench, a time witness), by the module's own definitions;
|
|
@@ -481,7 +486,6 @@ export function surUnePart(
|
|
|
481
486
|
o?: {
|
|
482
487
|
env?: NodeJS.ProcessEnv;
|
|
483
488
|
racine?: string;
|
|
484
|
-
entiere?: boolean;
|
|
485
489
|
mesure?: boolean;
|
|
486
490
|
dire?: (l: string) => void;
|
|
487
491
|
}
|
|
@@ -518,7 +522,8 @@ export function nomDuPaquet(racine: string, dossier: string): string | null;
|
|
|
518
522
|
/** Runs the tasks `taches` of the packages `noms` (all when empty) with the task runner `outil`,
|
|
519
523
|
* each task whose dependencies succeed played to its end: the runner's exit code. `tests` is the
|
|
520
524
|
* content of the variable `TESTS_CIBLES` of the run; the variable of `env` never passes on. A
|
|
521
|
-
* red run names, through `dire`, each task whose code is not 0.
|
|
525
|
+
* red run names, through `dire`, each task whose code is not 0. `coteACote` bounds the tasks played
|
|
526
|
+
* side by side (`--concurrency`). */
|
|
522
527
|
export function lancerLesTaches(o: {
|
|
523
528
|
outil: string;
|
|
524
529
|
racine: string;
|
|
@@ -527,7 +532,15 @@ export function lancerLesTaches(o: {
|
|
|
527
532
|
tests?: { arguments: string[]; rejouer?: string };
|
|
528
533
|
env?: NodeJS.ProcessEnv;
|
|
529
534
|
dire?: (ligne: string) => void;
|
|
535
|
+
coteACote?: number;
|
|
530
536
|
}): number;
|
|
537
|
+
/** The tasks a run of the graph plays side by side on `coeurs` cores (the machine's by default):
|
|
538
|
+
* half of them, one at least; the bound `--concurrency` of the pass of the verification and of the
|
|
539
|
+
* build the guards wait for. */
|
|
540
|
+
export function tachesCoteACote(coeurs?: number): number;
|
|
541
|
+
/** The guard scripts of the root, and their tasks of the graph, in the order they play: the frame's
|
|
542
|
+
* controls, then the project's own guards. */
|
|
543
|
+
export const SCRIPTS_DE_GARDES: string[];
|
|
531
544
|
/** A task of the summary of the task runner, or one a module wrote: `code` null for a task that did not run. */
|
|
532
545
|
export interface TacheDuResume {
|
|
533
546
|
tache: string;
|
|
@@ -582,12 +595,18 @@ export function tracesDuPlan(
|
|
|
582
595
|
): string[];
|
|
583
596
|
/** The command `construire --echec <fichier> <plan>` of a module, run from the root of the copy:
|
|
584
597
|
* builds the plan and its providers with the task runner `outil`, `run build --filter=<paquet>…`
|
|
585
|
-
* (the whole copy for a plan with a path that is no package); its exit code.
|
|
598
|
+
* (the whole copy for a plan with a path that is no package); its exit code. `construire --gardes`
|
|
599
|
+
* plays what the guard tasks of the root wait for in the graph, read in the runner's plan of them. */
|
|
586
600
|
export function construireDepuisLesArguments(
|
|
587
601
|
outil: string,
|
|
588
602
|
args: string[],
|
|
589
603
|
racine?: string
|
|
590
604
|
): number;
|
|
605
|
+
/** Whether the arguments of a command `construire` ask for a build of the graph, the core's one
|
|
606
|
+
* for every language (`--echec <fichier> <plan>`, the launcher's; `--gardes`, what the guard tasks
|
|
607
|
+
* of the root wait for, which the checks of a plan play before its guards), and not for the build
|
|
608
|
+
* of one package. */
|
|
609
|
+
export function constructionDuGraphe(args: string[]): boolean;
|
|
591
610
|
/** What `lire` returns, read once under `cle` while the core holds a scope of readings done once
|
|
592
611
|
* (a sweep that asks many questions of a tree that does not move), at each call otherwise
|
|
593
612
|
* (scripts/lecture-unique.mjs). */
|
|
@@ -9,6 +9,17 @@ export interface LigneDuJournal {
|
|
|
9
9
|
boucle: number | null;
|
|
10
10
|
place: string | null;
|
|
11
11
|
raison: string;
|
|
12
|
+
/** The reservation of a place taken or given back. */
|
|
13
|
+
reservation?: Reservation;
|
|
14
|
+
/** The circuit or project a queued ticket waits for (a line `file` `attente`). */
|
|
15
|
+
autre?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** What a place reserves: cores, memory in GB, and who (ticket and role, or pass). */
|
|
19
|
+
export interface Reservation {
|
|
20
|
+
coeurs: number;
|
|
21
|
+
memoireGo: number;
|
|
22
|
+
qui: string;
|
|
12
23
|
}
|
|
13
24
|
|
|
14
25
|
/** A trace to write: a line, `ts` set when it already has its date. */
|
|
@@ -29,7 +40,12 @@ export function traceDesPlaces(e: {
|
|
|
29
40
|
ticket?: string | null;
|
|
30
41
|
place?: string | null;
|
|
31
42
|
raison?: string;
|
|
43
|
+
reservation?: Reservation;
|
|
32
44
|
}): Trace;
|
|
45
|
+
export function reservationsOuvertes(
|
|
46
|
+
lignes: LigneDuJournal[],
|
|
47
|
+
ts: string
|
|
48
|
+
): ({ place: string } & Reservation)[];
|
|
33
49
|
export function lireLeJournal(
|
|
34
50
|
racine: string,
|
|
35
51
|
plage?: { depuis?: string; jusquA?: string; ticket?: string }
|
|
@@ -82,6 +82,10 @@ function ligneEntiere(trace, ts) {
|
|
|
82
82
|
boucle: champ(trace.boucle),
|
|
83
83
|
place: champ(trace.place),
|
|
84
84
|
raison: trace.raison ?? '',
|
|
85
|
+
// The reservation of a place (`{ coeurs, memoireGo, qui }`) and the circuit a queued ticket
|
|
86
|
+
// waits for (`autre`) are written only when the trace carries them.
|
|
87
|
+
...(trace.reservation ? { reservation: trace.reservation } : {}),
|
|
88
|
+
...(trace.autre ? { autre: trace.autre } : {}),
|
|
85
89
|
};
|
|
86
90
|
let raison = Array.from(String(ligne.raison));
|
|
87
91
|
let texte = JSON.stringify(ligne);
|
|
@@ -133,8 +137,46 @@ export function traceDeLaFile({ ticket, evenement }) {
|
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
/** The trace of a place taken (`prise`), given back (`rendue`) or waited for (`attente`). */
|
|
136
|
-
export function traceDesPlaces({
|
|
137
|
-
|
|
140
|
+
export function traceDesPlaces({
|
|
141
|
+
evenement,
|
|
142
|
+
ticket = null,
|
|
143
|
+
place = null,
|
|
144
|
+
raison = '',
|
|
145
|
+
reservation = undefined,
|
|
146
|
+
}) {
|
|
147
|
+
return {
|
|
148
|
+
genre: 'places',
|
|
149
|
+
ticket,
|
|
150
|
+
etape: evenement,
|
|
151
|
+
boucle: null,
|
|
152
|
+
place,
|
|
153
|
+
raison,
|
|
154
|
+
...(reservation ? { reservation } : {}),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The reservations open at the instant <ts> from the lines of the journal alone: each place
|
|
160
|
+
* `prise` with a reservation and not yet `rendue`, in the order of the takings.
|
|
161
|
+
* @param {object[]} lignes
|
|
162
|
+
* @param {string} ts
|
|
163
|
+
* @returns {{ place: string, coeurs: number, memoireGo: number, qui: string }[]}
|
|
164
|
+
*/
|
|
165
|
+
export function reservationsOuvertes(lignes, ts) {
|
|
166
|
+
const t = instant(ts);
|
|
167
|
+
const ouvertes = new Map();
|
|
168
|
+
const triees = lignes
|
|
169
|
+
.map((l, i) => ({ l, i, t: instant(l.ts) }))
|
|
170
|
+
.filter(x => x.l.genre === 'places' && x.t <= t)
|
|
171
|
+
.sort((a, b) => a.t - b.t || a.i - b.i);
|
|
172
|
+
for (const { l } of triees) {
|
|
173
|
+
if (l.etape === 'prise' && l.reservation && l.place) {
|
|
174
|
+
ouvertes.set(l.place, { place: l.place, ...l.reservation });
|
|
175
|
+
} else if (l.etape === 'rendue' && l.place) {
|
|
176
|
+
ouvertes.delete(l.place);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return [...ouvertes.values()];
|
|
138
180
|
}
|
|
139
181
|
|
|
140
182
|
const instant = ts => Date.parse(ts);
|
package/scripts/journal.mjs
CHANGED
|
@@ -56,6 +56,9 @@ const ligneDe = l =>
|
|
|
56
56
|
l.etape ?? '-',
|
|
57
57
|
...(l.boucle === null || l.boucle === undefined ? [] : [`boucle ${l.boucle}`]),
|
|
58
58
|
...(l.place ? [`place ${l.place}`] : []),
|
|
59
|
+
...(l.reservation
|
|
60
|
+
? [`${l.reservation.coeurs} cœurs, ${l.reservation.memoireGo} Go, ${l.reservation.qui}`]
|
|
61
|
+
: []),
|
|
59
62
|
...(l.raison ? [`— ${l.raison}`] : []),
|
|
60
63
|
].join(' ');
|
|
61
64
|
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
avecLaPasse,
|
|
47
47
|
cheminsDeLaTache,
|
|
48
48
|
construireDepuisLesArguments,
|
|
49
|
+
constructionDuGraphe,
|
|
49
50
|
GRAPHE_JOUE,
|
|
50
51
|
joueCeQuiNeSeDivisePas,
|
|
51
52
|
lancerLesTaches,
|
|
@@ -54,6 +55,7 @@ import {
|
|
|
54
55
|
ouvrirBase,
|
|
55
56
|
retirerALInterruption,
|
|
56
57
|
SCRIPT_DES_TESTS,
|
|
58
|
+
SCRIPTS_DE_GARDES,
|
|
57
59
|
surUnePart,
|
|
58
60
|
testsCibles,
|
|
59
61
|
travailleursDeLaSeance,
|
|
@@ -411,9 +413,6 @@ function verifier(racine, args, env) {
|
|
|
411
413
|
return code === 0 ? 0 : 1;
|
|
412
414
|
}
|
|
413
415
|
|
|
414
|
-
// The scripts of guards of the project, in the order they play: the frame's, then its own.
|
|
415
|
-
const SCRIPTS_DE_GARDES = ['grillhouse:gardes', 'gardes'];
|
|
416
|
-
|
|
417
416
|
// The pass of `verifier --gardes` in <racine>: each script of SCRIPTS_DE_GARDES the root
|
|
418
417
|
// package.json holds, a task of the root; no test.
|
|
419
418
|
function gardes(racine, p) {
|
|
@@ -486,8 +485,9 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
486
485
|
}
|
|
487
486
|
}
|
|
488
487
|
// The launcher's `construire` (`--echec <fichier> <plan>`) builds the copy for a session, the
|
|
489
|
-
// plan and its providers, as every language's
|
|
490
|
-
|
|
488
|
+
// plan and its providers, as every language's; `construire --gardes`, what the guard tasks wait
|
|
489
|
+
// for.
|
|
490
|
+
if (nom === 'construire' && constructionDuGraphe(args)) {
|
|
491
491
|
return construireDepuisLesArguments(OUTIL, args, racine);
|
|
492
492
|
}
|
|
493
493
|
if (nom === 'typer' || nom === 'construire') {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// `lecteurs`, `estUnTest`, `manifestes`, `entreesDeLIndex`).
|
|
4
4
|
//
|
|
5
5
|
// - A component is a folder whose CMakeLists.txt calls `project(<nom>`, found under the root, the
|
|
6
|
-
// folders whose name begins with a dot (`.build-cmake` included) and those of LAISSES left out
|
|
6
|
+
// folders whose name begins with a dot (`.build-cmake` included) and those of LAISSES left out,
|
|
7
|
+
// and a CMakeLists.txt git ignores (the local clone of another repository) left out too:
|
|
7
8
|
// its folder, its name and its package the name `project()` gives. The CMakeLists.txt of
|
|
8
9
|
// `tests/`, which calls no `project(`, is the package's matter, never a component. `project(` is
|
|
9
10
|
// read in any case, after the comments (`#`) are cut, a space before the parenthesis allowed,
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
// `docs/INTERFACE.md`, and the root's, as the module python's.
|
|
23
24
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
24
25
|
import path from 'node:path';
|
|
26
|
+
import { ignoresParGit } from '../../paquets.mjs';
|
|
25
27
|
import { luUneFois } from '../../services-du-noyau.mjs';
|
|
26
28
|
|
|
27
29
|
export const MANIFESTE = 'CMakeLists.txt';
|
|
@@ -63,11 +65,17 @@ function dossiersAvecProjet(dossier) {
|
|
|
63
65
|
/** The components of the project at <racine>, sorted by folder; read once in a scope of the core
|
|
64
66
|
* (`luUneFois`): a sweep asks it of every file of a folder. */
|
|
65
67
|
export function composants(racine) {
|
|
66
|
-
return luUneFois(`c composants ${path.resolve(racine)}`, () =>
|
|
67
|
-
dossiersAvecProjet(racine)
|
|
68
|
+
return luUneFois(`c composants ${path.resolve(racine)}`, () => {
|
|
69
|
+
const trouves = dossiersAvecProjet(racine);
|
|
70
|
+
const ignores = ignoresParGit(
|
|
71
|
+
racine,
|
|
72
|
+
trouves.map(t => path.join(t.dossier, MANIFESTE))
|
|
73
|
+
);
|
|
74
|
+
return trouves
|
|
75
|
+
.filter(t => !ignores.has(path.join(t.dossier, MANIFESTE)))
|
|
68
76
|
.sort((a, b) => (a.dossier < b.dossier ? -1 : a.dossier > b.dossier ? 1 : 0))
|
|
69
|
-
.map(({ dossier, nom }) => ({ dossier, nom, paquet: nom }))
|
|
70
|
-
);
|
|
77
|
+
.map(({ dossier, nom }) => ({ dossier, nom, paquet: nom }));
|
|
78
|
+
});
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
/** The component of <liste> that holds <fichier> (absolute, or from <racine>), the longest folder. */
|
|
@@ -97,6 +97,8 @@ export default {
|
|
|
97
97
|
commandes,
|
|
98
98
|
verdict,
|
|
99
99
|
echecDeCompilation,
|
|
100
|
+
// A test that includes an absent header does not compile: `echecDeCompilation` bears it.
|
|
101
|
+
moduleAbsent: () => null,
|
|
100
102
|
estUnTest,
|
|
101
103
|
// No night test in C yet.
|
|
102
104
|
horsDuJour: () => false,
|
|
@@ -50,7 +50,7 @@ export function squelette(_racine, { chemin }) {
|
|
|
50
50
|
fichiers: {
|
|
51
51
|
[`${chemin}/CMakeLists.txt`]: cmake,
|
|
52
52
|
[`${chemin}/src/${fichier}.h`]: `#ifndef ${garde}\n#define ${garde}\n\n#endif\n`,
|
|
53
|
-
[`${chemin}/src/${fichier}.c`]: `#include "${fichier}.h"\n\n/* A translation unit holds one declaration (ISO C): the first function
|
|
53
|
+
[`${chemin}/src/${fichier}.c`]: `#include "${fichier}.h"\n\n/* A translation unit holds one declaration (ISO C): the package's first function replaces it. */\ntypedef int ${fichier}_sans_code;\n`,
|
|
54
54
|
[`${chemin}/tests/CMakeLists.txt`]: tests,
|
|
55
55
|
[`${chemin}/.clang-format`]: 'BasedOnStyle: LLVM\nColumnLimit: 100\n',
|
|
56
56
|
[`${chemin}/.clang-tidy`]: "Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,misc-*'\nWarningsAsErrors: '*'\n",
|
|
@@ -141,6 +141,7 @@ import {
|
|
|
141
141
|
avecLaPasse,
|
|
142
142
|
cheminsDeLaTache,
|
|
143
143
|
construireDepuisLesArguments,
|
|
144
|
+
constructionDuGraphe,
|
|
144
145
|
ecrirePression,
|
|
145
146
|
GRAPHE_JOUE,
|
|
146
147
|
joueCeQuiNeSeDivisePas,
|
|
@@ -151,6 +152,7 @@ import {
|
|
|
151
152
|
ouvrirBase,
|
|
152
153
|
retirerALInterruption,
|
|
153
154
|
SCRIPT_DES_TESTS,
|
|
155
|
+
SCRIPTS_DE_GARDES,
|
|
154
156
|
SEUIL_PRESSION,
|
|
155
157
|
testsCibles,
|
|
156
158
|
travailleursDeLaSeance,
|
|
@@ -740,10 +742,6 @@ function verifier(racine, args, env) {
|
|
|
740
742
|
return verdict;
|
|
741
743
|
}
|
|
742
744
|
|
|
743
|
-
// The scripts of guards of the project, in the order they play, as the module typescript's
|
|
744
|
-
// `--gardes` plays its tasks: the frame's, then the project's own.
|
|
745
|
-
const SCRIPTS_DE_GARDES = ['grillhouse:gardes', 'gardes'];
|
|
746
|
-
|
|
747
745
|
// The pass of `verifier --gardes` in <racine>, the run <p>: each script of SCRIPTS_DE_GARDES the
|
|
748
746
|
// root package.json holds, a task of the root, whatever the verdict of the one before; no test.
|
|
749
747
|
function gardes(racine, p) {
|
|
@@ -843,8 +841,9 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
843
841
|
// `cargo check -p`), as Turborepo's task of one package; `typer` alone checks the workspace.
|
|
844
842
|
let crate = null;
|
|
845
843
|
// The launcher's `construire` (`--echec <fichier> <plan>`, scripts/enveloppe/lancer.sh) builds
|
|
846
|
-
// the copy for a session, the plan and its providers, as every language's
|
|
847
|
-
|
|
844
|
+
// the copy for a session, the plan and its providers, as every language's; `construire --gardes`,
|
|
845
|
+
// what the guard tasks wait for.
|
|
846
|
+
if (nom === 'construire' && constructionDuGraphe(args)) {
|
|
848
847
|
return construireDepuisLesArguments(OUTIL, args, racine);
|
|
849
848
|
}
|
|
850
849
|
if (nom === 'construire' || (nom === 'typer' && args.length)) {
|
|
@@ -139,6 +139,8 @@ export default {
|
|
|
139
139
|
commandes,
|
|
140
140
|
verdict,
|
|
141
141
|
echecDeCompilation,
|
|
142
|
+
// A test that imports an absent module does not compile: `echecDeCompilation` bears it.
|
|
143
|
+
moduleAbsent: () => null,
|
|
142
144
|
estUnTest,
|
|
143
145
|
horsDuJour: fichierHorsDuJour,
|
|
144
146
|
manifestes,
|
|
@@ -92,6 +92,7 @@ import {
|
|
|
92
92
|
cacheDeCompilation,
|
|
93
93
|
cheminsDeLaTache,
|
|
94
94
|
construireDepuisLesArguments,
|
|
95
|
+
constructionDuGraphe,
|
|
95
96
|
GRAPHE_JOUE,
|
|
96
97
|
joueCeQuiNeSeDivisePas,
|
|
97
98
|
lancerLesTaches,
|
|
@@ -100,6 +101,7 @@ import {
|
|
|
100
101
|
ouvrirBase,
|
|
101
102
|
retirerALInterruption,
|
|
102
103
|
SCRIPT_DES_TESTS,
|
|
104
|
+
SCRIPTS_DE_GARDES,
|
|
103
105
|
testsCibles,
|
|
104
106
|
travailleursDeLaSeance,
|
|
105
107
|
} from '../../services-du-noyau.mjs';
|
|
@@ -442,9 +444,6 @@ const typerLePaquet = (p, c) =>
|
|
|
442
444
|
])
|
|
443
445
|
);
|
|
444
446
|
|
|
445
|
-
// The scripts of guards of the project, in the order they play: the frame's, then its own.
|
|
446
|
-
const SCRIPTS_DE_GARDES = ['grillhouse:gardes', 'gardes'];
|
|
447
|
-
|
|
448
447
|
// The pass of `verifier --gardes` in <racine>: each script of SCRIPTS_DE_GARDES the root
|
|
449
448
|
// package.json holds, a task of the root; no test.
|
|
450
449
|
function gardes(racine, p) {
|
|
@@ -532,8 +531,9 @@ export function lancer(nom, args, { racine = process.cwd(), env = process.env }
|
|
|
532
531
|
}
|
|
533
532
|
}
|
|
534
533
|
// The launcher's `construire` (`--echec <fichier> <plan>`, scripts/enveloppe/lancer.sh) builds
|
|
535
|
-
// the copy for a session, the plan and its providers, as every language's
|
|
536
|
-
|
|
534
|
+
// the copy for a session, the plan and its providers, as every language's; `construire --gardes`,
|
|
535
|
+
// what the guard tasks wait for.
|
|
536
|
+
if (nom === 'construire' && constructionDuGraphe(args)) {
|
|
537
537
|
return construireDepuisLesArguments(OUTIL, args, racine);
|
|
538
538
|
}
|
|
539
539
|
if (nom === 'typer' || nom === 'construire') {
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// `entreesDeLIndex`).
|
|
5
5
|
//
|
|
6
6
|
// - A component is a folder that holds a pyproject.toml, found under the root, the folders whose
|
|
7
|
-
// name begins with a dot and those of LAISSES left out
|
|
7
|
+
// name begins with a dot and those of LAISSES left out, and a pyproject.toml git ignores (the
|
|
8
|
+
// local clone of another repository) left out too: its folder, its name the folder's, its
|
|
8
9
|
// package the `name` of its table `[project]`, null without one. The language of a package is
|
|
9
10
|
// declared in the architecture (decision D2 of grillhouse-1zu); its pyproject.toml, its group
|
|
10
11
|
// `test` and its uv.lock are there because uv asks them.
|
|
@@ -32,6 +33,7 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
|
32
33
|
import { createRequire } from 'node:module';
|
|
33
34
|
import path from 'node:path';
|
|
34
35
|
import { isDeepStrictEqual } from 'node:util';
|
|
36
|
+
import { ignoresParGit } from '../../paquets.mjs';
|
|
35
37
|
import { luUneFois } from '../../services-du-noyau.mjs';
|
|
36
38
|
|
|
37
39
|
const require = createRequire(import.meta.url);
|
|
@@ -83,7 +85,13 @@ export function composants(racine) {
|
|
|
83
85
|
|
|
84
86
|
// The components of `composants`, read at each call.
|
|
85
87
|
function lireLesComposants(racine) {
|
|
86
|
-
|
|
88
|
+
const trouves = dossiersAvecManifeste(racine);
|
|
89
|
+
const ignores = ignoresParGit(
|
|
90
|
+
racine,
|
|
91
|
+
trouves.map(d => path.join(d, MANIFESTE))
|
|
92
|
+
);
|
|
93
|
+
return trouves
|
|
94
|
+
.filter(d => !ignores.has(path.join(d, MANIFESTE)))
|
|
87
95
|
.sort()
|
|
88
96
|
.map(dossier => ({
|
|
89
97
|
dossier,
|
|
@@ -110,6 +110,8 @@ export default {
|
|
|
110
110
|
verdict,
|
|
111
111
|
// Python has no compilation step: no test task bears a compilation failure (jointure.d.ts).
|
|
112
112
|
echecDeCompilation: () => false,
|
|
113
|
+
// No load failure of pytest is read as an absent module.
|
|
114
|
+
moduleAbsent: () => null,
|
|
113
115
|
estUnTest,
|
|
114
116
|
// A night test, `*_nuit_test.py` (`estDeNuit`).
|
|
115
117
|
horsDuJour: chemin => estDeNuit(path.basename(chemin)),
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
// file) both import.
|
|
6
6
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import { horsCadre } from '../../paquets.mjs';
|
|
8
|
+
import { horsCadre, ignoresParGit } from '../../paquets.mjs';
|
|
9
9
|
|
|
10
|
-
// Every directory under `packages/` and `src/` of the repository at <racine>: [{ nom, dir }]
|
|
10
|
+
// Every directory under `packages/` and `src/` of the repository at <racine>: [{ nom, dir }], a
|
|
11
|
+
// directory git ignores (the local clone of another repository) left out: its package.json when
|
|
12
|
+
// it holds one, the directory itself otherwise.
|
|
11
13
|
function tousDossiers(racine) {
|
|
12
14
|
const found = [];
|
|
13
15
|
for (const parent of ['packages', 'src']) {
|
|
@@ -21,7 +23,12 @@ function tousDossiers(racine) {
|
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
const lu = d => {
|
|
27
|
+
const manifeste = path.join(d.dir, 'package.json');
|
|
28
|
+
return existsSync(manifeste) ? manifeste : d.dir;
|
|
29
|
+
};
|
|
30
|
+
const ignores = ignoresParGit(racine, found.map(lu));
|
|
31
|
+
return found.filter(d => !ignores.has(lu(d)));
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
// The component directories of the repository at <racine>: [{ nom, dir }], each directory under
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// prepared copy, through its mounts: the session finds built what it reads out of its plan.
|
|
5
5
|
//
|
|
6
6
|
// node construire.mjs --echec <fichier> <plan> from the root of the copy
|
|
7
|
+
// node construire.mjs --gardes what the guard tasks wait for, before the
|
|
8
|
+
// guards of the checks of a plan
|
|
7
9
|
//
|
|
8
10
|
// - The launcher is the core's, one for every language (`construireDepuisLesArguments` of
|
|
9
11
|
// scripts/taches-du-graphe.mjs): the plan and its providers by `turbo run build
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
// interface, and the generated files are written by their own commands (the index of the
|
|
8
8
|
// interfaces, the turbo.json of the packages): `aJour`; the same with each generated file out
|
|
9
9
|
// of date: the interface of `a` changed after its index, a fault listed that its code never
|
|
10
|
-
// produces (the check of the interfaces against the code), the turbo.json of `b` stale
|
|
10
|
+
// produces (the check of the interfaces against the code), the turbo.json of `b` stale, a
|
|
11
|
+
// dependency of `a` that the lock does not hold:
|
|
11
12
|
// `enRetard`; the same where the code of `b` imports `a` and the
|
|
12
13
|
// code of `c` imports `b`: `lus`; the same with a second commit that changes a file of `a`:
|
|
13
14
|
// `lot`. A directory whose package.json names no package: `vide`. A
|
|
@@ -57,6 +58,29 @@ function depot(dans) {
|
|
|
57
58
|
`# ${nom}\n\n${nom.toUpperCase()} rend un nombre.\n`
|
|
58
59
|
);
|
|
59
60
|
}
|
|
61
|
+
// The lock npm writes for them: the workspaces linked, each entry with its dependencies.
|
|
62
|
+
ecrire(
|
|
63
|
+
'package-lock.json',
|
|
64
|
+
json({
|
|
65
|
+
name: 'e',
|
|
66
|
+
lockfileVersion: 3,
|
|
67
|
+
requires: true,
|
|
68
|
+
packages: {
|
|
69
|
+
'': { name: 'e', workspaces: ['packages/*'] },
|
|
70
|
+
...Object.fromEntries(
|
|
71
|
+
Object.keys(PAQUETS).flatMap(nom => [
|
|
72
|
+
[`node_modules/@e/${nom}`, { resolved: `packages/${nom}`, link: true }],
|
|
73
|
+
[
|
|
74
|
+
`packages/${nom}`,
|
|
75
|
+
Object.fromEntries(
|
|
76
|
+
Object.entries(PAQUETS[nom]).filter(([k]) => k !== 'name' && k !== 'exports')
|
|
77
|
+
),
|
|
78
|
+
],
|
|
79
|
+
])
|
|
80
|
+
),
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
);
|
|
60
84
|
mkdirSync(path.join(racine, 'docs/agents'), { recursive: true });
|
|
61
85
|
node(racine, 'turbo-des-paquets.mjs', '--ecrire');
|
|
62
86
|
node(racine, 'index-interfaces.mjs');
|
|
@@ -125,6 +149,11 @@ export default {
|
|
|
125
149
|
'# a\n\nA rend un autre nombre.\n\n## Les fautes\n\n- `A_ABSENTE` : jamais produite.\n'
|
|
126
150
|
);
|
|
127
151
|
writeFileSync(path.join(enRetard, 'packages/b/turbo.json'), '{}\n');
|
|
152
|
+
// A dependency added to `a` that its lock does not hold.
|
|
153
|
+
writeFileSync(
|
|
154
|
+
path.join(enRetard, 'packages/a/package.json'),
|
|
155
|
+
json({ type: 'module', ...PAQUETS.a, devDependencies: { '@e/m': '*' } })
|
|
156
|
+
);
|
|
128
157
|
// The specifiers are written apart, so that no reading of the package's imports takes a
|
|
129
158
|
// trial's for its own.
|
|
130
159
|
const lus = depot(dans);
|
|
@@ -181,6 +210,7 @@ export default {
|
|
|
181
210
|
'tests-du-poste',
|
|
182
211
|
'titres-de-tests',
|
|
183
212
|
'turbo-des-paquets',
|
|
213
|
+
'verrou-des-dependances',
|
|
184
214
|
],
|
|
185
215
|
invalide: ['tester', 'deployer'],
|
|
186
216
|
attendu: ['deployer : absente'],
|
|
@@ -234,6 +264,7 @@ export default {
|
|
|
234
264
|
"l'index des interfaces : en retard",
|
|
235
265
|
'les turbo.json des paquets : en retard',
|
|
236
266
|
"les rapports d'API : en retard",
|
|
267
|
+
'le verrou des dépendances : en retard',
|
|
237
268
|
],
|
|
238
269
|
},
|
|
239
270
|
gardes: {
|
|
@@ -250,6 +281,7 @@ export default {
|
|
|
250
281
|
'titres-de-tests',
|
|
251
282
|
'chemins-des-tests',
|
|
252
283
|
'resumes',
|
|
284
|
+
'verrou-des-dependances',
|
|
253
285
|
],
|
|
254
286
|
},
|
|
255
287
|
elementsDuLot: {
|
|
@@ -61,6 +61,7 @@ import { garderLesResumes, lireLesResumes, resumesDuLancement } from './resume-d
|
|
|
61
61
|
import { miseAJour } from './mise-a-jour.mjs';
|
|
62
62
|
import { squelette } from './squelette.mjs';
|
|
63
63
|
import { estHorsDuJour } from './vitest-config/cibles.mjs';
|
|
64
|
+
import { moduleAbsent } from './module-absent.mjs';
|
|
64
65
|
import * as configVitest from './migrations/0.23.0-config-vitest.mjs';
|
|
65
66
|
import * as nomsDeclaresInutilises from './migrations/0.24.4-noms-declares-inutilises.mjs';
|
|
66
67
|
import * as lignesMalFormees from './migrations/0.24.6-lignes-mal-formees.mjs';
|
|
@@ -73,6 +74,8 @@ import * as titresNommantUnTicket from './migrations/0.30.0-titres-nommant-un-ti
|
|
|
73
74
|
import * as binaireDeJour from './migrations/0.33.0-binaire-de-jour.mjs';
|
|
74
75
|
import * as testsDuPoste from './migrations/0.33.0-tests-du-poste.mjs';
|
|
75
76
|
import * as cacheDesOutils from './migrations/0.34.1-cache-des-outils.mjs';
|
|
77
|
+
import * as testsEquipes from './migrations/0.49.0-tests-equipes.mjs';
|
|
78
|
+
import { COMMANDE as COMMANDE_DU_VERROU } from './verrou-des-dependances.mjs';
|
|
76
79
|
|
|
77
80
|
// The scripts of this module, beside this file.
|
|
78
81
|
const SCRIPTS = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -96,6 +99,7 @@ const OUTILS = [
|
|
|
96
99
|
'tests-du-poste',
|
|
97
100
|
'titres-de-tests',
|
|
98
101
|
'turbo-des-paquets',
|
|
102
|
+
'verrou-des-dependances',
|
|
99
103
|
];
|
|
100
104
|
|
|
101
105
|
// The component of <liste> that holds <fichier> (absolute, or from <racine>), null for none.
|
|
@@ -271,6 +275,8 @@ export default {
|
|
|
271
275
|
verdict,
|
|
272
276
|
// A build failure is already a red `build` task here; no test task bears a compilation failure.
|
|
273
277
|
echecDeCompilation: () => false,
|
|
278
|
+
// The module a test file imports and Vitest did not find (./module-absent.mjs).
|
|
279
|
+
moduleAbsent,
|
|
274
280
|
estUnTest,
|
|
275
281
|
// A night test, a bench or a time witness (./vitest-config/cibles.mjs, `estHorsDuJour`).
|
|
276
282
|
horsDuJour: (chemin, racine) => estHorsDuJour(path.resolve(racine, chemin)),
|
|
@@ -321,6 +327,20 @@ export default {
|
|
|
321
327
|
'interfaces-contre-code.mjs',
|
|
322
328
|
[]
|
|
323
329
|
),
|
|
330
|
+
// The lock of npm, written in full by npm on the lot applied, without the audit; the guard
|
|
331
|
+
// compares it with the package.json it locks (./verrou-des-dependances.mjs).
|
|
332
|
+
engendre(
|
|
333
|
+
{
|
|
334
|
+
nom: 'le verrou des dépendances',
|
|
335
|
+
commande: COMMANDE_DU_VERROU,
|
|
336
|
+
fichiers: ['package-lock.json'],
|
|
337
|
+
lit: ['package.json', '**/package.json'],
|
|
338
|
+
gardes: ['verrou-des-dependances'],
|
|
339
|
+
entiers: ['package-lock.json'],
|
|
340
|
+
},
|
|
341
|
+
'verrou-des-dependances.mjs',
|
|
342
|
+
[]
|
|
343
|
+
),
|
|
324
344
|
],
|
|
325
345
|
// Loaded at the call: ./index-interfaces.mjs imports the services of the core, which import the
|
|
326
346
|
// join that loads this module.
|
|
@@ -338,6 +358,7 @@ export default {
|
|
|
338
358
|
[ici('titres-de-tests.mjs')],
|
|
339
359
|
[ici('chemins-des-tests.mjs')],
|
|
340
360
|
[ici('resumes.mjs')],
|
|
361
|
+
[ici('verrou-des-dependances.mjs')],
|
|
341
362
|
],
|
|
342
363
|
migrations: [
|
|
343
364
|
configVitest,
|
|
@@ -352,6 +373,7 @@ export default {
|
|
|
352
373
|
binaireDeJour,
|
|
353
374
|
testsDuPoste,
|
|
354
375
|
cacheDesOutils,
|
|
376
|
+
testsEquipes,
|
|
355
377
|
],
|
|
356
378
|
miseAJour: miseAJour(joueDesTests),
|
|
357
379
|
squelette,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// From 0.49.0 the guard of the night tests of the poste (scripts/langages/typescript/tests-du-poste.mjs)
|
|
2
|
+
// asks the tag `@equipee` of a night test that needs the equipment of a machine (the envelope, a
|
|
3
|
+
// Temporal server, sccache, the binaries of the module cargo), and `@poste` stays for what only the
|
|
4
|
+
// poste has (the real bd, systemd, the keyring, the user's session, a session of claude). A project
|
|
5
|
+
// whose night tests need equipment without the tag would turn red at its next pass; the update
|
|
6
|
+
// inscribes them as the project's known debt (scripts/dette.mjs), frozen: the count never rises and
|
|
7
|
+
// a new one is refused.
|
|
8
|
+
//
|
|
9
|
+
// - The migration inscribes the findings of the guard that the debt does not hold yet; the debt
|
|
10
|
+
// already inscribed (the guard's, the other guards') stays.
|
|
11
|
+
// - It rewrites no test of the project: the project tags each one (`// @equipee: <raison>` at its
|
|
12
|
+
// head), and the debt comes down with it.
|
|
13
|
+
// - Replayable without effect: once every finding is inscribed, nothing.
|
|
14
|
+
import { FICHIER, lire, trancher } from '../../../dette.mjs';
|
|
15
|
+
import { GARDE, verifier } from '../tests-du-poste.mjs';
|
|
16
|
+
|
|
17
|
+
export const version = '0.49.0';
|
|
18
|
+
export const nom = 'tests equipes';
|
|
19
|
+
|
|
20
|
+
/** Inscribes the night tests of equipment without the tag that the debt of <projet> lacks. */
|
|
21
|
+
export function migrer(projet) {
|
|
22
|
+
const inscrite = lire(projet)[GARDE] ?? {};
|
|
23
|
+
const constats = verifier(projet);
|
|
24
|
+
const neufs = constats.filter(c => !inscrite[c.fichier]?.[c.regle]);
|
|
25
|
+
if (neufs.length === 0) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
trancher(projet, GARDE, constats, 'inscrire', {});
|
|
29
|
+
return [
|
|
30
|
+
`${FICHIER} : ${neufs.length} test(s) de nuit qui exige(nt) l'équipement d'une machine sans l'étiquette @equipee inscrit(s) dans la dette de ${GARDE}, gelée ; un neuf est refusé, et chacun porte « // @equipee: <raison> » en tête`,
|
|
31
|
+
];
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// The module a test file imports that Vitest did not find, read from the message of its load
|
|
2
|
+
// failure: the path the import names, resolved from the test file. A test written before its code
|
|
3
|
+
// imports the module the ticket creates; that load failure is its red, as a test target that does
|
|
4
|
+
// not compile is in a compiled language (`echecDeCompilation` of cargo and c). An import of a
|
|
5
|
+
// package (a bare name) is no module of the project: null.
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
const DE_VITEST = /Failed to load url (\S+) \(resolved id: [^)]*\)/;
|
|
9
|
+
const DE_NODE = /Cannot find module '([^']+)'/;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The absolute path of the module the load failure <message> of the test file <fichier> names as
|
|
13
|
+
* absent, or null when the message names none or names a package.
|
|
14
|
+
* @param {string} message
|
|
15
|
+
* @param {string} fichier
|
|
16
|
+
* @returns {string | null}
|
|
17
|
+
*/
|
|
18
|
+
export function moduleAbsent(message, fichier) {
|
|
19
|
+
const nomme = (DE_VITEST.exec(message) ?? DE_NODE.exec(message))?.[1];
|
|
20
|
+
if (!nomme || !(nomme.startsWith('.') || path.isAbsolute(nomme))) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return path.resolve(path.dirname(fichier), nomme);
|
|
24
|
+
}
|