@roomi-fields/grillhouse 0.48.0 → 0.49.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 +90 -0
- package/agents/direct.md +9 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +11 -0
- package/cadre/templates/projet/.github/workflows/nuit.yml +15 -6
- package/cadre/templates/projet/CLAUDE.md +10 -6
- 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 +51 -14
- package/dist/temporal/acte.d.ts +9 -0
- package/dist/temporal/acte.js +43 -20
- package/dist/temporal/acte.js.map +1 -1
- 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 +30 -57
- 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/file/contrat.d.ts +16 -2
- package/dist/temporal/file/contrat.js +27 -3
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.js +4 -4
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/nuits/activites.d.ts +1 -15
- package/dist/temporal/nuits/activites.js +3 -62
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +3 -21
- package/dist/temporal/nuits/deroule.js +38 -74
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/client.d.ts +3 -16
- package/dist/temporal/places/client.js +3 -26
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +15 -51
- package/dist/temporal/places/contrat.js +3 -13
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +11 -61
- 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 +337 -120
- package/docs/CADRE.md +16 -13
- package/docs/INTERFACE.md +90 -25
- package/hooks/hooks.json +9 -0
- package/hooks/register.tsx +59 -5
- package/package.json +1 -1
- package/scripts/activites.mjs +271 -42
- package/scripts/aiguillage.mjs +4 -1
- package/scripts/bilan.mjs +125 -2
- package/scripts/circuit.mjs +233 -159
- 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/dette.d.ts +2 -1
- package/scripts/dette.mjs +49 -6
- package/scripts/direct.mjs +343 -0
- package/scripts/droits.mjs +26 -4
- package/scripts/effets.mjs +4 -4
- package/scripts/engendres.mjs +2 -1
- package/scripts/enveloppe/enveloppe.mjs +119 -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 +119 -21
- package/scripts/etapes.mjs +3 -3
- package/scripts/faits-du-circuit.mjs +12 -11
- package/scripts/fermeture-de-la-machine.d.mts +4 -4
- package/scripts/fermeture-de-la-machine.mjs +10 -20
- 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/flux-de-la-nuit.mjs +38 -0
- 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 +148 -37
- package/scripts/jointure.d.ts +20 -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/cargo/commandes.mjs +5 -6
- package/scripts/langages/python/commandes.mjs +5 -5
- package/scripts/langages/python/composants.mjs +10 -2
- package/scripts/langages/typescript/composants.mjs +10 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +15 -3
- package/scripts/langages/typescript/construire.mjs +2 -0
- package/scripts/langages/typescript/exemples.mjs +33 -1
- package/scripts/langages/typescript/index.mjs +19 -0
- package/scripts/langages/typescript/migrations/0.49.0-tests-equipes.mjs +32 -0
- package/scripts/langages/typescript/tests-de-nuit.mjs +158 -32
- package/scripts/langages/typescript/tests-du-poste.mjs +112 -32
- package/scripts/langages/typescript/titres-de-tests.mjs +11 -7
- package/scripts/langages/typescript/turbo-des-paquets.mjs +21 -4
- 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/machine.setup.mjs +11 -5
- package/scripts/langages/typescript/vitest.nuit.config.mjs +53 -5
- package/scripts/machine.mjs +1 -1
- package/scripts/mesure/base-de-passe.mjs +2 -1
- package/scripts/migrations/0.49.0-reservation-de-trois-coeurs.mjs +30 -0
- package/scripts/migrations.mjs +2 -0
- package/scripts/nuit.sh +129 -3
- 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 +4 -7
- package/scripts/places-de-la-machine.mjs +55 -42
- package/scripts/places-du-serveur.mjs +2 -2
- package/scripts/plafond-de-la-machine.d.mts +7 -13
- package/scripts/plafond-de-la-machine.mjs +19 -35
- package/scripts/prefixe-des-tickets.mjs +1 -1
- package/scripts/references-changees.mjs +159 -0
- package/scripts/regles-des-places.d.mts +8 -31
- package/scripts/regles-des-places.mjs +14 -64
- package/scripts/repli-de-la-nuit.mjs +183 -0
- package/scripts/reponses-du-circuit.d.mts +2 -2
- package/scripts/reponses-du-circuit.mjs +21 -12
- package/scripts/reprise.mjs +27 -8
- package/scripts/resultats.mjs +21 -9
- package/scripts/seances.mjs +258 -40
- package/scripts/services-du-noyau.mjs +4 -0
- package/scripts/sous-commandes.mjs +24 -7
- package/scripts/superviseur.mjs +185 -39
- package/scripts/tableau.mjs +226 -94
- package/scripts/taches-du-graphe.mjs +84 -4
- package/scripts/ticket.mjs +348 -0
- package/scripts/transitions.d.mts +44 -0
- package/scripts/transitions.mjs +188 -17
- 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/architecte/SKILL.md +203 -0
- package/skills/architecte/references/exemple-d-architecture.md +159 -0
- 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/redacteur/references/documents-d-un-composant.md +2 -1
- package/skills/relecteur/SKILL.md +8 -0
- package/skills/testwriter/SKILL.md +10 -0
- package/scripts/ticket.sh +0 -25
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
// even when the index no longer says them in conflict); a conflict the session of the role
|
|
50
50
|
// does not lift goes up to the supervisor, the stop « lancement », each file named. A file
|
|
51
51
|
// without marker left in the copy counts as resolved (put in the index by the circuit).
|
|
52
|
+
// At the launch of a session, the circuit plays the rule too (scripts/seances.mjs `seance`):
|
|
53
|
+
// the launch refused goes to the other role first while files of its own carry marks
|
|
54
|
+
// (`marquesRestantes`), and the sheet FAIT of a session is refused while a file of its role
|
|
55
|
+
// carries them, one the session put in the index with its marks included.
|
|
52
56
|
// - A copy still in conflict (unmerged entries in its index) or whose branch has left main
|
|
53
57
|
// (commits on both sides, no fast-forward) is not touched; the output says why; exit 1. A
|
|
54
58
|
// fast-forward that fails after the work is set aside (an untracked file in the way) gives
|
|
@@ -61,11 +65,25 @@
|
|
|
61
65
|
// when the lot touches one of its files, or one it reads (the copy's untracked files counting),
|
|
62
66
|
// the application leaves its files out (main's version stays), then its command writes them
|
|
63
67
|
// again in the copy, the lot applied, with the tools of the project (`grillhouse.outils`), out
|
|
64
|
-
// of the envelope.
|
|
65
|
-
//
|
|
68
|
+
// of the envelope. The output of a command that passes is a message, never the data of the
|
|
69
|
+
// preparation: it goes where the faults go (stderr, the log of the preparation for the circuit),
|
|
70
|
+
// so the standard output of `preparer` holds the list of its pose alone (BPScript, 2026-11-22:
|
|
71
|
+
// the output of « npm install --package-lock-only » read as the list of the shared submodules,
|
|
72
|
+
// the mount refused on « usage: sous-modules.sh … »). A command that fails stops, exit 1, the
|
|
73
|
+
// command, its code and its output named, the rest of the lot in the copy; a faulty key
|
|
74
|
+
// refuses, named, before the copy is
|
|
66
75
|
// touched (OSC Bridge, 2026-10-31: four conflicts in one day on the generated files of synthhub
|
|
67
76
|
// and open-synth-descriptors, each copy moved by hand). A lot in conflict on another file is not
|
|
68
|
-
// regenerated: its conflicts come first.
|
|
77
|
+
// regenerated: its conflicts come first. A reference the frame generates itself and writes in
|
|
78
|
+
// full (`fichiersEngendres` of the module of the language, its `entiers`: the index of the
|
|
79
|
+
// interfaces, the turbo.json of the packages) follows the same rule, with no key of the project:
|
|
80
|
+
// main's version, then the frame's generator, whose code is not read, a real failure aside
|
|
81
|
+
// (BPScript, 2026-11-22: « UU docs/agents/index-des-interfaces.md » at the advance of two
|
|
82
|
+
// copies). The reports of API (INTERFACE.api.md and the generated part of an INTERFACE.md) and
|
|
83
|
+
// the debt of the guards, which the frame does not give as written in full (no `entiers`), are
|
|
84
|
+
// still merged. A copy whose references the module of the language does not read (no language
|
|
85
|
+
// declared) is advanced all the same, its references merged as files written by hand, and the
|
|
86
|
+
// fault is said: on stderr, in the log of the preparation for the circuit.
|
|
69
87
|
import { spawnSync } from 'node:child_process';
|
|
70
88
|
import { existsSync, readFileSync, rmSync, statSync, writeFileSync, writeSync } from 'node:fs';
|
|
71
89
|
import path from 'node:path';
|
|
@@ -74,6 +92,7 @@ import { couvertPar, encoreDeclares, engendresDe, regenerer, touchesPar } from '
|
|
|
74
92
|
import { avecLesDonnees, donneesDe } from '../donnees-cles.mjs';
|
|
75
93
|
import { matieresDeclareesDe } from '../matieres-cles.mjs';
|
|
76
94
|
import { avecLesOutils, empreintesDe, outilsDe } from '../outils-cles.mjs';
|
|
95
|
+
import { langageDe } from '../langages.mjs';
|
|
77
96
|
|
|
78
97
|
const LOT = 'grillhouse-travail.patch';
|
|
79
98
|
|
|
@@ -89,6 +108,10 @@ const lignes = r =>
|
|
|
89
108
|
// The files of <copie> unmerged in its index.
|
|
90
109
|
const enConflit = copie => lignes(git(copie, ['diff', '--name-only', '--diff-filter=U']));
|
|
91
110
|
|
|
111
|
+
// The files of <copie> its index holds apart from HEAD, a deletion aside: those a session put
|
|
112
|
+
// there, the circuit leaving the index as HEAD has it.
|
|
113
|
+
const aLIndex = copie => lignes(git(copie, ['diff', '--cached', '--name-only', '--diff-filter=d']));
|
|
114
|
+
|
|
92
115
|
// The files the lot <lot> touches in <copie>: each added, modified or deleted, a rename its source
|
|
93
116
|
// and its destination.
|
|
94
117
|
const fichiersDuLot = (copie, lot) =>
|
|
@@ -97,17 +120,53 @@ const fichiersDuLot = (copie, lot) =>
|
|
|
97
120
|
.map(l => (l.includes('\t') ? l.split('\t')[2] : l))
|
|
98
121
|
.filter(Boolean);
|
|
99
122
|
|
|
123
|
+
/**
|
|
124
|
+
* The references the frame generates itself in <copie> and writes in full (`fichiersEngendres` of
|
|
125
|
+
* the module of its language, those with `entiers`: the index of the interfaces, the turbo.json of
|
|
126
|
+
* the packages), as the circuit regenerates them at 4.2; none for a copy the module does not read,
|
|
127
|
+
* whose fault goes to <dire>.
|
|
128
|
+
* @param {string} copie
|
|
129
|
+
* @param {(texte: string) => void} dire
|
|
130
|
+
* @returns {{ nom: string, commande: string, fichiers: string[], lit: string[], entiers: string[] }[]}
|
|
131
|
+
*/
|
|
132
|
+
function referencesEntieresDuCadre(copie, dire) {
|
|
133
|
+
try {
|
|
134
|
+
return langageDe(copie)
|
|
135
|
+
.fichiersEngendres(copie)
|
|
136
|
+
.filter(r => r.entiers.length)
|
|
137
|
+
.map(({ verifier: _verifier, ...reference }) => reference);
|
|
138
|
+
} catch (e) {
|
|
139
|
+
dire(
|
|
140
|
+
`⚠ Les références du cadre ne se lisent pas dans la copie ${copie} : celles qu'il écrit en entier (l'index des interfaces, les turbo.json des paquets) sont fusionnées comme des fichiers écrits à la main.\n${/** @type {Error} */ (e).message}\n`
|
|
141
|
+
);
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Where a fault that does not refuse the advance is said, by default.
|
|
147
|
+
const surStderr = texte => void process.stderr.write(texte);
|
|
148
|
+
|
|
100
149
|
/**
|
|
101
150
|
* The keys of the project that holds <copie>, read before any work: `{ engendres, env }`, its
|
|
102
|
-
* generated files
|
|
151
|
+
* generated files, then the references the frame writes in full (<duCadre>, each marked `cadre`,
|
|
152
|
+
* but one whose first file a generated file of the project writes), and the environment of their
|
|
153
|
+
* commands with its tools, or `{ refus }`. A fault that refuses nothing goes to <dire>.
|
|
103
154
|
* @param {string} copie
|
|
155
|
+
* @param {(copie: string, dire: (texte: string) => void) => { nom: string, commande: string, fichiers: string[], lit: string[], entiers: string[] }[]} [duCadre]
|
|
156
|
+
* @param {(texte: string) => void} [dire]
|
|
104
157
|
* @returns {{ engendres: any[], env: NodeJS.ProcessEnv, refus?: undefined } | { refus: string }}
|
|
105
158
|
*/
|
|
106
|
-
function lesCles(copie) {
|
|
159
|
+
function lesCles(copie, duCadre = referencesEntieresDuCadre, dire = surStderr) {
|
|
107
160
|
try {
|
|
108
161
|
matieresDeclareesDe(copie);
|
|
162
|
+
const duProjet = engendresDe(copie);
|
|
109
163
|
return {
|
|
110
|
-
engendres:
|
|
164
|
+
engendres: [
|
|
165
|
+
...duProjet,
|
|
166
|
+
...duCadre(copie, dire)
|
|
167
|
+
.filter(c => !duProjet.some(e => couvertPar(e.entiers, c.fichiers[0])))
|
|
168
|
+
.map(c => ({ ...c, cadre: true })),
|
|
169
|
+
],
|
|
111
170
|
env: avecLesDonnees(
|
|
112
171
|
donneesDe(copie),
|
|
113
172
|
avecLesOutils(outilsDe(copie), process.env, empreintesDe(copie))
|
|
@@ -128,14 +187,15 @@ function lesCles(copie) {
|
|
|
128
187
|
* then written again by their command once the lot applies without conflict; `refus`, a command
|
|
129
188
|
* that fails. A generated file the lot removes from the key (`encoreDeclares`) follows the lot
|
|
130
189
|
* instead: its deletion is done, any other change applied as a file of the lot, its command not
|
|
131
|
-
* played.
|
|
190
|
+
* played. The output of a command that passes goes to <dire>.
|
|
132
191
|
* @param {string} copie
|
|
133
192
|
* @param {Buffer} lot
|
|
134
193
|
* @param {{ engendres: any[], env: NodeJS.ProcessEnv } | null} [cles]
|
|
135
194
|
* @param {string[]} [autres]
|
|
195
|
+
* @param {(texte: string) => void} [dire]
|
|
136
196
|
* @returns {{ conflits: string[], enAttente: string[], restant: Buffer, refus?: string | null }}
|
|
137
197
|
*/
|
|
138
|
-
function appliquer(copie, lot, cles = null, autres = []) {
|
|
198
|
+
function appliquer(copie, lot, cles = null, autres = [], dire = surStderr) {
|
|
139
199
|
const fichiers = cles ? [...fichiersDuLot(copie, lot), ...autres] : [];
|
|
140
200
|
const touches = cles ? touchesPar(cles.engendres, fichiers) : [];
|
|
141
201
|
const exclus = fichiers.filter(f => touches.some(e => couvertPar(e.entiers, f)));
|
|
@@ -168,7 +228,13 @@ function appliquer(copie, lot, cles = null, autres = []) {
|
|
|
168
228
|
// The generated files the lot removes from the key follow the lot: main's version is not kept.
|
|
169
229
|
// A package.json left in conflict is read at the two versions of its conflict in the index.
|
|
170
230
|
const etage = n => String(git(copie, ['show', `:${n}:package.json`]).stdout);
|
|
171
|
-
|
|
231
|
+
// A reference of the frame is always declared: no key of the project names it.
|
|
232
|
+
const declares = encoreDeclares(
|
|
233
|
+
touches.filter(e => !e.cadre),
|
|
234
|
+
copie,
|
|
235
|
+
() => ({ base: etage(1), lot: etage(3) })
|
|
236
|
+
);
|
|
237
|
+
const vivants = touches.filter(e => e.cadre || declares.includes(e));
|
|
172
238
|
for (const { morceau, noms } of laisses) {
|
|
173
239
|
if (noms.every(f => vivants.some(e => couvertPar(e.entiers, f)))) {
|
|
174
240
|
continue;
|
|
@@ -187,7 +253,7 @@ function appliquer(copie, lot, cles = null, autres = []) {
|
|
|
187
253
|
return { conflits, enAttente, restant };
|
|
188
254
|
}
|
|
189
255
|
const refus = regenerer({
|
|
190
|
-
refs: vivants.map(e => ({ ...e, cadre:
|
|
256
|
+
refs: vivants.map(e => ({ ...e, cadre: Boolean(e.cadre) })),
|
|
191
257
|
lancer: commande =>
|
|
192
258
|
spawnSync('bash', ['-c', commande], {
|
|
193
259
|
cwd: copie,
|
|
@@ -196,6 +262,8 @@ function appliquer(copie, lot, cles = null, autres = []) {
|
|
|
196
262
|
maxBuffer: 1024 * 1024 * 1024,
|
|
197
263
|
}),
|
|
198
264
|
dansCopie: (...args) => spawnSync('git', ['-C', copie, ...args], { encoding: 'utf8' }),
|
|
265
|
+
// A command that says nothing leaves no message.
|
|
266
|
+
ecrire: sortie => void (sortie && dire(sortie)),
|
|
199
267
|
});
|
|
200
268
|
return { conflits, enAttente, restant, refus };
|
|
201
269
|
}
|
|
@@ -219,6 +287,26 @@ function porteDesMarques(copie, f) {
|
|
|
219
287
|
return existsSync(chemin) && /^(<{7}|>{7}) /m.test(readFileSync(chemin, 'latin1'));
|
|
220
288
|
}
|
|
221
289
|
|
|
290
|
+
/**
|
|
291
|
+
* The files of <copie> that still carry the marks of a conflict: those unmerged in its index, those
|
|
292
|
+
* its index holds apart from HEAD (a file a session put in the index with its marks, after a
|
|
293
|
+
* conflict the launcher's advance posed, is no longer unmerged), as pre-commit's
|
|
294
|
+
* check-merge-conflict reads the staged files, and those of <suspects> (the files an earlier
|
|
295
|
+
* advance left in conflict, which the index may no longer say so). Nothing is written: a session's
|
|
296
|
+
* sheet and a refused launch are judged on it.
|
|
297
|
+
* @param {string} copie
|
|
298
|
+
* @param {string[]} [suspects]
|
|
299
|
+
* @returns {string[]}
|
|
300
|
+
*/
|
|
301
|
+
export function marquesRestantes(copie, suspects = []) {
|
|
302
|
+
if (!existsSync(copie)) {
|
|
303
|
+
return [];
|
|
304
|
+
}
|
|
305
|
+
return [...new Set([...enConflit(copie), ...aLIndex(copie), ...suspects])].filter(f =>
|
|
306
|
+
porteDesMarques(copie, f)
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
222
310
|
// The files of <copie> that carry no conflict marker any more, among those unmerged: the work of a
|
|
223
311
|
// session that resolved them. Each goes to the index as resolved; the index is then left as HEAD has
|
|
224
312
|
// it once no conflict remains.
|
|
@@ -267,20 +355,22 @@ export function ecritPar(role, estUnTest) {
|
|
|
267
355
|
}
|
|
268
356
|
|
|
269
357
|
/**
|
|
270
|
-
* The lot from <base> to <pointe> as local work of <copie>; returns `{ ok, message }`.
|
|
358
|
+
* The lot from <base> to <pointe> as local work of <copie>; returns `{ ok, message }`. <dire>
|
|
359
|
+
* receives a fault that does not refuse the lot, and the output of the command of a generated file
|
|
360
|
+
* played again (stderr by default).
|
|
271
361
|
* @param {string} copie
|
|
272
|
-
* @param {{ base: string, pointe: string }} o
|
|
362
|
+
* @param {{ base: string, pointe: string, duCadre?: (copie: string) => any[], dire?: (texte: string) => void }} o
|
|
273
363
|
*/
|
|
274
|
-
export function reporter(copie, { base, pointe }) {
|
|
364
|
+
export function reporter(copie, { base, pointe, duCadre, dire = surStderr }) {
|
|
275
365
|
const d = git(copie, ['diff', '--binary', base, pointe]);
|
|
276
366
|
if (d.status !== 0) {
|
|
277
367
|
return { ok: false, message: `⛔ Le lot de ${base} à ${pointe} ne se lit pas : ${texte(d)}` };
|
|
278
368
|
}
|
|
279
|
-
const cles = lesCles(copie);
|
|
369
|
+
const cles = lesCles(copie, duCadre, dire);
|
|
280
370
|
if (cles.refus !== undefined) {
|
|
281
371
|
return { ok: false, message: cles.refus };
|
|
282
372
|
}
|
|
283
|
-
const a = appliquer(copie, d.stdout, cles);
|
|
373
|
+
const a = appliquer(copie, d.stdout, cles, [], dire);
|
|
284
374
|
if (a.enAttente.length) {
|
|
285
375
|
return {
|
|
286
376
|
ok: false,
|
|
@@ -307,11 +397,13 @@ const conflit = (copie, conflits, entete) =>
|
|
|
307
397
|
* lot waiting is accepted (`ok`) when that role writes one of their files. <suspects>, the files
|
|
308
398
|
* an earlier advance left in conflict: one that still carries its marks counts as in conflict,
|
|
309
399
|
* even when the index no longer says so (a session wrote it, or put it in the index, unresolved).
|
|
400
|
+
* <dire> receives a fault that does not refuse the advance, and the output of the command of a
|
|
401
|
+
* generated file played again (stderr by default).
|
|
310
402
|
* @param {string} copie
|
|
311
403
|
* @param {string} cible
|
|
312
|
-
* @param {{ ecrit?: (fichier: string) => boolean, suspects?: string[] }} [o]
|
|
404
|
+
* @param {{ ecrit?: (fichier: string) => boolean, suspects?: string[], duCadre?: (copie: string) => any[], dire?: (texte: string) => void }} [o]
|
|
313
405
|
*/
|
|
314
|
-
export function avancer(copie, cible, { ecrit, suspects = [] } = {}) {
|
|
406
|
+
export function avancer(copie, cible, { ecrit, suspects = [], duCadre, dire = surStderr } = {}) {
|
|
315
407
|
releverLesResolus(copie);
|
|
316
408
|
const restants = [
|
|
317
409
|
...new Set([...enConflit(copie), ...suspects.filter(f => porteDesMarques(copie, f))]),
|
|
@@ -358,7 +450,7 @@ export function avancer(copie, cible, { ecrit, suspects = [] } = {}) {
|
|
|
358
450
|
enAttente: siens(attendus),
|
|
359
451
|
};
|
|
360
452
|
}
|
|
361
|
-
const cles = lesCles(copie);
|
|
453
|
+
const cles = lesCles(copie, duCadre, dire);
|
|
362
454
|
if (cles.refus !== undefined) {
|
|
363
455
|
return { ok: false, message: cles.refus };
|
|
364
456
|
}
|
|
@@ -413,7 +505,7 @@ export function avancer(copie, cible, { ecrit, suspects = [] } = {}) {
|
|
|
413
505
|
};
|
|
414
506
|
}
|
|
415
507
|
const libres = lignes(git(copie, ['ls-files', '--others', '--exclude-standard']));
|
|
416
|
-
const { conflits, enAttente, restant, refus } = appliquer(copie, d.stdout, cles, libres);
|
|
508
|
+
const { conflits, enAttente, restant, refus } = appliquer(copie, d.stdout, cles, libres, dire);
|
|
417
509
|
if (enAttente.length) {
|
|
418
510
|
writeFileSync(garde, restant);
|
|
419
511
|
} else {
|
|
@@ -460,7 +552,9 @@ const SOUS_MODULES = path.join(import.meta.dirname, '..', 'sous-modules.sh');
|
|
|
460
552
|
* Prepares <copie> for a pass or a session (see the header, `preparer`): with <cible>, the guard of
|
|
461
553
|
* its submodules and its advance to <cible>; then the pose of its submodules, the check of their
|
|
462
554
|
* read-only mount, and the installation when the lock file is newer than it. The output of each
|
|
463
|
-
* command
|
|
555
|
+
* command, the command of a generated file the advance plays again included, and a fault of the
|
|
556
|
+
* advance that does not refuse it, go to the file descriptor <sortie>; returns
|
|
557
|
+
* `{ ok, message, partages }`.
|
|
464
558
|
* @param {string} copie
|
|
465
559
|
* @param {string | null} cible
|
|
466
560
|
* @param {{ env?: NodeJS.ProcessEnv, sortie?: number, ecrit?: (fichier: string) => boolean,
|
|
@@ -490,7 +584,11 @@ export function preparer(copie, cible, { env = process.env, sortie = 2, ecrit, s
|
|
|
490
584
|
if (g.status !== 0) {
|
|
491
585
|
return echec(g, 'La garde des sous-modules');
|
|
492
586
|
}
|
|
493
|
-
const a = avancer(copie, cible, {
|
|
587
|
+
const a = avancer(copie, cible, {
|
|
588
|
+
ecrit,
|
|
589
|
+
suspects,
|
|
590
|
+
dire: texte => void writeSync(sortie, texte),
|
|
591
|
+
});
|
|
494
592
|
if (!a.ok) {
|
|
495
593
|
return { ...a, partages: '' };
|
|
496
594
|
}
|
package/scripts/etapes.mjs
CHANGED
|
@@ -227,7 +227,7 @@ export const GESTES = [
|
|
|
227
227
|
genre: 'rien-a-livrer',
|
|
228
228
|
geste: 'aux contrôles, qui jugent le lot',
|
|
229
229
|
regle:
|
|
230
|
-
'un développeur qui ne change aucun fichier du plan n’a rien à livrer quand les contrôles sont verts ; rouges, l’arrêt monte (sans-livraison), sauf le rouge d’une référence que le lot fait baisser, la dette des gardes, qui se régénère au lieu d’arrêter ; sur le lot que l’intégration refuse, pour un développeur que --depuis developpeur lance, le geste ne joue pas : il est relancé une fois avec le refus',
|
|
230
|
+
'un développeur qui ne change aucun fichier du plan n’a rien à livrer quand les contrôles sont verts ; rouges, l’arrêt monte (sans-livraison), sauf le rouge d’une référence que le lot fait baisser, la dette des gardes, qui se régénère au lieu d’arrêter, et le rouge qui nomme un fichier de test du lot, qui va au testwriter ; sur le lot que l’intégration refuse, pour un développeur que --depuis developpeur lance, le geste ne joue pas : il est relancé une fois avec le refus',
|
|
231
231
|
cas: 'BP 320.9 : 995-tools n’a rien à livrer, 4 montées et 49 min (B5)',
|
|
232
232
|
},
|
|
233
233
|
{
|
|
@@ -259,7 +259,7 @@ export const RESPONSABLE = 'responsable';
|
|
|
259
259
|
// The commands by which the supervisor answers a question (scripts/circuit.mjs): resume, extend
|
|
260
260
|
// the plan, stop.
|
|
261
261
|
export const REPONSES =
|
|
262
|
-
'Le superviseur répond par une commande du circuit : `--reprendre` (avec `--contexte`) ou `--depuis <testwriter|developpeur>` (avec `--contexte`), `--mecanique [<commande>]` (avec `--contexte` : à l’arrêt du testwriter qui ne trouve aucun comportement à tester, le ticket bascule en circuit court sur le même plan, vers 1.1 avec sa commande, vers le développeur sans elle), `--etendre <paquet>` (le plan gagne ce paquet, puis l’étape en cours reprend), `--reporter <heure>` (la question se tait jusqu’à l’heure, le circuit en attente), ou `--arreter`.';
|
|
262
|
+
'Le superviseur répond par une commande du circuit : `--reprendre` (avec `--contexte`) ou `--depuis <testwriter|developpeur>` (avec `--contexte`), `--mecanique [<commande>]` (avec `--contexte` : à l’arrêt du testwriter qui ne trouve aucun comportement à tester, ou de la preuve du rouge qui refuse le lot de tests, le ticket bascule en circuit court sur le même plan, vers 1.1 avec sa commande, vers le développeur sans elle), `--etendre <paquet>` (le plan gagne ce paquet, puis l’étape en cours reprend), `--reporter <heure>` (la question se tait jusqu’à l’heure, le circuit en attente), ou `--arreter`.';
|
|
263
263
|
|
|
264
264
|
// The question of each stop no gesture settles, as a CI calls a person only for what no rule
|
|
265
265
|
// settles (the approval of a review): every stop of ARRETS, « a-repasser » once the circuit has
|
|
@@ -279,7 +279,7 @@ export const MONTEES = Object.fromEntries(
|
|
|
279
279
|
'sans-fiche':
|
|
280
280
|
'La séance finit deux fois sans fiche conforme : reprendre l’étape, ou arrêter le circuit ?',
|
|
281
281
|
preuve:
|
|
282
|
-
'La troisième preuve du rouge refuse le lot de tests : quel contexte donner au testwriter, ou le plan doit-il changer ?',
|
|
282
|
+
'La troisième preuve du rouge refuse le lot de tests : quel contexte donner au testwriter, le lot n’a-t-il aucun comportement à prouver (`--mecanique`), ou le plan doit-il changer ?',
|
|
283
283
|
controles:
|
|
284
284
|
'Un rouge reste, que le circuit ne rend pas au développeur (hors du plan, sans fichier, à arbitrer, le lot d’un geste mécanique), ou que trois séances n’ont pas levé : avec quel contexte le lever, ou le plan doit-il s’étendre ?',
|
|
285
285
|
'sans-livraison':
|
|
@@ -95,6 +95,7 @@ import {
|
|
|
95
95
|
ouvrirLeDefautDeMain,
|
|
96
96
|
} from './ci-de-main.mjs';
|
|
97
97
|
|
|
98
|
+
import { rougesDUnePasse } from './activites.mjs';
|
|
98
99
|
import { ecrireLEffet } from './effets.mjs';
|
|
99
100
|
import { Arret, commenter, geste } from './ticket-du-circuit.mjs';
|
|
100
101
|
import { arretDeLaLimiteDUsage, MEMOIRE } from './transitions.mjs';
|
|
@@ -154,9 +155,14 @@ function leContexte(ticket, memoire = {}, options = {}) {
|
|
|
154
155
|
|
|
155
156
|
// The tools of the queue on the main tree <racine> (the act plays there), its lines on the error
|
|
156
157
|
// output, the progress directory <avancement> of a reading of the CI, the effects it emits
|
|
157
|
-
// gathered (`rendus`), which the act gives back.
|
|
158
|
+
// gathered (`rendus`), which the act gives back. Its final pass reads its reds as the checks of the
|
|
159
|
+
// circuit do (`rougesDUnePasse`), the port every tool of the queue is built with.
|
|
160
|
+
const outilsDeLActe = (racine, avancement = null) =>
|
|
161
|
+
outilsDeLaFile(racine, l => process.stderr.write(`${l}\n`), avancement, {
|
|
162
|
+
rouges: rougesDUnePasse,
|
|
163
|
+
});
|
|
158
164
|
const laFile = (racine, avancement = null) => {
|
|
159
|
-
const o =
|
|
165
|
+
const o = outilsDeLActe(racine, avancement);
|
|
160
166
|
o.rendus = [];
|
|
161
167
|
return o;
|
|
162
168
|
};
|
|
@@ -180,7 +186,7 @@ const arretDeLEtat = (ctx, code, etat) => ({
|
|
|
180
186
|
});
|
|
181
187
|
|
|
182
188
|
// The options of a run on the supervisor's answer <reponse>.
|
|
183
|
-
const optionsDe = reponse => {
|
|
189
|
+
export const optionsDe = reponse => {
|
|
184
190
|
if (!reponse) {
|
|
185
191
|
return {};
|
|
186
192
|
}
|
|
@@ -499,14 +505,9 @@ Object.assign(ACTES, {
|
|
|
499
505
|
// One effect an act of the queue gave back, under the key of its activity, with the outcome of
|
|
500
506
|
// the queue when it is not written (`ecrireLEffet`).
|
|
501
507
|
async 'effet-de-la-file'({ racine, effet, cle, derniere }) {
|
|
502
|
-
ecrireLEffet(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
cle,
|
|
506
|
-
{
|
|
507
|
-
reessayer: derniere === false,
|
|
508
|
-
}
|
|
509
|
-
);
|
|
508
|
+
ecrireLEffet(outilsDeLActe(racine), effet, cle, {
|
|
509
|
+
reessayer: derniere === false,
|
|
510
|
+
});
|
|
510
511
|
return null;
|
|
511
512
|
},
|
|
512
513
|
});
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
/** What the command of closure does on the reservation in place. */
|
|
5
5
|
export function decisionDeFermeture(
|
|
6
|
-
reservation:
|
|
7
|
-
): 'fermer' | 'deja-fermee'
|
|
6
|
+
reservation: object | null | undefined
|
|
7
|
+
): 'fermer' | 'deja-fermee';
|
|
8
8
|
|
|
9
9
|
/** What the command of reopening does on the reservation in place. */
|
|
10
10
|
export function decisionDeReouverture(
|
|
11
|
-
reservation:
|
|
12
|
-
): 'rouvrir' | 'deja-ouverte'
|
|
11
|
+
reservation: object | null | undefined
|
|
12
|
+
): 'rouvrir' | 'deja-ouverte';
|
|
13
13
|
|
|
14
14
|
/** What still runs by project and by ticket, or « la machine est vide ». */
|
|
15
15
|
export function direCeQuiTourne(o: {
|
|
@@ -9,29 +9,22 @@ import { duree } from './regles-des-places.mjs';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* What the command of closure does on the reservation <reservation> of the machine (null without):
|
|
12
|
-
* `'fermer'` when none stands, `'deja-fermee'` under the supervisor's
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
* @returns {'fermer' | 'deja-fermee' | 'nuit-tient'}
|
|
12
|
+
* `'fermer'` when none stands, `'deja-fermee'` under the supervisor's closure.
|
|
13
|
+
* @param {object | null | undefined} reservation
|
|
14
|
+
* @returns {'fermer' | 'deja-fermee'}
|
|
16
15
|
*/
|
|
17
16
|
export function decisionDeFermeture(reservation) {
|
|
18
|
-
|
|
19
|
-
return 'fermer';
|
|
20
|
-
}
|
|
21
|
-
return reservation.auteur === 'superviseur' ? 'deja-fermee' : 'nuit-tient';
|
|
17
|
+
return reservation ? 'deja-fermee' : 'fermer';
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
/**
|
|
25
21
|
* What the command of reopening does on the reservation <reservation>: `'rouvrir'` the supervisor's
|
|
26
|
-
* closure, `'deja-ouverte'` when none stands
|
|
27
|
-
* @param {
|
|
28
|
-
* @returns {'rouvrir' | 'deja-ouverte'
|
|
22
|
+
* closure, `'deja-ouverte'` when none stands.
|
|
23
|
+
* @param {object | null | undefined} reservation
|
|
24
|
+
* @returns {'rouvrir' | 'deja-ouverte'}
|
|
29
25
|
*/
|
|
30
26
|
export function decisionDeReouverture(reservation) {
|
|
31
|
-
|
|
32
|
-
return 'deja-ouverte';
|
|
33
|
-
}
|
|
34
|
-
return reservation.auteur === 'superviseur' ? 'rouvrir' : 'nuit-tient';
|
|
27
|
+
return reservation ? 'rouvrir' : 'deja-ouverte';
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
// The folder name of a root of project, « alpha » for « /depots/alpha ».
|
|
@@ -77,9 +70,8 @@ export function direCeQuiTourne({ prises, parts }) {
|
|
|
77
70
|
}
|
|
78
71
|
|
|
79
72
|
/**
|
|
80
|
-
* The lines a command says once it has played: its <issue> (`fermee`, `deja-fermee
|
|
81
|
-
*
|
|
82
|
-
* or a night that holds the machine, what still runs. <reservation> is the one in place after the
|
|
73
|
+
* The lines a command says once it has played: its <issue> (`fermee`, `deja-fermee` for the
|
|
74
|
+
* closure; `rouverte`, `deja-ouverte` for the reopening), then, for a closure, what still runs. <reservation> is the one in place after the
|
|
83
75
|
* command (its start gives how long the closure has lasted), <maintenant> the time in ms.
|
|
84
76
|
* @param {{ issue: string, reservation: { depuis: number } | null,
|
|
85
77
|
* prises: Parameters<typeof direCeQuiTourne>[0]['prises'],
|
|
@@ -96,8 +88,6 @@ export function direLaFermeture({ issue, reservation, prises, parts, maintenant
|
|
|
96
88
|
`machine déjà fermée par le superviseur, depuis ${reservation ? duree(maintenant - reservation.depuis) : '?'}`,
|
|
97
89
|
...tourne,
|
|
98
90
|
];
|
|
99
|
-
case 'nuit-tient':
|
|
100
|
-
return ['la nuit tient la machine : elle garde sa réservation, aucune autre n’est prise', ...tourne];
|
|
101
91
|
case 'rouverte':
|
|
102
92
|
return ['machine rouverte : les circuits reprennent d’eux-mêmes à l’étape suivante'];
|
|
103
93
|
case 'deja-ouverte':
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// in its « Architecture » section or in an acceptance criterion. A file named there is one the
|
|
3
3
|
// ticket's plan covers by its own word: a write out of the plan in it extends the plan, with the
|
|
4
4
|
// piece that names it. A parent directory, a base name alone, another section, and the documents
|
|
5
|
-
// the responsable owns (ARCHITECTURE.md, CADRE.md, INTERFACE.md) are not named.
|
|
5
|
+
// the responsable owns (ARCHITECTURE.md, CADRE.md, INTERFACE.md) are not named. The plan keeps the
|
|
6
|
+
// component of the title that holds a file named there (`fichiersNommesAuTicket`).
|
|
6
7
|
|
|
7
8
|
const DOCUMENTS_DU_RESPONSABLE = /(^|\/)(ARCHITECTURE|CADRE|INTERFACE)\.md$/;
|
|
8
9
|
|
|
@@ -53,3 +54,28 @@ export function fichierNommeAuTicket(description, chemin) {
|
|
|
53
54
|
}
|
|
54
55
|
return null;
|
|
55
56
|
}
|
|
57
|
+
|
|
58
|
+
// The words of a description that may be a path: what its delimiters (`figureDans`) leave.
|
|
59
|
+
const MOTS = /[^\s`'"()[\],;:]+/g;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The files the description <description> names (`{ chemin, piece }`, in their order, each once):
|
|
63
|
+
* those of its words that <estUnFichier> says a file of the repository, by its path from the root,
|
|
64
|
+
* and that `fichierNommeAuTicket` reads as named.
|
|
65
|
+
*/
|
|
66
|
+
export function fichiersNommesAuTicket(description, estUnFichier) {
|
|
67
|
+
const vus = new Set();
|
|
68
|
+
const nommes = [];
|
|
69
|
+
for (const [mot] of String(description ?? '').matchAll(MOTS)) {
|
|
70
|
+
const chemin = mot.replace(/\.$/, '');
|
|
71
|
+
if (vus.has(chemin) || chemin.startsWith('/') || chemin.startsWith('..')) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
vus.add(chemin);
|
|
75
|
+
const nomme = estUnFichier(chemin) ? fichierNommeAuTicket(description, chemin) : null;
|
|
76
|
+
if (nomme) {
|
|
77
|
+
nommes.push({ chemin, piece: nomme.piece });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return nommes;
|
|
81
|
+
}
|
|
@@ -18,9 +18,26 @@ export function aSonArchitecture(t: { description?: string }): boolean;
|
|
|
18
18
|
/** The tickets of <tous> that start now, in the order they start. */
|
|
19
19
|
export function ticketsAPartir<T extends TicketDeBeads>(
|
|
20
20
|
tous: T[],
|
|
21
|
-
o?: {
|
|
21
|
+
o?: {
|
|
22
|
+
enCours?: Set<string>;
|
|
23
|
+
externes?: Record<string, TicketDeBeads[]>;
|
|
24
|
+
surMain?: (id: string) => boolean;
|
|
25
|
+
}
|
|
22
26
|
): T[];
|
|
23
27
|
|
|
28
|
+
/** The tickets of <tous> in the queue that never start because their lot is on main. */
|
|
29
|
+
export function enFileSurMain<T extends TicketDeBeads>(
|
|
30
|
+
tous: T[],
|
|
31
|
+
o?: {
|
|
32
|
+
enCours?: Set<string>;
|
|
33
|
+
externes?: Record<string, TicketDeBeads[]>;
|
|
34
|
+
surMain?: (id: string) => boolean;
|
|
35
|
+
}
|
|
36
|
+
): T[];
|
|
37
|
+
|
|
38
|
+
/** Whether the lot of a ticket is on the main of the main tree <racine>, as a function of its id. */
|
|
39
|
+
export function lotEstSurMain(racine: string): (id: string) => boolean;
|
|
40
|
+
|
|
24
41
|
/**
|
|
25
42
|
* What each ticket of the queue waits for from another project (`external:<project>:<capability>`
|
|
26
43
|
* not delivered by a closed ticket `provides:<capability>`); `faute` names a project that
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
// - A circuit alive whose ticket was closed outside it (delivered directly) holds no place: the
|
|
17
17
|
// queue stops it (`fermesHorsCircuit`).
|
|
18
18
|
// - A ticket whose dependency is open stays: the board says « attend <ticket> » (scripts/tableau.mjs).
|
|
19
|
+
// - A ticket whose lot is on main never starts again, left open or reopened, as a merge queue
|
|
20
|
+
// drops a merged entry whatever the state of its ticket (bors, GitHub's merge queue): work to
|
|
21
|
+
// do again on an integrated lot is a new ticket, and a lot withdrawn by a revert starts again.
|
|
22
|
+
// `lotEstSurMain` reads it (the one rule `lotSurMain` of ./integration/integrer.mjs), for a
|
|
23
|
+
// ticket that would start alone; `enFileSurMain` names it, for the board and the opening of
|
|
24
|
+
// the supervisor, who closes it.
|
|
19
25
|
// - A dependency on another project (`external:<project>:<capability>`, Beads' cross-project
|
|
20
26
|
// dependency) holds the ticket until the provider delivered the capability: a closed ticket of
|
|
21
27
|
// that project labelled `provides:<capability>` (which `bd ship` sets; `export:` alone does
|
|
@@ -25,6 +31,7 @@
|
|
|
25
31
|
import { spawnSync } from 'node:child_process';
|
|
26
32
|
import path from 'node:path';
|
|
27
33
|
import { ETAPES } from './etapes.mjs';
|
|
34
|
+
import { lotSurMain } from './integration/integrer.mjs';
|
|
28
35
|
|
|
29
36
|
// Whether the description of <t> holds its section « ## Architecture »: the rule the queue and the
|
|
30
37
|
// board both read.
|
|
@@ -89,29 +96,40 @@ export function attendDeLAutreProjet(t, externes) {
|
|
|
89
96
|
}));
|
|
90
97
|
}
|
|
91
98
|
|
|
99
|
+
// The tickets of <tous> in the queue that nothing of Beads holds: their section written, every
|
|
100
|
+
// dependency closed, every capability of another project delivered.
|
|
101
|
+
const prets = (tous, enCours, externes) => {
|
|
102
|
+
const fermes = new Set(tous.filter(t => t.status === 'closed').map(t => t.id));
|
|
103
|
+
return enFile(tous, enCours).filter(
|
|
104
|
+
t =>
|
|
105
|
+
aSonArchitecture(t) &&
|
|
106
|
+
(t.dependencies ?? []).every(
|
|
107
|
+
d =>
|
|
108
|
+
d.type !== 'blocks' ||
|
|
109
|
+
(d.depends_on_id.startsWith('external:') ? true : fermes.has(d.depends_on_id))
|
|
110
|
+
) &&
|
|
111
|
+
dependancesExternes(t).every(d => livree(externes, d.projet, d.capacite))
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
92
115
|
/**
|
|
93
116
|
* The tickets of <tous> that start now, in the order they start.
|
|
94
117
|
* @param {Array<{ id: string, status: string, priority?: number, labels?: string[],
|
|
95
118
|
* created_at?: string, description?: string,
|
|
96
119
|
* dependencies?: Array<{ type: string, depends_on_id: string }> }>} tous
|
|
97
120
|
* every ticket of the project, the closed ones too
|
|
98
|
-
* @param {{ enCours?: Set<string>, externes?: Record<string, typeof tous
|
|
99
|
-
*
|
|
121
|
+
* @param {{ enCours?: Set<string>, externes?: Record<string, typeof tous>,
|
|
122
|
+
* surMain?: (id: string) => boolean }} [o] `enCours`, the tickets whose circuit already runs;
|
|
123
|
+
* `externes`, the tickets of each other project by its name; `surMain`, whether the lot of a
|
|
124
|
+
* ticket is on main (`lotEstSurMain`), asked for a ticket that would start alone
|
|
100
125
|
* @returns {typeof tous}
|
|
101
126
|
*/
|
|
102
|
-
export function ticketsAPartir(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
(t.dependencies ?? []).every(
|
|
109
|
-
d =>
|
|
110
|
-
d.type !== 'blocks' ||
|
|
111
|
-
(d.depends_on_id.startsWith('external:') ? true : fermes.has(d.depends_on_id))
|
|
112
|
-
) &&
|
|
113
|
-
dependancesExternes(t).every(d => livree(externes, d.projet, d.capacite))
|
|
114
|
-
)
|
|
127
|
+
export function ticketsAPartir(
|
|
128
|
+
tous,
|
|
129
|
+
{ enCours = new Set(), externes, surMain = () => false } = {}
|
|
130
|
+
) {
|
|
131
|
+
return prets(tous, enCours, externes)
|
|
132
|
+
.filter(t => !surMain(t.id))
|
|
115
133
|
.sort(
|
|
116
134
|
(a, b) =>
|
|
117
135
|
(a.priority ?? 2) - (b.priority ?? 2) ||
|
|
@@ -120,6 +138,36 @@ export function ticketsAPartir(tous, { enCours = new Set(), externes } = {}) {
|
|
|
120
138
|
);
|
|
121
139
|
}
|
|
122
140
|
|
|
141
|
+
/**
|
|
142
|
+
* The tickets of <tous> in the queue that never start because their lot is on main, sorted by id:
|
|
143
|
+
* those nothing else holds, as `ticketsAPartir` leaves them out.
|
|
144
|
+
* @param {Parameters<typeof ticketsAPartir>[0]} tous every ticket of the project
|
|
145
|
+
* @param {Parameters<typeof ticketsAPartir>[1]} [o]
|
|
146
|
+
* @returns {typeof tous}
|
|
147
|
+
*/
|
|
148
|
+
export function enFileSurMain(tous, { enCours = new Set(), externes, surMain = () => false } = {}) {
|
|
149
|
+
return prets(tous, enCours, externes)
|
|
150
|
+
.filter(t => surMain(t.id))
|
|
151
|
+
.sort((a, b) => a.id.localeCompare(b.id, 'en', { numeric: true }));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Whether the lot of a ticket is on the main of the main tree <racine> (`lotSurMain`), as a
|
|
156
|
+
* function of its id; a prefix of the tickets that does not read holds no ticket, the circuit
|
|
157
|
+
* naming that fault.
|
|
158
|
+
* @param {string} racine
|
|
159
|
+
* @returns {(id: string) => boolean}
|
|
160
|
+
*/
|
|
161
|
+
export function lotEstSurMain(racine) {
|
|
162
|
+
return id => {
|
|
163
|
+
try {
|
|
164
|
+
return lotSurMain({ racine }, id) !== null;
|
|
165
|
+
} catch {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
123
171
|
// The states of the steps of the integration (5.1, 5.2, 5.3): the circuit's own queue closes the
|
|
124
172
|
// ticket at 5.2, then the circuit sorts its discoveries and ends.
|
|
125
173
|
const DE_L_INTEGRATION = new Set(
|