@bongos/core 1.19.398 → 1.19.400
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/.bongos-core.json +47 -27
- package/clients/bongos-client/README.md +1 -1
- package/clients/bongos-client/bongos-client.global.js +2 -0
- package/clients/bongos-client/index.cjs +2 -0
- package/clients/bongos-client/index.d.ts +3 -0
- package/clients/bongos-client/index.mjs +2 -0
- package/docs/adr/0199-restart-an-unreachable-active-project.md +49 -0
- package/docs/adr/README.md +1 -0
- package/docs/api/openapi.json +74 -3
- package/docs/api-reference.md +3 -2
- package/modules/dev-box/app/src/vendor/bongos-client.cjs +2 -0
- package/modules/provisioning/migrations/provisioning_011_restart.sql +28 -0
- package/modules/provisioning/provisioning.js +42 -4
- package/modules/provisioning/routes/provisioning.js +59 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/public-landing/projects.html +124 -6
- package/scripts/gds/provision.js +104 -0
- package/src/module-api.js +5 -1
- package/tests/projects_hub_pre_uat.mjs +77 -0
- package/tests/provision_restart.mjs +242 -0
- package/tests/provisioning_restart.mjs +285 -0
- package/tests/provisioning_settings_apply.mjs +8 -3
- package/tests/provisioning_teardown_intent.mjs +9 -5
|
@@ -30,6 +30,9 @@ import http from 'node:http';
|
|
|
30
30
|
const require = createRequire(import.meta.url);
|
|
31
31
|
const provisioning = require('../modules/provisioning/provisioning.js');
|
|
32
32
|
|
|
33
|
+
// The actions a teardown supersedes, mirroring enqueueTeardown's SQL.
|
|
34
|
+
const SUPERSEDABLE = new Set(['provision', 'settings-apply', 'restart']);
|
|
35
|
+
|
|
33
36
|
let passed = 0, failed = 0;
|
|
34
37
|
function t(name, fn) {
|
|
35
38
|
try { fn(); passed++; console.log(` PASS ${name}`); }
|
|
@@ -65,12 +68,13 @@ function fakeIntentDb(seed = []) {
|
|
|
65
68
|
}
|
|
66
69
|
if (/UPDATE provisioning_intents/.test(sql) && /state = 'error'/.test(sql)) {
|
|
67
70
|
// The supersede's guard must live in the SQL itself: pending-only (a running
|
|
68
|
-
// intent is the runner's mid-flight work) and
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
|
|
71
|
+
// intent is the runner's mid-flight work) and only the actions that become
|
|
72
|
+
// dead work in front of a teardown (task 1003140 widened it to the settings
|
|
73
|
+
// push, task 1003238 to the restart; an open teardown is left alone for the
|
|
74
|
+
// idempotent path).
|
|
75
|
+
assert.match(sql, /action IN \('provision', 'settings-apply', 'restart'\) AND state = 'pending'/);
|
|
72
76
|
const hit = rows.filter((r) =>
|
|
73
|
-
String(r.instance_id) === String(params[0]) && (r.action
|
|
77
|
+
String(r.instance_id) === String(params[0]) && SUPERSEDABLE.has(r.action) && r.state === 'pending');
|
|
74
78
|
for (const r of hit) { r.state = 'error'; r.last_error = 'superseded: teardown requested'; }
|
|
75
79
|
return { rows: hit.map((r) => ({ id: r.id })) };
|
|
76
80
|
}
|