frontend-quality-gates / merge / static checks (pull_request) Successful in 1m10s
frontend-quality-gates / merge / tests (pull_request) Successful in 11m1s
frontend-quality-gates / merge / browser tests (pull_request) Successful in 6m12s
frontend-quality-gates / FE-GATE-017 / diagram-review (pull_request) Skipped
frontend-quality-gates / FE-GATE-014 / config-compatibility (pull_request) Skipped
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (pull_request) Skipped
frontend-quality-gates / FE-GATE-026 / lab-performance (pull_request) Skipped
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (pull_request) Skipped
frontend-quality-gates / external-vulnerability-provider (pull_request) Skipped
frontend-quality-gates / external-provenance-provider (pull_request) Skipped
frontend-quality-gates / promote-verified-immutable-candidate (pull_request) Skipped
frontend-quality-gates / deploy-promoted-release (pull_request) Skipped
frontend-quality-gates / FE-GATE-019 / hosting-header (pull_request) Skipped
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (pull_request) Skipped
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (pull_request) Skipped
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (pull_request) Skipped
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (pull_request) Skipped
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (pull_request) Skipped
frontend-quality-gates / FE-GATE-018 / field-web-vitals (pull_request) Skipped
frontend-quality-gates / main / self-tests and removal drills (pull_request) Skipped
문제: #55가 scripts/check-test-evidence.ts의 forbidOnly 검사를 `--playwright-config`가 없을 때도 fixture 모드에서 저장소 설정 (repository-layout의 playwright-configs)을 읽게 바꿨다. browser file/storage 제거 드릴 사본은 playwright.capabilities.config.ts를 지우지만 등록부 항목은 남긴다. 그래서 사본의 tests/unit/test-evidence-source-rules.test.ts가 fixture 모드로 부르는 검사 6건이 모두 ENOENT로 죽는다(main run 376, FE-GATE-030). 고른 방법 (가) 검사 쪽: 설정을 인자로 받지 않은 fixture 실행은 설정을 하나도 읽지 않는다. 전체 검사는 전처럼 등록부의 설정을 모두 읽는다. `--playwright-config`는 그대로 모든 모드(시나리오 검사 빼고)에서 돈다. 이유: 원인은 #55가 fixture 실행의 입력을 저장소 파일로 넓힌 것이다. 1112/03-03 지적의 최소 개선 방향은 설정을 인자로 받고 forbidOnly 없는 설정을 거절 fixture로 두는 것뿐이다. 기본값으로 저장소를 읽는 부분은 지적 밖이다. fixture 실행이 받은 파일에만 기대면 저장소 사본마다 어떤 설정이 남았는지와 상관없이 같은 결과를 낸다. 전체 검사 기준은 바뀌지 않는다. #55는 fixture 실행으로 「기본값은 등록부 설정을 모두 읽는다」를 단언했다. 그 단언은 fixture 실행이 설정을 읽지 않는다로 바꾸고, 전체 검사(`--source-only`)가 등록부 설정을 모두 읽는지는 새 시험 tests/unit/test-evidence-repository-configs.test.ts가 본다. 그 시험은 사본에서 지운 설정을 읽으므로, 드릴이 playwright.capabilities.config.ts와 그 run-isolation 시험을 지울 때 같이 이름으로 지운다. 버린 대안 (나) 드릴 쪽: 드릴이 사본의 config/repository-layout.json에서 그 항목도 지운다. 등록부를 고치는 드릴이 없고(recipes 드릴은 항목의 optional 표시에 기댄다), 다른 사본에서 fixture 실행이 저장소 설정을 읽는 문제는 남는다. 버린 대안 (가) 안의 건너뛰기: 없는 설정을 건너뛰면 설정이 사라져도 조용히 통과한다. 막으려면 등록부 항목을 optional로 바꿔야 하는데, 그 표시는 fixture-copy·secret-scan 집합에도 같이 걸리고 FE-GATE-008의 전체 검사도 설정이 빠진 것을 넘기게 된다. 위험·한계: 다운스트림이 이 드릴처럼 playwright.capabilities.config.ts를 지우고 등록부 항목을 남기면 전체 검사가 ENOENT로 죽는다. #55 이전부터 같다. 새 시험은 전체 검사 하나를 자식 프로세스로 돌린다(desktop 단독 3회 210~232ms). 검증(desktop, scripts/verify.sh, 공유 잠금, CI=true): - RED: tests/unit/test-evidence-source-rules.test.ts의 새 단언을 앞 커밋 검사기에 돌림 → rc=1, 1 failed(기대 [], 받은 값 설정 4개). 로그 /tmp/claude-gates/fe-reland-red-unit/ - 변이: 전체 모드 기본값을 []로 → 새 시험만 실패(expected [] to deeply equal [ …(4) ]), source-rules 6건 통과. /tmp/claude-gates/fe-reland-mutation1/ - 이 트리(7f1af01e)에서 모두 rc=0: - 두 시험 파일 /tmp/claude-gates/fe-reland2-unit/ - gate FE-GATE-030 371초. optional recipe·browser file/storage·realtime 드릴 모두 PASS. 새 시험은 recipe·realtime 사본에서 돌고 browser file 사본에서는 지워진다. /tmp/claude-gates/fe-reland2-gate030/ - gate FE-GATE-029 24초. /tmp/claude-gates/fe-reland2-gate029/ - merge 단계 14개(FE-GATE-013 시스템 컨테이너 안, FE-GATE-020 포함). /tmp/claude-gates/fe-reland2-merge/ Refs: #55, 1112/03-03 Fixes:34a7627d36("fix(test-evidence): 검사 규칙마다 혼자 도는 거절 시험을 두고 strict import를 lint로 본다")
212 lines
6.8 KiB
TypeScript
212 lines
6.8 KiB
TypeScript
import {
|
|
mkdir,
|
|
readFile,
|
|
rm,
|
|
writeFile,
|
|
} from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
import {
|
|
assertNoRuntimeImports,
|
|
createRemovalFixtureRoot,
|
|
prepareRemovalFixture,
|
|
pruneRemovalFixtureCiContract,
|
|
regenerateRemovalFixtureWorkflow,
|
|
removeRuntimeDependentTests,
|
|
renderRemovalJunit,
|
|
requireRemovalFixtureEnvironment,
|
|
runRemovalFixtureCheck,
|
|
type RemovalCheck,
|
|
} from "./lib/removal-fixture.ts";
|
|
|
|
const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath");
|
|
const fixtureRoot = await createRemovalFixtureRoot("browser-file-storage-runtime-removal");
|
|
const RUNTIME_RECIPE_MODULES = [
|
|
"browser-file-storage-contracts.ts",
|
|
"browser-file-storage-fakes.ts",
|
|
] as const;
|
|
const runtimePaths = [
|
|
"src/application/ports/browser-file-storage",
|
|
"src/application/ports/browser-transfer",
|
|
"src/adapters/browser-file-storage",
|
|
"src/adapters/browser-files",
|
|
"src/adapters/browser-transfer",
|
|
"src/adapters/cache-storage",
|
|
"src/adapters/storage/indexeddb",
|
|
"src/adapters/storage/opfs",
|
|
"tests/browser-capabilities",
|
|
"tests/fixtures/browser-file-storage-boundaries",
|
|
// The composition examples of this runtime go with it.
|
|
"recipes/frontend-capabilities/indexeddb-feature-capability.ts",
|
|
"recipes/frontend-capabilities/browser-file-session-capability.ts",
|
|
// [0929] 05-03. These recipe contracts re-export this runtime's ports and
|
|
// their fakes implement them, so they go with it too, with their test.
|
|
...RUNTIME_RECIPE_MODULES.map(
|
|
(module) => `recipes/frontend-capabilities/${module}`,
|
|
),
|
|
"tests/recipes/browser-file-storage-contracts.test.ts",
|
|
] as const;
|
|
const runtimeSourceRoots = runtimePaths.filter((entry) =>
|
|
entry.startsWith("src/"),
|
|
);
|
|
const removedScripts = new Set([
|
|
"test:browser-capabilities",
|
|
"verify:browser-capability-evidence",
|
|
"check:browser-file-storage-boundaries",
|
|
"test:browser-file-storage-removal",
|
|
]);
|
|
const removedEvidencePathFragments = [
|
|
"browser-capabilities",
|
|
"browser-file-storage-runtime-removal",
|
|
] as const;
|
|
function check(name: string, script: string): RemovalCheck {
|
|
return runRemovalFixtureCheck(name, fixtureRoot, pnpmCli, script);
|
|
}
|
|
|
|
let checks: RemovalCheck[];
|
|
let removedRuntimeTests: number;
|
|
try {
|
|
await prepareRemovalFixture(fixtureRoot);
|
|
|
|
// The recipe barrel stops exporting the removed recipe modules first, so the
|
|
// import graph below does not count every other recipe test as dependent.
|
|
const recipeIndexPath = path.join(
|
|
fixtureRoot,
|
|
"recipes/frontend-capabilities/index.ts",
|
|
);
|
|
const recipeIndex = await readFile(recipeIndexPath, "utf8");
|
|
const keptRecipeExports = recipeIndex
|
|
.split("\n")
|
|
.filter(
|
|
(line) =>
|
|
!RUNTIME_RECIPE_MODULES.some((module) =>
|
|
line.includes(`"./${module}"`),
|
|
),
|
|
);
|
|
if (
|
|
keptRecipeExports.length !==
|
|
recipeIndex.split("\n").length - RUNTIME_RECIPE_MODULES.length
|
|
) {
|
|
throw new Error("Expected the recipe barrel to export each runtime recipe module once");
|
|
}
|
|
await writeFile(recipeIndexPath, keptRecipeExports.join("\n"));
|
|
|
|
removedRuntimeTests =
|
|
await removeRuntimeDependentTests(fixtureRoot, runtimeSourceRoots);
|
|
for (const runtimePath of runtimePaths) {
|
|
await rm(path.join(fixtureRoot, runtimePath), {
|
|
recursive: true,
|
|
force: true,
|
|
});
|
|
}
|
|
|
|
const catalogPath = path.join(
|
|
fixtureRoot,
|
|
"config/recipes/frontend-capability-recipes.json",
|
|
);
|
|
const catalog = JSON.parse(await readFile(catalogPath, "utf8")) as {
|
|
recipes: Array<Record<string, unknown>>;
|
|
};
|
|
const browserFileRuntimeRecipeIds = new Set([
|
|
"offline-indexeddb",
|
|
"service-worker-pwa",
|
|
"file-transfer",
|
|
]);
|
|
let removedRuntimeEntries = 0;
|
|
for (const recipe of catalog.recipes) {
|
|
if (
|
|
typeof recipe.id !== "string" ||
|
|
!browserFileRuntimeRecipeIds.has(recipe.id) ||
|
|
!Object.hasOwn(recipe, "referenceRuntime")
|
|
) {
|
|
continue;
|
|
}
|
|
delete recipe.referenceRuntime;
|
|
removedRuntimeEntries += 1;
|
|
}
|
|
if (removedRuntimeEntries !== 3) {
|
|
throw new Error(
|
|
`Expected three reference runtime catalog entries, removed ${removedRuntimeEntries}`,
|
|
);
|
|
}
|
|
await writeFile(catalogPath, `${JSON.stringify(catalog, null, 2)}\n`);
|
|
|
|
// 1106/10-01. The capabilities config goes with this runtime, and so do its
|
|
// run-isolation checks, by name: the template's test:unit runs them, this
|
|
// copy has nothing for them to check. Without `force`, so a renamed file
|
|
// stops the drill here instead of failing its typecheck later. The test that
|
|
// the full test evidence check reads every registered Playwright config goes
|
|
// too: the registry still names the one deleted here.
|
|
for (const capabilityConfigFile of [
|
|
"playwright.capabilities.config.ts",
|
|
"tests/unit/playwright-capabilities-run-isolation.test.ts",
|
|
"tests/unit/test-evidence-repository-configs.test.ts",
|
|
]) {
|
|
await rm(path.join(fixtureRoot, capabilityConfigFile));
|
|
}
|
|
await rm(
|
|
path.join(fixtureRoot, "scripts/check-browser-file-storage-boundaries.ts"),
|
|
{ force: true },
|
|
);
|
|
await rm(
|
|
path.join(fixtureRoot, "scripts/verify-browser-capability-evidence.ts"),
|
|
{ force: true },
|
|
);
|
|
await rm(
|
|
path.join(fixtureRoot, "scripts/test-browser-file-storage-runtime-removal.ts"),
|
|
{ force: true },
|
|
);
|
|
// The root snapshot locks the full repository inventory. This removal fixture
|
|
// validates its smaller registry through check:ci and its regenerated workflow.
|
|
await rm(
|
|
path.join(fixtureRoot, "tests/unit/ci-workflow-generation.test.ts"),
|
|
{ force: true },
|
|
);
|
|
await rm(
|
|
path.join(
|
|
fixtureRoot,
|
|
"tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap",
|
|
),
|
|
{ force: true },
|
|
);
|
|
|
|
await pruneRemovalFixtureCiContract({
|
|
root: fixtureRoot,
|
|
removedScripts,
|
|
removedEvidencePathFragments,
|
|
});
|
|
await regenerateRemovalFixtureWorkflow(fixtureRoot);
|
|
await assertNoRuntimeImports(
|
|
fixtureRoot,
|
|
runtimeSourceRoots,
|
|
"browser file/storage",
|
|
);
|
|
|
|
checks = [
|
|
check("typecheck", "check:types"),
|
|
check("lint", "lint"),
|
|
check("architecture", "check:architecture"),
|
|
check("test", "test:all"),
|
|
check("build", "build"),
|
|
check("optional-catalog", "check:optional-recipes:source"),
|
|
check("ci-contract", "check:ci"),
|
|
];
|
|
} finally {
|
|
await rm(fixtureRoot, { recursive: true, force: true });
|
|
}
|
|
const failed = checks.filter((entry) => !entry.passed);
|
|
await mkdir("artifacts/tests", { recursive: true });
|
|
await writeFile(
|
|
"artifacts/tests/browser-file-storage-runtime-removal.xml",
|
|
renderRemovalJunit("browser-file-storage-runtime-removal", checks),
|
|
);
|
|
if (failed.length > 0) {
|
|
process.stderr.write(
|
|
`Browser file/storage runtime removal failed: ${failed.map((entry) => entry.name).join(", ")}\n`,
|
|
);
|
|
process.exit(1);
|
|
}
|
|
process.stdout.write(
|
|
`Browser file/storage runtime removal: PASS (${checks.length} base checks, ${removedRuntimeTests} runtime-dependent tests removed by import graph)\n`,
|
|
);
|