ci(gates): release job이 FE-GATE-028에 릴리스 태그를 넘긴다 #42
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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은
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<string, any>;
|
||||
unbound.jobs.find((job: Record<string, any>) => 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
|
||||
|
||||
Reference in New Issue
Block a user