fix(ci): 제품 merge 게이트가 실패하면 같은 run의 release 단계를 멈춘다
문제 제품 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
This commit is contained in:
@@ -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 <script>` in the `product_merge_gate`
|
||||
job, on the same condition as `merge_gate`, without browsers and without the
|
||||
gate log and evidence artifacts of `ci:gate`. Make that job a required check
|
||||
of the branch where it has to block a merge. `check:ci` refuses a script that
|
||||
`package.json` does not define and counts these scripts as gated.
|
||||
gate log and evidence artifacts of `ci:gate`. `release_gate` waits for that job
|
||||
as it waits for `merge_gate`, so a failing product gate also stops the release
|
||||
build, promotion and deployment of the same run (1105/13-02); with no product
|
||||
gates the workflow is the template's own. A required check of the branch is
|
||||
what blocks a pull request merge, so make the job one where it has to. `check:ci`
|
||||
refuses a script that `package.json` does not define, and a workflow whose
|
||||
`release_gate` does not wait for the product job, and counts these scripts as
|
||||
gated.
|
||||
|
||||
The slot as stored in `config/ci/gates.json` still follows the same contract
|
||||
rules. The contract allows the steps `checkout`, `setup-node`,
|
||||
|
||||
Reference in New Issue
Block a user