fix(scaffold): 기능 생성 드릴이 로컬에서도 release candidate를 만든다
문제e1b4e28뒤 test:feature-scaffold는 merge 단계 명령을 모두 돈다. 실제 실행 (snapshotb6bfc9b, CI env 없음)에서 검사 75개 중 FE-GATE-013의 두 개만 실패했다. build:release-candidate가 build의 commitSha를 source.revision으로 기록하는데, VITE_COMMIT_SHA가 없으면 commitSha가 "local"이라 schema(40·64자리 16진수)가 거부한다. verify:local-evidence는 그 결과를 읽어 따라 실패했다. CI workflow는 VITE_COMMIT_SHA를 전체 env로 주므로 CI에서는 나지 않는다. 고른 방법 - VITE_COMMIT_SHA가 비었을 때만 드릴이 fixture의 봉인 commit(git rev-parse HEAD)을 넣는다. CI 값은 그대로 둔다. test:system의 provider fixture도 같은 방법으로 commit을 준다. - 버린 대안: build:release-candidate·verify:local-evidence를 제외 목록에 넣기. 생성 기능 파일이 후보의 추적 파일 목록과 공급망 증거에 들어가는지를 보지 못한다. 위험·한계 - 로컬 실행에서 빌드 산출물의 commitSha가 "local" 대신 fixture commit이 된다. fixture 안에서만이다. 검증 - 수정 전 드릴 실행: create-feature, merge 명령 73개(음성 fixture 포함), feature-removal 통과. 실패는 위 두 개뿐(866초, load 10~25). - 수정 뒤 eslint·tsc 통과, feature-scaffold-drill 6건 통과. 드릴 재실행 결과는 이 커밋 메시지에 적지 않았다(공유 잠금). Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-02
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { mkdir, rm, writeFile } from "node:fs/promises";
|
||||
|
||||
import { loadCiGateContract } from "./contracts/ci-gates.ts";
|
||||
@@ -39,6 +40,12 @@ const REPORT = "artifacts/tests/feature-scaffold.xml";
|
||||
const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath");
|
||||
const fixtureRoot = await createRemovalFixtureRoot("feature-scaffold");
|
||||
|
||||
function fixtureCommit(root: string): string {
|
||||
const head = spawnSync("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8" });
|
||||
if (head.status !== 0) throw new Error(`feature scaffold fixture has no commit: ${head.stderr}`);
|
||||
return head.stdout.trim();
|
||||
}
|
||||
|
||||
function check(name: string, script: string, extra: readonly string[] = []): RemovalCheck {
|
||||
return runRemovalFixtureCheck(name, fixtureRoot, pnpmCli, script, extra);
|
||||
}
|
||||
@@ -55,6 +62,12 @@ try {
|
||||
// Commits the copy with the feature, as a project would: git-based
|
||||
// checks (git grep, git ls-files) then see the feature's files.
|
||||
sealRemovalFixtureRepository(fixtureRoot);
|
||||
// build:release-candidate records the build's commit and refuses one that
|
||||
// is not a commit ID. CI sets VITE_COMMIT_SHA for the whole workflow; a
|
||||
// local run gets the copy's own sealed commit instead of "local".
|
||||
if (!process.env["VITE_COMMIT_SHA"]?.trim()) {
|
||||
process.env["VITE_COMMIT_SHA"] = fixtureCommit(fixtureRoot);
|
||||
}
|
||||
for (const command of scaffoldDrillCommands(await loadCiGateContract(fixtureRoot))) {
|
||||
checks.push(runScaffoldDrillCommand(command, fixtureRoot, pnpmCli));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user