From 000b5a35beac8de7cf5d02e4540b832a192ceadc Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 13 Nov 2026 08:29:17 +0900 Subject: [PATCH] =?UTF-8?q?ci(gates):=20release=20job=EC=9D=B4=20FE-GATE-0?= =?UTF-8?q?28=EC=97=90=20=EB=A6=B4=EB=A6=AC=EC=8A=A4=20=ED=83=9C=EA=B7=B8?= =?UTF-8?q?=EB=A5=BC=20=EB=84=98=EA=B8=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: 서명된 수동 접근성 기록의 「Release ID」를 무엇과 대조할지 정해지지 않았다(round9 1112/05-01, R9-D7). 처음 정한 `--release-root` 안은 성립하지 않는다. FE-GATE-028은 후보를 만드는 `immutable_build`보다 앞의 `release_gate` 에서 돌고, 후보의 `releaseId`는 run마다 다른 env `RELEASE_ID`에서 온다. r9-fe가 (가) 릴리스 태그로 정했다. 고친 것: `release_gate` job env에 `RELEASE_TAG`(tag run이면 `gitea.ref_name`, 아니면 빈 값)를 두고, FE-GATE-028이 그것을 `requiresEnvironment`로 요구한다. `run-ci-gate.ts`는 빈 필수 변수를 거절하므로, 브랜치에서 수동으로 돌린 release 단계에서는 028이 `missing required environment: RELEASE_TAG`로 실패한다(fail-closed, 의도한 동작). 계약의 job env 고정과 ci-quality-gates.md를 같이 고친다. 버린 대안: 명령 인자로 후보 root 넘기기(028 시점에 후보가 없음), releaseId를 tag 기준 결정값으로 바꾸기(빌드 식별 계약 변경), 028을 이전 run의 후보를 받는 흐름으로 옮기기(job 그래프 변경). 위험·한계: 기록의 「Release ID」를 이 태그와 대조하는 일은 검사 (`scripts/verify-a11y-manual.ts`)와 기록 양식 쪽(그룹 A5)이 한다. 이 커밋만 으로는 값을 받기만 한다. 다운스트림이 release 단계를 브랜치에서 수동으로 돌리던 흐름은 028에서 멈춘다. 검증(desktop): 새 시험이 바꾸기 전 gates.json에서 실패(RED), 고친 뒤 ci-workflow-generation 439개 통과. check:ci·check:types·eslint· verify:documentation rc=0. `ci:gate FE-GATE-028`: `RELEASE_TAG`가 비면 `missing required environment: RELEASE_TAG`로 실패, `v0.0.0`이면 그 줄 없이 검사까지 간다(서명 없는 템플릿 기록이라 지금처럼 incomplete로 실패). Refs: 1112/05-01 --- .gitea/workflows/quality-gates.yml | 2 ++ config/ci/gates.json | 10 ++++++++- docs/operations/ci-quality-gates.md | 4 ++++ scripts/contracts/ci-gates.ts | 8 ++++++- .../ci-workflow-generation.test.ts.snap | 2 ++ tests/unit/ci-workflow-generation.test.ts | 21 +++++++++++++++++++ 6 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/quality-gates.yml b/.gitea/workflows/quality-gates.yml index 4c3f9173..4898c239 100644 --- a/.gitea/workflows/quality-gates.yml +++ b/.gitea/workflows/quality-gates.yml @@ -237,6 +237,8 @@ jobs: if: ${{ startsWith(gitea.ref, 'refs/tags/v') || (gitea.event_name == 'workflow_dispatch' && (inputs.stage == 'release' || inputs.stage == 'production' || inputs.stage == 'field')) }} runs-on: ubuntu-latest timeout-minutes: 45 + env: + RELEASE_TAG: "${{ startsWith(gitea.ref, 'refs/tags/v') && gitea.ref_name || '' }}" strategy: fail-fast: false matrix: diff --git a/config/ci/gates.json b/config/ci/gates.json index 360c1185..594c173d 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -1993,6 +1993,9 @@ "commandIds": [ "review-a11y-manual" ], + "requiresEnvironment": [ + "RELEASE_TAG" + ], "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-028-txt", "evidenceArtifactIds": [ "artifact-docs-accessibility-route-reviews-APP-HOME-md", @@ -2291,7 +2294,12 @@ "browserGateIds": [ "FE-GATE-026" ], - "environment": [], + "environment": [ + { + "name": "RELEASE_TAG", + "value": "${{ startsWith(gitea.ref, 'refs/tags/v') && gitea.ref_name || '' }}" + } + ], "steps": [ { "kind": "checkout" diff --git a/docs/operations/ci-quality-gates.md b/docs/operations/ci-quality-gates.md index 50bea937..7c7ab0f4 100644 --- a/docs/operations/ci-quality-gates.md +++ b/docs/operations/ci-quality-gates.md @@ -148,6 +148,10 @@ full commit ID와 commit timestamp를 한 번 읽어 `SOURCE_DATE_EPOCH`를 유 release manifest도 같은 build ID, commit SHA, release ID와 timestamp를 가져야 한다. +`release_gate` job은 tag run이면 그 tag 이름(예 `v1.4.0`)을 `RELEASE_TAG`로 준다. +FE-GATE-028이 이 값을 요구한다(`requiresEnvironment`). tag run이 아니면(브랜치에서 수동으로 +돌린 release 단계) 값이 비어 게이트가 `missing required environment: RELEASE_TAG`로 실패한다. + Release tier의 `immutable_build`는 `dist`의 hidden `.vite` entries, raw `pnpm-lock.yaml`, build/module inventory와 local release/security evidence를 한 번 생성해 run ID/attempt로 구분된 archive로 게시한다. Raw lock bytes의 SHA-256은 diff --git a/scripts/contracts/ci-gates.ts b/scripts/contracts/ci-gates.ts index d8b361d3..71499d29 100644 --- a/scripts/contracts/ci-gates.ts +++ b/scripts/contracts/ci-gates.ts @@ -991,7 +991,13 @@ function validateContractSemantics( merge_static: [], merge_test: [], merge_browser: [], - release_gate: [], + release_gate: [ + // 1112/05-01 (R9-D7, release tag). FE-GATE-028 compares each signed + // record's Release ID with the tag being released. A run that is not a + // tag run (a release stage dispatched on a branch) gets an empty value, + // and run-ci-gate.ts fails the gate on it. + { name: "RELEASE_TAG", value: "${{ startsWith(gitea.ref, 'refs/tags/v') && gitea.ref_name || '' }}" }, + ], immutable_build: [ // FE-GATE-027 admits the built artifact to a named environment, so both // the profile it was built from and the destination it is claimed for are diff --git a/tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap b/tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap index 89642a65..c5c3eb7a 100644 --- a/tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap +++ b/tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap @@ -240,6 +240,8 @@ jobs: if: \${{ startsWith(gitea.ref, 'refs/tags/v') || (gitea.event_name == 'workflow_dispatch' && (inputs.stage == 'release' || inputs.stage == 'production' || inputs.stage == 'field')) }} runs-on: ubuntu-latest timeout-minutes: 45 + env: + RELEASE_TAG: "\${{ startsWith(gitea.ref, 'refs/tags/v') && gitea.ref_name || '' }}" strategy: fail-fast: false matrix: diff --git a/tests/unit/ci-workflow-generation.test.ts b/tests/unit/ci-workflow-generation.test.ts index 84055d56..0e67e3c3 100644 --- a/tests/unit/ci-workflow-generation.test.ts +++ b/tests/unit/ci-workflow-generation.test.ts @@ -242,6 +242,27 @@ describe("CI gate contract", () => { expect(stageOf("FE-GATE-028")).toBe("release"); }); + // 1112/05-01 (R9-D7). The signed review names the release tag it covers; + // the release job hands FE-GATE-028 that tag, and nothing on a run that is + // not a tag run, so the gate fails closed there (run-ci-gate.ts refuses an + // empty required variable). + it("gives FE-GATE-028 the release tag of a tag run and nothing otherwise (1112/05-01)", async () => { + const contract = await loadCiGateContract(process.cwd()); + const tag = "${{ startsWith(gitea.ref, 'refs/tags/v') && gitea.ref_name || '' }}"; + expect(contract.gates.find(({ id }) => id === "FE-GATE-028")?.requiresEnvironment).toEqual(["RELEASE_TAG"]); + expect(contract.jobs.find(({ id }) => id === "release_gate")?.environment).toEqual([ + { name: "RELEASE_TAG", value: tag }, + ]); + const workflow = renderCiWorkflow(contract); + const release = workflow.slice(workflow.indexOf("\n release_gate:\n"), workflow.indexOf("\n immutable_build:\n")); + expect(release).toContain(` env:\n RELEASE_TAG: ${JSON.stringify(tag)}\n`); + expect(workflow.match(/RELEASE_TAG:/gu)).toHaveLength(1); + + const unbound = JSON.parse(JSON.stringify(contract)) as Record; + unbound.jobs.find((job: Record) => job.id === "release_gate").environment = []; + expect(() => parseCiGateContract(unbound)).toThrow(/job release_gate lacks environment RELEASE_TAG for FE-GATE-028/u); + }); + it("keeps every platform route's signed review record as FE-GATE-028 evidence (1112/05-18)", async () => { // The evidence list is written by hand. EXAMPLES_PLATFORM's record was // missing from it while the review covers every registered route. A