From f0a8582c72a3e8692103d5a9805dd842333bee42 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sat, 14 Nov 2026 03:11:26 +0900 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=EC=8B=9C=ED=97=98=20fixture?= =?UTF-8?q?=EA=B0=80=20PR=20job=EC=9D=98=20=EA=B2=8C=EC=9D=B4=ED=8A=B8=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20env=EB=A5=BC=20=EB=AC=BC=EB=A0=A4=EB=B0=9B?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR run의 merge job은 CI_PR_BASE_REF=main을 둔다. 임시 폴더에서 scripts/run-ci-gate.ts를 띄우는 시험은 env를 그대로 물려줬고, 자식은 그 폴더에 없는 config/ci/pr-gate-selection.json을 열다 ENOENT로 죽었다(runner run 291, tests/unit/ci-gate-failure.test.ts:102). FE-GATE-005가 깨졌고, scaffold 사본의 test:coverage가 같은 시험을 돌려 FE-GATE-020도 깨졌다. desktop verify.sh merge는 ci_env에 이 변수가 없어 이 길을 타지 않았다. fixture는 PR의 checkout이 아니므로 그 안의 게이트는 늘 전부 돈다. FIXTURE_PNPM_ENVIRONMENT가 CI_PR_BASE_REF를 빈 값(main run과 같음)으로 둔다. scaffold 드릴·제거 드릴·provider fixture·run-ci-gate를 띄우는 시험이 모두 이 상수를 쓰므로 한 곳에서 끈다. - ci-gate-failure 시험은 바깥 env와 상관없이 PR job env(main)를 넣고 띄운다. 그래서 desktop에서도 CI의 조건을 늘 시험한다. - run-ci-gate를 띄우는 시험은 이 상수를 써야 한다는 검사를 fixture-node-modules 시험에 더했다. 그 검사가 상수 없이 띄우던 ci-workflow-generation 시험 하나를 찾았다. 그 시험은 preflight에서 먼저 막혀 지금은 가려지지 않지만, 상수를 주고 막힌 이유를 단언한다. 버린 대안: - prGateSkipReason이 경로표가 없으면 전부 돌기: 원인은 시험 env다. 진짜 checkout에서 경로표가 없으면 크게 실패하는 편이 맞다. - verify.sh ci_env에 CI_PR_BASE_REF를 두기: desktop merge가 게이트를 건너뛰게 되어 「merge 단계 전부 통과」 판정과 맞지 않는다. 위험·한계: - 시스템 컨테이너(scripts/run-in-system-container.sh)는 CI_PR_BASE_REF를 넘기지 않는다. 그래서 FE-GATE-013은 PR run에서도 늘 전부 돈다(안전한 쪽). 이 커밋은 그대로 둔다. 검증(desktop): - RED: 9f8b2c1c에서 `env CI_PR_BASE_REF=main node scripts/run-vitest.ts run tests/unit/ci-gate-failure.test.ts` rc=1, run 291과 같은 ENOENT. - 고친 뒤 시험 4파일(ci-gate-failure, fixture-node-modules, pr-gate-selection, ci-workflow-generation) 471개 통과, 바깥 CI_PR_BASE_REF=main 있을 때와 없을 때 둘 다. - 상수의 새 줄만 빼면 바깥 env 없이도 ci-gate-failure 시험이 같은 ENOENT로 실패한다. 새 검사는 상수를 안 쓰던 시험을 찾아 실패했다. --- scripts/lib/fixture-node-modules.ts | 11 +++++++++++ tests/unit/ci-gate-failure.test.ts | 7 ++++++- tests/unit/ci-workflow-generation.test.ts | 8 +++++++- tests/unit/fixture-node-modules.test.ts | 19 +++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/scripts/lib/fixture-node-modules.ts b/scripts/lib/fixture-node-modules.ts index 26e3e7b5..25460b12 100644 --- a/scripts/lib/fixture-node-modules.ts +++ b/scripts/lib/fixture-node-modules.ts @@ -1,6 +1,8 @@ import { copyFile, mkdir, readdir, readFile, stat, symlink, writeFile } from "node:fs/promises"; import path from "node:path"; +import { PR_BASE_REF_VARIABLE } from "./pr-gate-selection.ts"; + /** * Links the repository's installed dependencies into a throwaway fixture root. * @@ -36,9 +38,18 @@ import path from "node:path"; * shims. A fixture started through `pnpm