@roomi-fields/grillhouse 0.37.1 → 0.38.1
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 +26 -0
- package/charte.md +8 -1
- package/dist/temporal/circuit/activites.js +4 -1
- package/dist/temporal/circuit/activites.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +2 -0
- package/dist/temporal/tickets/activites.js +7 -2
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/docs/ARCHITECTURE.md +7 -2
- package/docs/INTERFACE.md +8 -3
- package/hooks/register.tsx +95 -78
- package/package.json +1 -1
- package/scripts/activites.mjs +54 -13
- package/scripts/circuit.mjs +16 -5
- package/scripts/circuits-cles.d.mts +3 -0
- package/scripts/circuits-cles.mjs +20 -0
- package/scripts/composition-des-langages.mjs +1 -0
- package/scripts/dependances-internes.mjs +9 -2
- package/scripts/donnees-cles.mjs +0 -1
- package/scripts/enveloppe/enveloppe.mjs +1 -1
- package/scripts/file-des-tickets.d.mts +6 -0
- package/scripts/file-des-tickets.mjs +30 -4
- package/scripts/grillhouse-maj.mjs +4 -3
- package/scripts/groupe-cles.mjs +4 -2
- package/scripts/integration/integrer.mjs +13 -6
- package/scripts/jointure.d.ts +9 -0
- package/scripts/langages/cargo/commandes.mjs +11 -3
- package/scripts/langages/cargo/index.mjs +2 -1
- package/scripts/langages/cargo/verdict.mjs +14 -0
- package/scripts/langages/python/index.mjs +2 -0
- package/scripts/langages/typescript/code-mort.mjs +59 -9
- package/scripts/langages/typescript/index.mjs +7 -4
- package/scripts/langages/typescript/vitest-config/base.mjs +3 -0
- package/scripts/langages/typescript/vitest.nuit.config.mjs +1 -0
- package/scripts/ligne-etat/ligne-etat.mjs +20 -4
- package/scripts/nuit.sh +6 -3
- package/scripts/prefixe-des-tickets.mjs +12 -0
- package/scripts/regles-des-places.d.mts +4 -0
- package/scripts/regles-des-places.mjs +11 -2
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/suiveur.mjs +362 -0
- package/scripts/tableau.mjs +100 -73
- package/scripts/ticket.sh +4 -2
- package/scripts/transitions.d.mts +2 -0
- package/scripts/transitions.mjs +38 -4
- package/scripts/un-commit-par-ticket.mjs +21 -24
- package/skills/pitmaster/SKILL.md +9 -0
package/scripts/activites.mjs
CHANGED
|
@@ -1007,7 +1007,13 @@ export function integrer(ctx) {
|
|
|
1007
1007
|
// the copy after a commit (here the ticket is done, so `.travail` goes too — no `--garder-travail`).
|
|
1008
1008
|
// A removal that fails stops under its name `copie-gardee`, the copy kept, and a new resumption
|
|
1009
1009
|
// plays the removal again.
|
|
1010
|
-
|
|
1010
|
+
let commit;
|
|
1011
|
+
try {
|
|
1012
|
+
commit = lotSurMain({ racine: ctx.racine }, ctx.ticket);
|
|
1013
|
+
} catch (e) {
|
|
1014
|
+
// A key `issue-prefix` missing or faulty: refused by the message of `prefixe`, not by `lot-absent`.
|
|
1015
|
+
return finir(`⛔ ${e.message}\n`, { code: 1, nom: 'prefixe' });
|
|
1016
|
+
}
|
|
1011
1017
|
if (commit) {
|
|
1012
1018
|
let retrait = { status: 0, stderr: '' };
|
|
1013
1019
|
if (existsSync(ctx.copie) && ctx.copie !== ctx.racine) {
|
|
@@ -1946,15 +1952,38 @@ export function preuve(ctx, { mesure: derniere = null, fichiers: seuls = null }
|
|
|
1946
1952
|
// The builds that failed in the run whose results are under <dossier> (the summary of Turborepo,
|
|
1947
1953
|
// task `<package>#build`) of a package of the plan: `{ nom, erreur }`, `erreur` its log file and
|
|
1948
1954
|
// the beginning of its own output.
|
|
1949
|
-
|
|
1950
|
-
|
|
1955
|
+
// Whether the failed task <t> is a failed compilation, which renders « construction de <crate> »: a
|
|
1956
|
+
// build task (`cargo test --no-run`, grillhouse-egm), or a test task whose target did not compile —
|
|
1957
|
+
// code not 0, the compiler's errors in its log, which the module reads (`echecDeCompilation` of the
|
|
1958
|
+
// join) — reaching the circuit by the test task with no report (grillhouse-lv9, OSC Bridge OB-4gy).
|
|
1959
|
+
// A task that did not run, is green or « à repasser » is no failure; a test that failed at run time
|
|
1960
|
+
// or a binary that does not load shows no compiler error, and stays what it is.
|
|
1961
|
+
function echecDeConstruction(ctx, langage, t) {
|
|
1962
|
+
if (t.code === null || t.code === 0 || t.code === A_REPASSER) {
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
if (t.script === 'build') {
|
|
1966
|
+
return true;
|
|
1967
|
+
}
|
|
1968
|
+
if (!t.tests || typeof langage.echecDeCompilation !== 'function') {
|
|
1969
|
+
return false;
|
|
1970
|
+
}
|
|
1971
|
+
const { chemin } = journalDeTache(ctx, t);
|
|
1972
|
+
return Boolean(chemin) && langage.echecDeCompilation(sansCouleurs(lire(chemin)));
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
export function constructionsEchouees(ctx, liste, dossier) {
|
|
1976
|
+
const langage = langageDe(ctx.copie);
|
|
1977
|
+
const vus = new Set();
|
|
1978
|
+
return langage
|
|
1951
1979
|
.verdict(dossier)
|
|
1952
|
-
.taches.filter(t =>
|
|
1980
|
+
.taches.filter(t => echecDeConstruction(ctx, langage, t))
|
|
1953
1981
|
.flatMap(t => {
|
|
1954
1982
|
const p = liste.find(x => x.pkg.name === t.paquet);
|
|
1955
|
-
if (!p || !dansLePlan(ctx, p.dossier)) {
|
|
1983
|
+
if (!p || !dansLePlan(ctx, p.dossier) || vus.has(t.paquet)) {
|
|
1956
1984
|
return [];
|
|
1957
1985
|
}
|
|
1986
|
+
vus.add(t.paquet);
|
|
1958
1987
|
const j = journalDeTache(ctx, t);
|
|
1959
1988
|
return [{ nom: t.paquet, erreur: `son journal : ${j.chemin}\n\n${j.debut}\n` }];
|
|
1960
1989
|
});
|
|
@@ -1988,7 +2017,7 @@ function situer(ctx, liste, chemin) {
|
|
|
1988
2017
|
// shows without failing: `{ rouges, avertissements }`, `avertissements` the lines of the findings
|
|
1989
2018
|
// of another level, which the report lists apart. A guards' task red without a finding of level
|
|
1990
2019
|
// error keeps its line of a red task, with its log.
|
|
1991
|
-
function rougesDe(ctx, liste, c) {
|
|
2020
|
+
export function rougesDe(ctx, liste, c) {
|
|
1992
2021
|
const lus = lireSarif(c.dossier).constats.filter(k => !estNoteDeDette(k));
|
|
1993
2022
|
const vert = c.code === 0 || c.code === A_REPASSER;
|
|
1994
2023
|
const gardesDuCadre = nomsDesGardes(ctx.copie);
|
|
@@ -2004,7 +2033,8 @@ function rougesDe(ctx, liste, c) {
|
|
|
2004
2033
|
}
|
|
2005
2034
|
const out = [];
|
|
2006
2035
|
const testes = new Set();
|
|
2007
|
-
|
|
2036
|
+
const langage = langageDe(ctx.copie);
|
|
2037
|
+
for (const res of langage.verdict(c.dossier).rapports) {
|
|
2008
2038
|
const f = path.relative(ctx.copie, res.fichier);
|
|
2009
2039
|
const lieu = situer(ctx, liste, f);
|
|
2010
2040
|
if (res.tests.length === 0 && res.etat === 'failed') {
|
|
@@ -2040,7 +2070,10 @@ function rougesDe(ctx, liste, c) {
|
|
|
2040
2070
|
}
|
|
2041
2071
|
// The guards of the project wrote findings when one comes from a guard out of the frame's.
|
|
2042
2072
|
const duProjet = constats.some(k => !duCadre(k));
|
|
2043
|
-
|
|
2073
|
+
// The crates already rendered « construction de »: a failed build task and a test task that did
|
|
2074
|
+
// not compile, both of one crate, give one red (grillhouse-lv9).
|
|
2075
|
+
const construits = new Set();
|
|
2076
|
+
for (const t of langage.verdict(c.dossier).taches) {
|
|
2044
2077
|
if (t.code === null || t.code === 0 || t.code === A_REPASSER) {
|
|
2045
2078
|
continue;
|
|
2046
2079
|
}
|
|
@@ -2053,21 +2086,29 @@ function rougesDe(ctx, liste, c) {
|
|
|
2053
2086
|
if (t.script === 'gardes' && duProjet) {
|
|
2054
2087
|
continue;
|
|
2055
2088
|
}
|
|
2089
|
+
// A failed compilation (a build task, or a test task whose target does not compile) renders
|
|
2090
|
+
// « construction de <crate> », once per crate (grillhouse-lv9).
|
|
2091
|
+
const construction = echecDeConstruction(ctx, langage, t);
|
|
2092
|
+
if (construction && construits.has(t.paquet)) {
|
|
2093
|
+
continue;
|
|
2094
|
+
}
|
|
2056
2095
|
const p = liste.find(x => x.pkg.name === t.paquet);
|
|
2057
2096
|
const lieu = p ? situer(ctx, liste, `${p.dossier}/`) : situer(ctx, liste, null);
|
|
2058
2097
|
const j = journalDeTache(ctx, t);
|
|
2059
2098
|
out.push({
|
|
2060
|
-
texte:
|
|
2061
|
-
t.
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
detail: t.script === 'build' ? j.debut : '',
|
|
2099
|
+
texte: construction
|
|
2100
|
+
? `construction de ${t.paquet} — son journal : ${j.chemin}`
|
|
2101
|
+
: `tâche ${t.tache} rouge (code ${t.code}) — son journal : ${j.chemin}`,
|
|
2102
|
+
detail: construction ? j.debut : '',
|
|
2065
2103
|
...lieu,
|
|
2066
2104
|
// A red task of style (`<package>#lint`, `<package>#format:check`) is named by its task, as
|
|
2067
2105
|
// the plan's package that holds it: the one out of the plan reads `<package>#lint`.
|
|
2068
2106
|
horsTitre: lieu.horsTitre && STYLE.has(t.script) ? t.tache : lieu.horsTitre,
|
|
2069
2107
|
joue: t.paquet,
|
|
2070
2108
|
});
|
|
2109
|
+
if (construction) {
|
|
2110
|
+
construits.add(t.paquet);
|
|
2111
|
+
}
|
|
2071
2112
|
}
|
|
2072
2113
|
if (out.length === 0) {
|
|
2073
2114
|
out.push({
|
package/scripts/circuit.mjs
CHANGED
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
// (`laPasseFinale`): the circuit keeps the copy as it stands as a commit on the copy's HEAD,
|
|
318
318
|
// the base of the lot, and plays `npm run verifier --
|
|
319
319
|
// --filter=...[<base>...<copie>] --filter=//`, the root's tasks (the guards) with them; the
|
|
320
|
-
// complete one is the night's and the integration's. The final pass green on the band
|
|
320
|
+
// complete one is the night's and the integration's. The final pass green on the band marks its lot verified (`verifie`, the tree it played, read as a mark of that green pass, never re-hashed and compared — a non-deterministic build artifact of the copy would change it between the pass and the review). A red of a package of the plan goes to the
|
|
321
321
|
// developpeur, three sessions for the final pass, counted apart from those of the checks, the
|
|
322
322
|
// third on the strong model. A red in a package out of the plan, or that no package of the plan
|
|
323
323
|
// holds, stops at « controles », a question for the supervisor: he extends the plan to that
|
|
@@ -452,9 +452,13 @@
|
|
|
452
452
|
// (`arretDuTestwriterSaute`; OSC Bridge SH-13y.1: three RENDU « Agent : testwriter » on a
|
|
453
453
|
// package whose tests no command of the frame plays, the developpeur relaunched on an empty
|
|
454
454
|
// diff each time); its question, declare the tests of the package or settle the finding.
|
|
455
|
-
// - ACCEPTÉ: the integration,
|
|
456
|
-
//
|
|
457
|
-
//
|
|
455
|
+
// - ACCEPTÉ: the integration, as soon as a final pass has verified the lot accepted (`verifie` set
|
|
456
|
+
// by the pass that routed to this review, read as a mark and not compared to a re-hash of the
|
|
457
|
+
// live tree, which bors and Zuul teach: merge the commit tested, never a re-hash of a working
|
|
458
|
+
// tree a build artifact changes); else that pass first, once, its red going to the developpeur
|
|
459
|
+
// and the lot then to the reviewer again — a cycle bounded (`TOURS_DE_LA_PASSE_FINALE`), a lot
|
|
460
|
+
// whose tree never settles between the pass and the review stopping on a question to the
|
|
461
|
+
// supervisor. The circuit builds the lot from the copy: the files the copy changes
|
|
458
462
|
// against its HEAD, the testwriter's (`estUnTest`: test files and the shared test material)
|
|
459
463
|
// in one patch, the others in another, each file against HEAD and a new one against nothing
|
|
460
464
|
// (`git diff --no-index /dev/null`), the copy's index untouched; the message
|
|
@@ -512,7 +516,10 @@
|
|
|
512
516
|
// agent; `boucles` the counts of the bounded loops of the step under way, by their key (`tests`,
|
|
513
517
|
// the testwriter's sessions with their proofs; `code`, the developpeur's with their checks;
|
|
514
518
|
// `relecture`, the reviews), null at a step without one; `finale` whether the final pass has
|
|
515
|
-
// begun; `verifie`
|
|
519
|
+
// begun; `verifie` marks that the last final pass green verified the current lot (the tree it
|
|
520
|
+
// played), read as a mark and never compared to a re-hash of the live tree, null before;
|
|
521
|
+
// `toursDeLaPasseFinale` the tours of the ACCEPTÉ ↔ final pass cycle since the last integration
|
|
522
|
+
// or relaunch, which bounds it, null before;
|
|
516
523
|
// `mene` the start (an ISO date) of the step the circuit leads itself while it runs, null
|
|
517
524
|
// otherwise; `reprise` the session of the testwriter or developpeur its relaunches resume,
|
|
518
525
|
// `{ agent, seance }`, null before any; `refus` the integration's refusal of the lot (`{ rapport,
|
|
@@ -874,6 +881,7 @@ export function ecrireEtat(ctx, etat) {
|
|
|
874
881
|
paquets: ctx.paquets,
|
|
875
882
|
constats: ctx.constats ?? [],
|
|
876
883
|
verifie: ctx.verifie ?? null,
|
|
884
|
+
toursDeLaPasseFinale: ctx.toursDeLaPasseFinale ?? null,
|
|
877
885
|
seanceReprise: ctx.seanceReprise ?? null,
|
|
878
886
|
verts: ctx.verts ?? null,
|
|
879
887
|
reprise: ctx.reprise ?? null,
|
|
@@ -1351,6 +1359,7 @@ export const MEMOIRE = [
|
|
|
1351
1359
|
'regenereSur',
|
|
1352
1360
|
'aRegenerer',
|
|
1353
1361
|
'verifie',
|
|
1362
|
+
'toursDeLaPasseFinale',
|
|
1354
1363
|
'constats',
|
|
1355
1364
|
'verts',
|
|
1356
1365
|
'reprise',
|
|
@@ -1614,6 +1623,7 @@ function depart(ctx, e) {
|
|
|
1614
1623
|
ctx.reprise = null;
|
|
1615
1624
|
ctx.relancesTestwriter = null;
|
|
1616
1625
|
ctx.verifie = null;
|
|
1626
|
+
ctx.toursDeLaPasseFinale = null;
|
|
1617
1627
|
ctx.constats = [];
|
|
1618
1628
|
ctx.refus = null;
|
|
1619
1629
|
ctx.controlesRouges = null;
|
|
@@ -2226,6 +2236,7 @@ export async function arreter(ctx, e) {
|
|
|
2226
2236
|
const lu = e;
|
|
2227
2237
|
ctx.constats = [...(lu.constats ?? [])];
|
|
2228
2238
|
ctx.verifie = lu.verifie ?? null;
|
|
2239
|
+
ctx.toursDeLaPasseFinale = lu.toursDeLaPasseFinale ?? null;
|
|
2229
2240
|
ctx.seanceReprise = lu.seanceReprise ?? null;
|
|
2230
2241
|
ctx.verts = lu.verts ?? null;
|
|
2231
2242
|
ctx.reprise = lu.reprise ?? null;
|
|
@@ -2,3 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
/** The number of circuits at once (1 when absent), or the fault by its name. */
|
|
4
4
|
export function reglageDesCircuits(pkg: unknown): { max: number | null; faute: string | null };
|
|
5
|
+
|
|
6
|
+
/** The number of circuits at once of the project at <racine>, undefined when it does not read. */
|
|
7
|
+
export function maxDuProjet(racine: string): number | undefined;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
1
4
|
// The reading of the key `grillhouse.circuits` of a package.json (grillhouse-4nr.9, decision D9,
|
|
2
5
|
// the owner's word of 2026-11-04), read as written: an integer of 1 or more, the number of
|
|
3
6
|
// circuits of the project that run at once, which the queue of its tickets
|
|
@@ -19,3 +22,20 @@ export function reglageDesCircuits(pkg) {
|
|
|
19
22
|
}
|
|
20
23
|
return { max: c, faute: null };
|
|
21
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The number of circuits at once of the project at <racine>, as its package.json sets it; undefined
|
|
28
|
+
* when the package.json or the key does not read (the queue names the fault).
|
|
29
|
+
* @param {string} racine
|
|
30
|
+
* @returns {number | undefined}
|
|
31
|
+
*/
|
|
32
|
+
export function maxDuProjet(racine) {
|
|
33
|
+
try {
|
|
34
|
+
return (
|
|
35
|
+
reglageDesCircuits(JSON.parse(readFileSync(path.join(racine, 'package.json'), 'utf8'))).max ??
|
|
36
|
+
undefined
|
|
37
|
+
);
|
|
38
|
+
} catch {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -265,6 +265,7 @@ export function composer(modules) {
|
|
|
265
265
|
taches: parts.flatMap(p => p.taches),
|
|
266
266
|
};
|
|
267
267
|
},
|
|
268
|
+
echecDeCompilation: texte => modules.some(m => m.echecDeCompilation?.(texte) ?? false),
|
|
268
269
|
estUnTest: (chemin, racine) =>
|
|
269
270
|
premiereReponse(modules, racine, chemin, m => m.estUnTest(chemin, racine)),
|
|
270
271
|
horsDuJour: (chemin, racine) =>
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
// - The internal dependencies of the package.json: the names of its `dependencies`,
|
|
19
19
|
// `devDependencies`, `optionalDependencies` and `peerDependencies` that are the name of a package
|
|
20
20
|
// of the project (the ones above and the workspaces'). An external dependency, on either side,
|
|
21
|
-
// is no gap.
|
|
21
|
+
// is no gap; nor is a provider of the package's `grillhouse.donnees` (./donnees-cles.mjs), a data
|
|
22
|
+
// dependency that no manifest of the language links. A faulty key fails the guard, its faults named.
|
|
22
23
|
// - Refused, one finding per package, named with the dependencies in gap in each sense: the
|
|
23
24
|
// package.json that lacks a dependency its manifest links, or names an internal package its
|
|
24
25
|
// manifest does not link. Written in SARIF under the guard's name, and on the error stream after
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
import { existsSync, readFileSync } from 'node:fs';
|
|
27
28
|
import path from 'node:path';
|
|
28
29
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
30
|
+
import { fournisseursDuPaquet } from './donnees-cles.mjs';
|
|
29
31
|
import { langage } from './langages.mjs';
|
|
30
32
|
import { nomDuManifeste, paquetsSansPackageJson, sansPackageJson } from './paquet-npm.mjs';
|
|
31
33
|
import { paquets } from './paquets.mjs';
|
|
@@ -79,8 +81,13 @@ export function constats(racine) {
|
|
|
79
81
|
const liens = langage(p.langage).liensDuManifeste(racine, p.chemin, d => nomA(p.langage, d));
|
|
80
82
|
const duManifeste = new Set(liens.noms);
|
|
81
83
|
duManifeste.delete(p.nom);
|
|
84
|
+
// A provider of `grillhouse.donnees` is a data dependency across languages: it lives in the
|
|
85
|
+
// devDependencies only, for Turborepo's order, and no manifest of the language links it.
|
|
86
|
+
const donnees = new Set(fournisseursDuPaquet(racine, p.chemin));
|
|
82
87
|
const duPackage = new Set(
|
|
83
|
-
CHAMPS.flatMap(c => Object.keys(pkg[c] ?? {})).filter(
|
|
88
|
+
CHAMPS.flatMap(c => Object.keys(pkg[c] ?? {})).filter(
|
|
89
|
+
n => internes.has(n) && n !== p.nom && !donnees.has(n)
|
|
90
|
+
)
|
|
84
91
|
);
|
|
85
92
|
const manquantes = [...duManifeste].filter(n => !duPackage.has(n)).sort();
|
|
86
93
|
const enTrop = [...duPackage].filter(n => !duManifeste.has(n)).sort();
|
package/scripts/donnees-cles.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
// The reading of the `grillhouse.donnees` key of a package.json, the data of a package, as Bazel's
|
|
3
2
|
// `data` declare the output of another target that a test runs (`data = ["//crates/service:bin"]`):
|
|
4
3
|
// `{ "<VARIABLE>": "<paquet>#<sortie>" }`. The consumer lists the provider in its `devDependencies`,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// `~/.cargo` with its `env`, its configuration and its binaries, and rustup's `~/.rustup`) comes
|
|
26
26
|
// back read-only under them, nothing a shell sources written; its outputs in the copy (cargo's
|
|
27
27
|
// `target`) come back in writing; and its outputs proper to the session (TypeScript's `.turbo`
|
|
28
|
-
// and
|
|
28
|
+
// and `.cache-outils`, the cache of Vite included) are below. Each written path is created on disk before the session,
|
|
29
29
|
// a directory or, without a trailing `/` in the module's list, an empty file, so that bwrap
|
|
30
30
|
// mounts it.
|
|
31
31
|
// - The home and the session directories (`$XDG_RUNTIME_DIR`, `/run/user/<uid>`) show only what
|
|
@@ -12,6 +12,9 @@ export interface TicketDeBeads {
|
|
|
12
12
|
dependencies?: Array<{ type: string; depends_on_id: string }>;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/** Whether the description of <t> holds its section « ## Architecture ». */
|
|
16
|
+
export function aSonArchitecture(t: { description?: string }): boolean;
|
|
17
|
+
|
|
15
18
|
/** The tickets of <tous> that start now, in the order they start. */
|
|
16
19
|
export function ticketsAPartir<T extends TicketDeBeads>(
|
|
17
20
|
tous: T[],
|
|
@@ -55,5 +58,8 @@ export function lireLesExternes(
|
|
|
55
58
|
tous: TicketDeBeads[]
|
|
56
59
|
): Record<string, TicketDeBeads[]>;
|
|
57
60
|
|
|
61
|
+
/** The directory of a project of `external_projects`: absolute as set, relative from the main tree of <racine>. */
|
|
62
|
+
export function cheminDuProjetExterne(racine: string, chemin: string): string;
|
|
63
|
+
|
|
58
64
|
/** Every ticket of the project at <racine>, the closed ones too, as Beads gives them; throws on a Beads that fails. */
|
|
59
65
|
export function lireLesTickets(racine: string): TicketDeBeads[];
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
// `external_projects`; a project it lacks holds the ticket, and `attentesExternes` names the
|
|
24
24
|
// fault (never a silent start).
|
|
25
25
|
import { spawnSync } from 'node:child_process';
|
|
26
|
+
import path from 'node:path';
|
|
26
27
|
import { ETAPES } from './etapes.mjs';
|
|
27
28
|
|
|
28
|
-
// Whether the description of <t> holds its section « ## Architecture
|
|
29
|
-
|
|
29
|
+
// Whether the description of <t> holds its section « ## Architecture »: the rule the queue and the
|
|
30
|
+
// board both read.
|
|
31
|
+
export const aSonArchitecture = t => /^## Architecture\b/m.test(t.description ?? '');
|
|
30
32
|
|
|
31
33
|
// The tickets of <tous> in the queue: open, labelled `circuit` and not `direct`, those of
|
|
32
34
|
// <enCours> aside.
|
|
@@ -172,12 +174,12 @@ export function lireLesExternes(racine, tous) {
|
|
|
172
174
|
encoding: 'utf8',
|
|
173
175
|
maxBuffer: 256 * 1024 * 1024,
|
|
174
176
|
});
|
|
175
|
-
const chemin
|
|
177
|
+
const chemin = `${r.stdout ?? ''}`.trim();
|
|
176
178
|
if (r.status !== 0 || chemin === '' || chemin.includes('not set')) {
|
|
177
179
|
continue;
|
|
178
180
|
}
|
|
179
181
|
try {
|
|
180
|
-
externes[nom] = lireLesTickets(chemin);
|
|
182
|
+
externes[nom] = lireLesTickets(cheminDuProjetExterne(racine, chemin));
|
|
181
183
|
} catch {
|
|
182
184
|
// Left out: the project does not resolve.
|
|
183
185
|
}
|
|
@@ -185,6 +187,30 @@ export function lireLesExternes(racine, tous) {
|
|
|
185
187
|
return externes;
|
|
186
188
|
}
|
|
187
189
|
|
|
190
|
+
/**
|
|
191
|
+
* The directory of a project of `external_projects` whose path <chemin> the Beads of the project
|
|
192
|
+
* at <racine> sets: an absolute path as it is, a relative one from the root of the main tree of
|
|
193
|
+
* <racine> (the parent of its common directory of git, a copy included), where `grillhouse maj`
|
|
194
|
+
* writes it from (`projetsExternes` of ./groupe-cles.mjs).
|
|
195
|
+
* @param {string} racine
|
|
196
|
+
* @param {string} chemin
|
|
197
|
+
* @returns {string}
|
|
198
|
+
*/
|
|
199
|
+
export function cheminDuProjetExterne(racine, chemin) {
|
|
200
|
+
if (path.isAbsolute(chemin)) {
|
|
201
|
+
return chemin;
|
|
202
|
+
}
|
|
203
|
+
const r = spawnSync(
|
|
204
|
+
'git',
|
|
205
|
+
['-C', racine, 'rev-parse', '--path-format=absolute', '--git-common-dir'],
|
|
206
|
+
{
|
|
207
|
+
encoding: 'utf8',
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
const principal = r.status === 0 ? path.dirname(r.stdout.trim()) : path.resolve(racine);
|
|
211
|
+
return path.resolve(principal, chemin);
|
|
212
|
+
}
|
|
213
|
+
|
|
188
214
|
/**
|
|
189
215
|
* Every ticket of the project at <racine>, the closed ones too, as Beads gives them; a Beads that
|
|
190
216
|
* fails or a list that does not parse throws, its reason named (`bd list`), never an empty list.
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
// update has finished its files, and the exit code is non-zero.
|
|
124
124
|
// - The group: when the package.json declares `grillhouse.groupe` (scripts/groupe-cles.mjs), the
|
|
125
125
|
// update sets in the Beads of the project each other project of the group as an
|
|
126
|
-
// `external_projects.<name>` (its
|
|
126
|
+
// `external_projects.<name>` (its path relative to the project), the ones already set left alone; a group
|
|
127
127
|
// badly declared is refused by its key before any work.
|
|
128
128
|
// - The generated files: after the package.json, each generator of the declared language
|
|
129
129
|
// (`miseAJour.generateurs` of its module) is run in the project by the project's command
|
|
@@ -326,7 +326,8 @@ export function versionDuProjet(projet) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
// Beads run in <cwd>, as `bd(args, cwd)` gives it: { status, stdout, stderr }.
|
|
329
|
-
const jouerBd = (args, cwd) =>
|
|
329
|
+
const jouerBd = (args, cwd) =>
|
|
330
|
+
spawnSync('bd', args, { cwd, encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
|
|
330
331
|
|
|
331
332
|
// The group the package.json of <projet> declares (null without it); a fault throws, naming its
|
|
332
333
|
// key (`grillhouse.groupe`) and its value.
|
|
@@ -345,7 +346,7 @@ function lireDuGroupe(projet) {
|
|
|
345
346
|
}
|
|
346
347
|
|
|
347
348
|
// The `external_projects` of the Beads of <projet>: the other projects of its <groupe>, each by its
|
|
348
|
-
// name and
|
|
349
|
+
// name and its path relative to <projet> (`projetsExternes`); those it sets, by name (none when already set).
|
|
349
350
|
function poserLesProjetsExternes(projet, groupe, bd) {
|
|
350
351
|
if (groupe === null) {
|
|
351
352
|
return [];
|
package/scripts/groupe-cles.mjs
CHANGED
|
@@ -60,7 +60,9 @@ export function lireGroupe(pkg, racine) {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* The `external_projects` of the Beads of the project at <racine>: the other projects of its
|
|
63
|
-
* <groupe>, `{ <nom>: <chemin> }
|
|
63
|
+
* <groupe>, `{ <nom>: <chemin> }`, each path relative to <racine>, the root of its main tree:
|
|
64
|
+
* `.beads/config.yaml` is committed, and a relative path keeps the local tree out of it and holds
|
|
65
|
+
* on every machine where the projects sit side by side.
|
|
64
66
|
* @param {{ projets: { nom: string, chemin: string }[] }} groupe
|
|
65
67
|
* @param {string} racine
|
|
66
68
|
* @returns {Record<string, string>}
|
|
@@ -68,6 +70,6 @@ export function lireGroupe(pkg, racine) {
|
|
|
68
70
|
export function projetsExternes(groupe, racine) {
|
|
69
71
|
const soi = path.resolve(racine);
|
|
70
72
|
return Object.fromEntries(
|
|
71
|
-
groupe.projets.filter(p => p.chemin !== soi).map(p => [p.nom, p.chemin])
|
|
73
|
+
groupe.projets.filter(p => p.chemin !== soi).map(p => [p.nom, path.relative(soi, p.chemin)])
|
|
72
74
|
);
|
|
73
75
|
}
|
|
@@ -86,6 +86,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
86
86
|
import { arbitrageTranche, estArbitrage } from '../arbitrages.mjs';
|
|
87
87
|
import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
|
|
88
88
|
import { langageDe } from '../langages.mjs';
|
|
89
|
+
import { prefixe } from '../prefixe-des-tickets.mjs';
|
|
89
90
|
import { commitsDelivering, gitLog } from '../un-commit-par-ticket.mjs';
|
|
90
91
|
import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
|
|
91
92
|
import { avecLesOutils, outilsDe } from '../outils-cles.mjs';
|
|
@@ -186,13 +187,15 @@ export function refusLots(tests, code, { avant, apres }) {
|
|
|
186
187
|
* `(<ticket>)` — a lot the queue entered by fast-forward; its tip naming the ticket keeps a fresh
|
|
187
188
|
* branch sitting at a commit of main (lancer.sh creates it there, no lot yet) from being taken
|
|
188
189
|
* for a delivered lot (grillhouse-bf5.2.1);
|
|
189
|
-
* (b) a commit of main whose message names the ticket (`commitsDelivering`, the prefix read from
|
|
190
|
+
* (b) a commit of main whose message names the ticket (`commitsDelivering`, the prefix read from `.beads/config.yaml`,
|
|
190
191
|
* a withdrawn one left out) — a lot the queue rebased or merged in a squash, its branch gone or
|
|
191
192
|
* left behind.
|
|
192
|
-
* <o> is `{ racine, principale
|
|
193
|
+
* <o> is `{ racine, principale }` over the main tree.
|
|
193
194
|
*/
|
|
194
195
|
export function lotSurMain(o, ticket) {
|
|
195
|
-
const { racine
|
|
196
|
+
const { racine } = o;
|
|
197
|
+
// Read first, whichever way the lot is found: a key missing refuses, by the message of `prefixe`.
|
|
198
|
+
const prefix = prefixe(racine);
|
|
196
199
|
const git = (...a) => spawnSync('git', ['-C', racine, ...a], { encoding: 'utf8' });
|
|
197
200
|
const principale =
|
|
198
201
|
o.principale ?? (git('symbolic-ref', '--short', '-q', 'HEAD').stdout.trim() || 'main');
|
|
@@ -210,9 +213,8 @@ export function lotSurMain(o, ticket) {
|
|
|
210
213
|
return tip;
|
|
211
214
|
}
|
|
212
215
|
// (b) a commit of main that names the ticket, the queue's rebase or squash.
|
|
213
|
-
const prefixe = bd('config', 'get', 'issue_prefix').stdout?.trim() ?? '';
|
|
214
216
|
return (
|
|
215
|
-
commitsDelivering(ticket,
|
|
217
|
+
commitsDelivering(ticket, prefix, gitLog(racine))
|
|
216
218
|
.map(c => git('rev-parse', '--verify', '-q', `${c}^{commit}`).stdout.trim())
|
|
217
219
|
.find(surMain) ?? null
|
|
218
220
|
);
|
|
@@ -337,7 +339,12 @@ function main(argv) {
|
|
|
337
339
|
// rule `lotSurMain` the circuit's resumption reads, not the usage (exit 2), so a resumption that
|
|
338
340
|
// finds no lot and no commit on main gets the one named refusal.
|
|
339
341
|
if (!(o.tests || o.code)) {
|
|
340
|
-
|
|
342
|
+
let entre;
|
|
343
|
+
try {
|
|
344
|
+
entre = lotSurMain({ racine }, o.ticket);
|
|
345
|
+
} catch (e) {
|
|
346
|
+
return refuser(e.message);
|
|
347
|
+
}
|
|
341
348
|
if (!entre) {
|
|
342
349
|
return refuser(refusLotAbsent(o.ticket));
|
|
343
350
|
}
|
package/scripts/jointure.d.ts
CHANGED
|
@@ -245,6 +245,11 @@ export interface Composition {
|
|
|
245
245
|
racine: string
|
|
246
246
|
): { tester: Commande; verifier: Commande; typer: Commande } & Record<string, Commande>;
|
|
247
247
|
verdict(dossier: string): { rapports: RapportDeTest[]; taches: TacheJouee[] };
|
|
248
|
+
/** Whether the log `texte` of a task shows a COMPILATION failure of the language, so the circuit
|
|
249
|
+
* reads a test target that does not compile as a failed build (« construction de <crate> »),
|
|
250
|
+
* whatever the task that bears it — the build task, or the test task with no report
|
|
251
|
+
* (grillhouse-lv9). Every module answers it; a language with no compilation step answers false. */
|
|
252
|
+
echecDeCompilation(texte: string): boolean;
|
|
248
253
|
estUnTest(chemin: string, racine: string): ClasseDeTest;
|
|
249
254
|
/** Whether the test file `chemin` (from `racine`) is out of the day, one that only the night
|
|
250
255
|
* plays (a night test, a time budget bench, a time witness), by the module's own definitions;
|
|
@@ -504,6 +509,10 @@ export function sources(racine: string, dossier?: string): string[];
|
|
|
504
509
|
export function paquetsSansPackageJson(
|
|
505
510
|
racine: string
|
|
506
511
|
): { langage: string; chemin: string; nom: string }[];
|
|
512
|
+
/** The names of the providers of `grillhouse.donnees` of the consumer that holds `chemin` (its
|
|
513
|
+
* folder from the root), in the project at `dir` (scripts/donnees-cles.mjs); throws the faults of a
|
|
514
|
+
* faulty key, one per line. */
|
|
515
|
+
export function fournisseursDuPaquet(dir: string, chemin: string): string[];
|
|
507
516
|
/** The name of the script and of the task of the tests of a package, the same for every language. */
|
|
508
517
|
export const SCRIPT_DES_TESTS: string;
|
|
509
518
|
/** The name of the environment variable that carries the paths and the options of a targeted run
|
|
@@ -806,8 +806,8 @@ function sousLaBase(genre, env, jouer) {
|
|
|
806
806
|
|
|
807
807
|
/**
|
|
808
808
|
* The line that refuses the workspace at <racine> whose Cargo.lock git does not track, the
|
|
809
|
-
* gesture named; null when git tracks it
|
|
810
|
-
*
|
|
809
|
+
* gesture named; null when git tracks it, and null for a tree with no git at all. <copie> is the
|
|
810
|
+
* git tree that reads the lock: the copy git tracks the file in (COPIE_DE_L_ARBRE), else <racine>.
|
|
811
811
|
* @param {string} racine
|
|
812
812
|
* @param {string} [copie]
|
|
813
813
|
* @returns {string | null}
|
|
@@ -816,8 +816,16 @@ export function verrouNonVersionne(racine, copie = racine) {
|
|
|
816
816
|
if (!existsSync(path.join(racine, VERROU))) {
|
|
817
817
|
return `⛔ ${VERROU} absent : cargo generate-lockfile, puis git add ${VERROU}`;
|
|
818
818
|
}
|
|
819
|
+
// A tree of HEAD's version the proof plays (`.travail/avant-…`) has no `.git`: its Cargo.lock is
|
|
820
|
+
// HEAD's, versioned by construction, and Turborepo's strict mode drops COPIE_DE_L_ARBRE, which
|
|
821
|
+
// would name its copy (grillhouse-uja). The check reads a real git tree: the copy if it is one,
|
|
822
|
+
// else <racine>; with no git tree at hand, the lock is HEAD's and nothing is unversioned.
|
|
823
|
+
const depot = [copie, racine].find(d => existsSync(path.join(d, '.git')));
|
|
824
|
+
if (!depot) {
|
|
825
|
+
return null;
|
|
826
|
+
}
|
|
819
827
|
const r = spawnSync('git', ['ls-files', '--error-unmatch', '--', VERROU], {
|
|
820
|
-
cwd:
|
|
828
|
+
cwd: depot,
|
|
821
829
|
stdio: 'ignore',
|
|
822
830
|
});
|
|
823
831
|
return r.status === 0 ? null : `⛔ ${VERROU} non versionné : git add ${VERROU}`;
|
|
@@ -63,7 +63,7 @@ import * as taillesDesTests from './migrations/0.28.4-tailles-des-tests.mjs';
|
|
|
63
63
|
import * as executablesDeTests from './migrations/0.34.0-executables-de-tests.mjs';
|
|
64
64
|
import { squelette } from './squelette.mjs';
|
|
65
65
|
import { CACHE, CIBLES } from './sccache.mjs';
|
|
66
|
-
import { verdict } from './verdict.mjs';
|
|
66
|
+
import { echecDeCompilation, verdict } from './verdict.mjs';
|
|
67
67
|
|
|
68
68
|
// The scripts of this module, beside this file.
|
|
69
69
|
const ici = nom => path.join(path.dirname(fileURLToPath(import.meta.url)), nom);
|
|
@@ -141,6 +141,7 @@ export default {
|
|
|
141
141
|
empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
|
|
142
142
|
commandes,
|
|
143
143
|
verdict,
|
|
144
|
+
echecDeCompilation,
|
|
144
145
|
estUnTest,
|
|
145
146
|
horsDuJour: fichierHorsDuJour,
|
|
146
147
|
arbreDAvant,
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
// of the doctests; `journal`, from the root, the log of the task `build`, the build of a crate's
|
|
11
11
|
// test targets, which the circuit reads for a failed build), and the file of each test binary of nextest by its id (`ws-core`,
|
|
12
12
|
// `ws-core::integ`, `ws-core::bin/outil`), its target's source.
|
|
13
|
+
// - `echecDeCompilation` reads a task's log: whether a test target did not compile (grillhouse-lv9),
|
|
14
|
+
// which the circuit reads as a failed build whatever the cargo task that bears it — the build of
|
|
15
|
+
// `cargo test --no-run` (grillhouse-egm), or the test task nextest, which bears the compiler's
|
|
16
|
+
// errors with no JUnit when a target does not compile.
|
|
13
17
|
// - `<dossier>/nextest/<run>-<crate>.xml`, the JUnit report of each run of nextest: each
|
|
14
18
|
// `testsuite`, a test binary, gives a test file, each `testcase` a test, failed when it holds a
|
|
15
19
|
// `failure` or an `error`, skipped when it holds `skipped`; its message, the failure's. A unit
|
|
@@ -150,3 +154,13 @@ export function verdict(dossier) {
|
|
|
150
154
|
),
|
|
151
155
|
};
|
|
152
156
|
}
|
|
157
|
+
|
|
158
|
+
// Whether the log <texte> of a task shows a cargo COMPILATION failure: a diagnostic of rustc with
|
|
159
|
+
// its code (`error[E0599]`), or cargo's summary of a crate that did not build (`could not
|
|
160
|
+
// compile`). A test that compiled then failed at run time, or a binary that does not load, shows
|
|
161
|
+
// neither. The circuit reads a test target that does not compile as a failed build
|
|
162
|
+
// (`construction de <crate> », scripts/activites.mjs), whatever the cargo task that bears it: the
|
|
163
|
+
// build of `cargo test --no-run` (grillhouse-egm), or the test task nextest, which bears the
|
|
164
|
+
// errors with no JUnit when a target does not compile (grillhouse-lv9, OSC Bridge OB-4gy).
|
|
165
|
+
export const echecDeCompilation = texte =>
|
|
166
|
+
/error\[E\d+\]/.test(texte) || /could not compile/.test(texte);
|
|
@@ -108,6 +108,8 @@ export default {
|
|
|
108
108
|
empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
|
|
109
109
|
commandes,
|
|
110
110
|
verdict,
|
|
111
|
+
// Python has no compilation step: no test task bears a compilation failure (jointure.d.ts).
|
|
112
|
+
echecDeCompilation: () => false,
|
|
111
113
|
estUnTest,
|
|
112
114
|
// A night test, `*_nuit_test.py` (`estDeNuit`).
|
|
113
115
|
horsDuJour: chemin => estDeNuit(path.basename(chemin)),
|