Files
memind/scripts/run-release-gate-impact.mjs
john 7a381db132
Memind CI / Test, build, and release guards (push) Has been cancelled
refactor: make production gate impact only
2026-07-28 01:13:28 +08:00

42 lines
1.5 KiB
JavaScript

#!/usr/bin/env node
import { executeImpactReleaseGate, parseRunnerArgs } from '../release-gate/runner.mjs';
function usage() {
console.log(`Usage:
node scripts/run-release-gate-impact.mjs --artifact .runtime/portal --deployed-commit <sha>
Runs the compact production core Gate plus scenarios selected from the Git diff.
Critical and shared paths expand their mapped impact domains. Unmapped paths or
an invalid production baseline block release until the impact map is updated.`);
}
try {
const options = parseRunnerArgs(process.argv);
if (options.help) {
usage();
process.exit(0);
}
options.mode = 'impact';
const { report, outputDir, selection } = await executeImpactReleaseGate(options);
const summary = report.summary;
console.log(`Risk-based release gate report: ${outputDir}`);
console.log(`mode=${report.mode}`);
if (selection) {
console.log(`strategy=${selection.strategy}`);
console.log(`selected=${selection.selected_total}/${selection.catalog_total}`);
console.log(`impact_groups=${selection.impact_groups.join(',') || 'none'}`);
console.log(`changed_paths=${selection.changed_paths.length}`);
}
console.log(JSON.stringify(summary));
const passed = summary.failed === 0
&& summary.skipped === 0
&& summary.blocked === 0
&& summary.unknown === 0
&& summary.cleanup_failed === 0
&& summary.passed === summary.required;
process.exit(passed ? 0 : 1);
} catch (error) {
console.error(`Risk-based release gate failed: ${error.message}`);
process.exit(1);
}