@bongos/core 1.24.84 → 1.24.86
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 +30 -30
- package/docs/copy-inventory.md +17 -16
- package/docs/copy-registry.json +26 -17
- package/docs/module-api-changelog.md +4 -0
- package/docs/page-readings.json +194 -194
- package/docs/recipes/autobongos-runner-setup.md +1 -0
- package/modules/hall-ui/public/craft-mode.js +4 -1
- package/modules/hall-ui/public/options-menu.js +4 -0
- package/modules/hall-ui/public/settings.css +15 -0
- package/modules/hall-ui/public/shell-game.js +82 -2
- package/modules/hall-ui/public/style.css +32 -0
- package/modules/hall-ui/records/options-menu.md +7 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +12 -0
- package/scripts/bongos/autobongos-bootstrap.sh +24 -2
- package/scripts/bongos/autobongos-host.js +32 -2
- package/scripts/bongos/wedge-remedy.js +9 -2
- package/src/module-api.js +1 -1
- package/tests/autobongos_host.mjs +33 -0
- package/tests/hall_options_menu.mjs +63 -4
- package/tests/page_notes_panel.mjs +9 -1
- package/tests/shell_stat_portability.mjs +34 -0
- package/tests/ship_vendored_instance.mjs +5 -1
- package/tests/update_sweep_home.mjs +11 -5
- package/tests/wedge_remedy.mjs +5 -1
|
@@ -14,7 +14,7 @@ import { test } from 'node:test';
|
|
|
14
14
|
import assert from 'node:assert/strict';
|
|
15
15
|
import { createRequire } from 'node:module';
|
|
16
16
|
import { spawnSync } from 'node:child_process';
|
|
17
|
-
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
17
|
+
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, realpathSync } from 'node:fs';
|
|
18
18
|
import { tmpdir } from 'node:os';
|
|
19
19
|
import path from 'node:path';
|
|
20
20
|
import { fileURLToPath } from 'node:url';
|
|
@@ -23,6 +23,12 @@ const require = createRequire(import.meta.url);
|
|
|
23
23
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
24
24
|
const SWEEP = path.join(ROOT, 'scripts', 'bongos', 'update-sweep.js');
|
|
25
25
|
const sweep = require(SWEEP);
|
|
26
|
+
|
|
27
|
+
// A temp folder the code under test and this test can BOTH name the same way (task 1005096).
|
|
28
|
+
// On a Mac os.tmpdir() is /var/folders/…, a symlink to /private/var/folders/…: anything that
|
|
29
|
+
// resolves a real path — as the sweep's resolver and git both do — answers the /private form,
|
|
30
|
+
// and the comparison failed on every Mac while passing on CI's Linux, which has no such link.
|
|
31
|
+
const tmpRoot = (prefix) => realpathSync(mkdtempSync(path.join(tmpdir(), prefix)));
|
|
26
32
|
const { isPublishable } = require('../scripts/bongos/publish-manifest.js');
|
|
27
33
|
|
|
28
34
|
test('the sweep and every core file it requires are in the published package', () => {
|
|
@@ -50,7 +56,7 @@ test('its target-instance resolver searches the same packages, in the same order
|
|
|
50
56
|
});
|
|
51
57
|
|
|
52
58
|
test('coreModulePathFrom finds a target instance\'s INSTALLED core, root first', () => {
|
|
53
|
-
const inst =
|
|
59
|
+
const inst = tmpRoot('sweep-home-');
|
|
54
60
|
const pkg = path.join(inst, 'node_modules', '@bongos', 'core', 'scripts', 'bongos');
|
|
55
61
|
mkdirSync(pkg, { recursive: true });
|
|
56
62
|
writeFileSync(path.join(pkg, 'upgrade.js'), '');
|
|
@@ -62,11 +68,11 @@ test('coreModulePathFrom finds a target instance\'s INSTALLED core, root first',
|
|
|
62
68
|
});
|
|
63
69
|
|
|
64
70
|
test('run from elsewhere, it reads the roster named by --instance and says which core is sweeping', () => {
|
|
65
|
-
const rosterRoot =
|
|
71
|
+
const rosterRoot = tmpRoot('sweep-roster-');
|
|
66
72
|
mkdirSync(path.join(rosterRoot, 'config'));
|
|
67
73
|
writeFileSync(path.join(rosterRoot, 'config', 'update-subscriptions.json'),
|
|
68
74
|
JSON.stringify({ instances: [{ slug: 'held', dir: path.join(rosterRoot, 'nowhere'), channel: 'pinned' }] }));
|
|
69
|
-
const cwd =
|
|
75
|
+
const cwd = tmpRoot('sweep-cwd-');
|
|
70
76
|
const r = spawnSync(process.execPath, [SWEEP, '--instance', rosterRoot], { cwd, encoding: 'utf8', env: { ...process.env, DATABASE_URL: '', PGDATABASE: '' } });
|
|
71
77
|
assert.equal(r.status, 0, r.stderr);
|
|
72
78
|
assert.match(r.stdout, new RegExp(`update-sweep · running from .+ \\(core \\d+\\.\\d+\\.\\d+\\) · roster ${rosterRoot.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')}`));
|
|
@@ -75,7 +81,7 @@ test('run from elsewhere, it reads the roster named by --instance and says which
|
|
|
75
81
|
});
|
|
76
82
|
|
|
77
83
|
test('without --instance it reads the roster in its working directory (the unit\'s WorkingDirectory)', () => {
|
|
78
|
-
const cwd =
|
|
84
|
+
const cwd = tmpRoot('sweep-cwd-');
|
|
79
85
|
const r = spawnSync(process.execPath, [SWEEP], { cwd, encoding: 'utf8', env: { ...process.env, DATABASE_URL: '', PGDATABASE: '' } });
|
|
80
86
|
assert.equal(r.status, 0, r.stderr);
|
|
81
87
|
assert.match(r.stdout, /no roster file — nothing subscribed/);
|
package/tests/wedge_remedy.mjs
CHANGED
|
@@ -75,7 +75,11 @@ await t('a cloud-host project is fixed in ITS folder, not the control plane\'s',
|
|
|
75
75
|
await t('disk full: prunes only THIS database\'s dumps, keeping the newest week', () => {
|
|
76
76
|
const p = W.planRemedy(inst(), 'disk_full', { selfRoot, backupDir: '/var/backups/gds' });
|
|
77
77
|
assert.match(p.cmd, /^find \/var\/backups\/gds -maxdepth 1 -type f -name 'charter-\[0-9\]/);
|
|
78
|
-
|
|
78
|
+
// All-but-the-last-K in POSIX awk, never `head -n -K`: that is a GNU extension BSD/macOS
|
|
79
|
+
// head refuses outright, so the pipeline deleted nothing on a Mac (task 1005096).
|
|
80
|
+
assert.match(p.cmd, new RegExp(`awk -v k=${W.DUMP_KEEP_FLOOR} `));
|
|
81
|
+
assert.match(p.cmd, /\| xargs rm -f --$/);
|
|
82
|
+
assert.doesNotMatch(p.cmd, /head -n -/, 'GNU-only; BSD head answers "illegal line count"');
|
|
79
83
|
assert.equal(W.DUMP_KEEP_FLOOR, 7);
|
|
80
84
|
});
|
|
81
85
|
|