mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
@@ -15,6 +15,7 @@ import { assertReleaseContract } from './release-contract.mjs';
|
||||
import { classifyValidateRuns } from './release-gate.mjs';
|
||||
|
||||
const sleep = (ms) => new Promise((done) => setTimeout(done, ms));
|
||||
const SUBPROCESS_MAX_BUFFER = 64 * 1024 * 1024;
|
||||
|
||||
class ReleaseAssetContentError extends Error {}
|
||||
|
||||
@@ -192,6 +193,7 @@ if (invokedDirectly) {
|
||||
const result = spawnSync(command, commandArgs, {
|
||||
cwd,
|
||||
encoding: 'utf8',
|
||||
maxBuffer: SUBPROCESS_MAX_BUFFER,
|
||||
stdio: inherit ? 'inherit' : ['ignore', 'pipe', 'pipe'],
|
||||
});
|
||||
if (result.error) throw result.error;
|
||||
@@ -209,6 +211,7 @@ if (invokedDirectly) {
|
||||
const runBytes = (command, commandArgs, { cwd = root } = {}) => {
|
||||
const result = spawnSync(command, commandArgs, {
|
||||
cwd,
|
||||
maxBuffer: SUBPROCESS_MAX_BUFFER,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
});
|
||||
if (result.error) throw result.error;
|
||||
|
||||
@@ -187,6 +187,18 @@ test('prerelease CLI reports malformed arguments without a raw stack trace', ()
|
||||
assert.doesNotMatch(result.stderr, /\n\s+at\s/);
|
||||
});
|
||||
|
||||
test('prerelease CLI can buffer the committed release bundle', () => {
|
||||
const orchestrator = readFileSync(
|
||||
new URL('../scripts/release-prerelease.mjs', import.meta.url), 'utf8',
|
||||
);
|
||||
assert.match(orchestrator, /SUBPROCESS_MAX_BUFFER = 64 \* 1024 \* 1024/);
|
||||
assert.equal(
|
||||
[...orchestrator.matchAll(/maxBuffer: SUBPROCESS_MAX_BUFFER/g)].length,
|
||||
2,
|
||||
'both text and byte subprocess readers must override the Node default buffer',
|
||||
);
|
||||
});
|
||||
|
||||
test('manual publish workflow is draft-first, exact-SHA gated and self-contained', () => {
|
||||
const workflow = readFileSync(new URL('../.github/workflows/publish-prerelease.yml', import.meta.url), 'utf8');
|
||||
for (const required of [
|
||||
|
||||
Reference in New Issue
Block a user