fix(release-gate): invalidate only the suite whose command file changed
Memind CI / Test, build, and release guards (push) Successful in 3m33s

A change to one run-release-gate script must not force every live and
upgrade suite to rerun.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-14 22:15:44 +08:00
parent 2f240e7500
commit 25be530d84
2 changed files with 8 additions and 3 deletions
-3
View File
@@ -13,9 +13,6 @@ export function commandFilesForSuite(suite) {
export function suiteInvalidatedByChanges(suite, changedPaths) {
const normalized = new Set((changedPaths ?? []).map((item) => String(item).replaceAll('\\', '/')));
if (normalized.has('release-gate/coverage.mjs')) return true;
if ([...normalized].some((relativePath) => relativePath.startsWith('scripts/run-release-gate-'))) {
return suite.command?.some((arg) => String(arg).includes('run-release-gate-')) ?? false;
}
return commandFilesForSuite(suite).some((filePath) => normalized.has(filePath));
}
+8
View File
@@ -90,6 +90,14 @@ test('changing a suite command file invalidates that suite', () => {
assert.equal(suiteInvalidatedByChanges(chatSuite, ['chat-router.test.mjs']), true);
assert.equal(suiteInvalidatedByChanges(chatSuite, ['wechat-mp.mjs']), false);
assert.equal(suiteInvalidatedByChanges(chatSuite, ['release-gate/coverage.mjs']), true);
assert.equal(
suiteInvalidatedByChanges(liveSuite, ['scripts/run-release-gate-runtime-container.mjs']),
false,
);
assert.equal(
suiteInvalidatedByChanges(liveSuite, ['scripts/run-release-gate-page-data-scenarios.mjs']),
true,
);
});
test('carryForwardScenario keeps prior evidence and marks reuse', () => {