From 92d5019c6d7e4e234c0c2fc25bf523ea29828b76 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 5 Nov 2026 22:31:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=EC=A0=9C=ED=92=88=20merge=20?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=ED=8A=B8=EA=B0=80=20=EC=8B=A4=ED=8C=A8?= =?UTF-8?q?=ED=95=98=EB=A9=B4=20=EA=B0=99=EC=9D=80=20run=EC=9D=98=20releas?= =?UTF-8?q?e=20=EB=8B=A8=EA=B3=84=EB=A5=BC=20=EB=A9=88=EC=B6=98=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 제품 overlay(config/ci/product-gates.json)의 mergeGates는 product_merge_gate job으로 렌더링되는데, 다른 job이 이 job을 기다리지 않는다. release_gate는 merge_gate만 기다린다. 그래서 제품 검사(예: 짝 백엔드 계약 검사)가 실패해도 같은 run의 release·immutable_build·promotion·deployment는 그대로 돈다. 브랜치 필수 검사는 PR merge만 막는다. job 그래프는 계약이 고정해서(ci-gates.ts의 expectedJobGraph) 제품이 연결을 더할 방법도 없다. 고른 방법 - overlay에 게이트가 있으면 release_gate의 needs에 product_merge_gate를 더해 렌더링한다(`needs: [merge_gate, product_merge_gate]`). release_gate는 release 단계의 첫 job이고 뒤의 job은 모두 그것을 거쳐 기다린다. 템플릿 게이트가 release를 막는 방식과 같다. - 연결은 렌더링에서만 더한다. gates.json과 계약 그래프 검사는 그대로라 템플릿 job 그래프와 check:ci의 엄격함은 바뀌지 않는다. 게이트가 없으면 workflow 바이트가 같다(.gitea/workflows/quality-gates.yml 변경 없음). - workflowGateExecutionFailures(check:ci가 부름)가 제품 게이트가 있는데 release_gate가 product_merge_gate를 기다리지 않는 workflow를 거절한다. "실행된다"와 "막는다"를 따로 본다. - 문서(ci-quality-gates.md, README)에 release 단계가 제품 job을 기다린다고 적었다. - 버린 대안: (a) 문서에만 "막지 않는다"고 적기. 제품이 막을 방법이 계속 없다. (c) 게이트마다 blocksRelease 칸. 선택권은 주지만 칸이 늘고, 불안정한 제품 검사가 생기기 전에는 필요가 없다. 계약 그래프 검사에 overlay 예외를 넣는 것: 템플릿 계약이 제품 overlay를 알아야 한다. 위험·한계 - 불안정한 제품 게이트는 이제 release도 멈춘다. 그때는 (c)로 간다. - Gitea가 needs와 기본 success() 조건을 GitHub Actions처럼 처리한다고 본다. 실제 runner에서는 확인하지 못했다(Actions 꺼짐). - 제품 게이트를 이미 쓰는 다운스트림은 generate:ci-workflow를 다시 돌려야 check:ci를 통과한다(생성 YAML의 release_gate needs 한 줄이 바뀐다). 검증 - desktop batch에서 확인: node scripts/run-vitest.ts run tests/unit/product-ci-overlay.test.ts tests/unit/ci-workflow-generation.test.ts, corepack pnpm check:ci. - RED 기대: "holds the release stage until the product merge gates pass", "runs product merge gates in a job of their own, apart from the template gates". Refs: 1105/13-02 --- README.md | 2 +- docs/operations/ci-quality-gates.md | 11 +++++-- scripts/generate-ci-workflow.ts | 43 ++++++++++++++++++++++----- tests/unit/product-ci-overlay.test.ts | 41 +++++++++++++++++++++++-- 4 files changed, 83 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6a0f27e3..56f5d30c 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ bubblewrap may create unprivileged user and network namespaces, which Ubuntu 23.10 and later refuse by default — its first step says so, and `docs/operations/ci-quality-gates.md` lists the fixes). Product checks listed in `config/ci/product-gates.json` (`PRODUCT-GATE-NNN`) run in the workflow's own -`product_merge_gate` job: +`product_merge_gate` job, which the release stage waits for: ```bash for gate in 001 002 003 004 005 006 007 008 009 010 011 012 013 020; do diff --git a/docs/operations/ci-quality-gates.md b/docs/operations/ci-quality-gates.md index 6aed2f98..fb74d0f1 100644 --- a/docs/operations/ci-quality-gates.md +++ b/docs/operations/ci-quality-gates.md @@ -421,9 +421,14 @@ the paired backend: `{ "id": "PRODUCT-GATE-001", "name": "backend-contract", `FE-GATE-NNN` ids, their commands, artifacts and readiness formula stay the template's. Each runs as `corepack pnpm