Skip to content

Commit 6735ac8

Browse files
committed
test(cli): the durability pin names NODE_ENV at each spawn; ledger notes drop the tracker id
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyhB3ePno23ywn1PQd
1 parent ce60334 commit 6735ac8

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎packages/cli/test/start-deployment-durability.integration.test.ts‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,14 @@ function tmp(prefix: string): string {
7474
return d;
7575
}
7676

77-
/** The env every run starts from: no variable of any spelling the subject reads. */
78-
function baseEnv(home: string, over: Record<string, string | undefined> = {}) {
79-
return childEnv({
77+
/**
78+
* The overrides every run starts from: no variable of any spelling the subject
79+
* reads. Each spawn hands them to `childEnv` itself, with `NODE_ENV` unset as
80+
* the last word, so the child's posture is readable at the call
81+
* (`check:cli-test-child-env`).
82+
*/
83+
function baseEnv(home: string, over: Record<string, string | undefined> = {}): Record<string, string | undefined> {
84+
return {
8085
NO_COLOR: '1',
8186
HOME: home,
8287
OS_CLOUD_URL: 'off',
@@ -102,11 +107,10 @@ function baseEnv(home: string, over: Record<string, string | undefined> = {}) {
102107
BETTER_AUTH_SECRET: undefined,
103108
OS_CLUSTER_DRIVER: undefined,
104109
OS_MODE: undefined,
105-
NODE_ENV: undefined,
106110
OS_PORT: undefined,
107111
PORT: undefined,
108112
...over,
109-
});
113+
};
110114
}
111115

112116
/** Everything under `dir`, recursively, as relative paths. */
@@ -123,11 +127,11 @@ interface Live {
123127
output: () => string;
124128
}
125129

126-
function boot(what: string, cwd: string, env: Record<string, string | undefined>): Promise<Live> {
130+
function boot(what: string, cwd: string, over: Record<string, string | undefined>): Promise<Live> {
127131
return new Promise((resolveBoot, rejectBoot) => {
128132
const child = spawn(process.execPath, [CLI, 'start', '--port', KERNEL_ASSIGNED_PORT], {
129133
cwd,
130-
env,
134+
env: childEnv({ ...over, NODE_ENV: undefined }),
131135
stdio: ['ignore', 'pipe', 'pipe'],
132136
detached: true,
133137
});
@@ -257,7 +261,7 @@ describe('#30120 — with the image switch on, a start missing its settings refu
257261
const cwd = tmp('os-30120-cwd-');
258262
const run = spawnSync(process.execPath, [CLI, 'start', '--port', KERNEL_ASSIGNED_PORT], {
259263
cwd,
260-
env: baseEnv(home, { [SWITCH]: 'true', ...over }),
264+
env: childEnv({ ...baseEnv(home, { [SWITCH]: 'true', ...over }), NODE_ENV: undefined }),
261265
encoding: 'utf8',
262266
timeout: 120_000,
263267
});

‎packages/services/service-settings/src/settings-route-ledger.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const SETTINGS_ROUTE_LEDGER: readonly SettingsRouteLedgerEntry[] = [
8181
{ route: 'POST /api/settings/:namespace/:actionId', family: 'settings', disposition: 'server-only',
8282
note: 'invoke an action the namespace manifest declares (test-connection probes and the like), not a data write' },
8383
{ route: 'GET /api/settings/deployment/notice', family: 'settings', disposition: 'server-only',
84-
note: '[#30120] what a production deployment keeps on its own disk by default, for administrators (manage_platform_settings) — the Console home and System Overview notice' },
84+
note: 'what a production deployment keeps on its own disk by default, for administrators (manage_platform_settings) — the Console home and System Overview notice' },
8585
{ route: 'POST /api/settings/deployment/notice/hide', family: 'settings', disposition: 'server-only',
86-
note: '[#30120] an administrator acknowledges the current notice; writes a config_change row to sys_audit_log, refused where no audit log is mounted' },
86+
note: 'an administrator acknowledges the current notice; writes a config_change row to sys_audit_log, refused where no audit log is mounted' },
8787
];

0 commit comments

Comments
 (0)