ci(main): main job 줄에서 integrationCheck를 앞에 둔다

문제: main job은 `./gradlew :mainCheck :integrationCheck --continue` 한 번이다.
integration lane은 build 전체에서 실서버 슬롯 하나를 나눠 쓴다
(ExclusiveRealServerLaneService, maxParallelUsages 1). desktop 측정에서
이 lane들은 시작 약 10분 동안 슬롯을 거의 쓰지 못했다. main 단계 분석이 CPU를
다 쓰는 동안 lane의 컴파일이 뒤로 밀렸기 때문이다. 그 뒤 19분은 lane이 한 번에
하나씩, 한가한 기계에서 돌았다. runner run 132에서도 jpa 계약 lane이 1,134초에야
시작했다.

고른 방법: 줄을 `./gradlew :integrationCheck :mainCheck --continue`로 바꾼다.
Gradle은 준비된 일을 요청한 태스크 순서대로 시작하므로, integration lane의
컴파일이 먼저 돌고 슬롯이 첫 분부터 찬다. 같은 단계, 같은 태스크 집합이다.
build.gradle 단계 선언의 `line`, main.yml, scripts/verify.sh, gates.md,
build-logic/AGENTS.md의 예시 줄을 함께 바꾼다.

측정(desktop, e7be517e, --no-build-cache, 같은 init script):
- 순서 바꾸기 전 1,760초(aeb60339, 거의 같은 트리), 바꾼 뒤 1,484초(−16%), rc=0, 실패 0
- jpa 계약 lane 시작 777초 → 329초. 슬롯이 60초부터 끝까지 찬다.

버린 대안: 슬롯을 둘로 늘리기. 시간에 민감한 web·WebSocket lane이 함께 돌 때
실패해서 하나로 둔 것이다(2026-11-01 리뷰). lane을 두 Gradle 실행으로 나누기:
컴파일을 두 번 한다.

위험·한계: lane이 main 단계 분석과 같은 시간에 돌아 CPU를 나눠 쓴다. 지금도 앞
10분에는 전송 qualification lane이 그렇게 돌았다. desktop 한 번은 실패 0이고,
runner 결과는 PR 본문에 적는다. 이제 main job 시간은 슬롯 lane 시간의 합이
정한다(가장 큰 것은 PostgreSQL 컨테이너 기동, 후속).
This commit is contained in:
DongHyeonka
2026-11-12 19:37:46 +09:00
parent 1fabd04df5
commit c89f3e8887
5 changed files with 15 additions and 9 deletions
+3 -2
View File
@@ -43,7 +43,8 @@ env:
TESTCONTAINERS_REUSE_ENABLE: "false"
jobs:
# Both main-branch stages in one Gradle run (build.gradle `strictLaneStages` says why).
# Both main-branch stages in one Gradle run, the integration stage first (build.gradle
# `strictLaneStages` says why).
# mainCheck: environment contract, full-boot qualification, public-path baseline, transport and
# messaging qualification, document-contract lanes, test-code analysis, the feature generator
# round trip. integrationCheck: every integration-category strict lane, against real PostgreSQL,
@@ -56,7 +57,7 @@ jobs:
steps:
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2
- uses: ./.gitea/actions/setup-java-gradle
- run: ./gradlew :mainCheck :integrationCheck --continue
- run: ./gradlew :integrationCheck :mainCheck --continue
# The included build's own tests (TestKit for the convention plugins). The main task graph does
# not reach them; `ci` already runs every plugin they test (owner decision 2026-11-07: main stage).
+1 -1
View File
@@ -26,7 +26,7 @@ registry, settings, build-logic, 루트 라이프사이클이 정하는 것을
## 단계 job의 모양
- `verifyStrictLaneStages --dry-run`(PR)은 `explicitOnly`가 아닌 strict lane마다 `build.gradle`의 `strictLaneStages`가 선언한 단계 태스크 하나의 계획에 들어 있는지 본다(그래프 검사).
- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고(같은 job을 쓰는 단계는 선언한 `line`대로 한 줄을 나눠 쓸 수 있다: `./gradlew :mainCheck :integrationCheck --continue`), 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다).
- 단계마다 선언한 workflow job은 step의 `run: ./gradlew <단계> <옵션>` 줄을 가지고(같은 job을 쓰는 단계는 선언한 `line`대로 한 줄을 나눠 쓸 수 있다: `./gradlew :integrationCheck :mainCheck --continue`), 다른 step `run:`도 셸 문법 없는 `./gradlew` 한 줄이나 `bash scripts/<이름>.sh` 한 줄이며, 선언 밖의 `if:`, 선언한 조건이 `!cancelled()`·`always()`가 아닌데 `needs:`, `continue-on-error`·`shell:`·`defaults:`, 따옴표 키·flow 형식, 이 빌드 밖의 `working-directory`가 없다. workflow는 선언한 이벤트로, 선언한 필터 한 줄만 달고 시작하고, PR 단계 job 하나가 이 검사를 돌린다(형식 검사, 셸을 해석하지 않는다).
- 단계를 더하거나 job을 바꾸면 `strictLaneStages`의 `stage` 줄과 workflow를 같은 커밋에서 고친다.
## 테스트
+7 -2
View File
@@ -247,10 +247,15 @@ strictLaneStages {
// main stage's analysis and the feature generator's nested build run while the integration
// lanes take turns on the one real-server slot. Two jobs spent about 34 runner minutes on a push
// (run 79), two of them compiling the same modules twice.
// integrationCheck comes first on the line because Gradle starts ready work in the order of
// the requested tasks: the integration lanes' compiles go first and the slot is busy from the
// first minute. Second on the line, the lanes waited about ten minutes behind the main stage's
// analysis and then ran one at a time on an idle machine (desktop 1,760 s, first on the line
// 1,484 s, same commit range).
stage ':mainCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'main',
options: '--continue', line: ':mainCheck :integrationCheck'
options: '--continue', line: ':integrationCheck :mainCheck'
stage ':integrationCheck', workflow: 'main.yml', event: 'push', filter: 'branches: [main]', job: 'main',
options: '--continue', line: ':mainCheck :integrationCheck'
options: '--continue', line: ':integrationCheck :mainCheck'
stage ':performanceCheck', workflow: 'main.yml', event: 'schedule', job: 'performance', options: '--continue',
condition: '${{ github.event_name != \'push\' }}'
stage ':releaseCheck', workflow: 'release.yml', event: 'push', filter: 'tags: ["v*"]', job: 'release'
+3 -3
View File
@@ -17,7 +17,7 @@ Gradle 명령과 `scripts/verify.sh`는 모두 저장소 루트(Gradle 루트)
| `docs` | `check-work-docs.py`, `check-docs.py`, `scripts/tests` 자기 시험, `check-repo-layout.py`(Gradle 없음, 노트북 가능) | `pr.yml`의 `prCheck` 안 |
| `leaf <gradle-path>` | 그 leaf의 `check` | — |
| `pr` | `./gradlew :prCheck`, `./gradlew :verifyStrictLaneStages --dry-run` | `pr.yml` `done` |
| `main` | `:mainCheck :integrationCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) |
| `main` | `:integrationCheck :mainCheck --continue`, `-p build-logic test`, `scripts/ci/verify-configuration-cache.sh` | `main.yml`(push) |
| `nightly` | compose smoke 전부, 마지막에 `:performanceCheck --continue` | `main.yml`(schedule·수동) |
| `release` | `:releaseCheck`(지금 커밋을 provenance로) | `release.yml` `release` |
| `app` | `scripts/bootstrap-local.sh`(앱을 띄워 health와 기본 endpoint 확인) | — |
@@ -39,8 +39,8 @@ workflow에만 있는 job: `pr.yml` `done`의 마지막 step과 `main.yml`의 `v
| `verifyStrictLaneStages --dry-run` | `explicitOnly`가 아닌 strict lane이 단계 태스크 하나의 계획에 들어 있는가(그래프 검사), 단계마다 선언한 workflow job이 `./gradlew <단계>` 한 줄을 정해진 조건으로 돌리는가(형식 검사) | PR | `pr.yml` `done` 둘째 줄. 형식은 `build-logic/AGENTS.md` |
| `python3 scripts/check-repo-layout.py` | 저장소 루트와 `src/` 최상위에 허용 목록 밖의 항목이 없는가, registry 경로가 허용 폴더 안인가. 아무도 가리키지 않는 compose·스크립트 파일은 경고 | PR(`prCheck` 안) | `verifyRepositoryLayout` |
| `python3 scripts/check-docs.py` | 살아 있는 문서의 언어, 기록·ADR 머리 블록, 문서의 인라인 코드 경로·Gradle 경로가 지금 있는가, 복사한 숫자, 상대 링크(`docs/README.md` 「문서 검사」) | PR(`prCheck` 안) | `documentCheck` |
| `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :mainCheck :integrationCheck --continue` |
| `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `main`: `./gradlew :mainCheck :integrationCheck --continue`(두 단계를 Gradle 한 번에. 한 번 컴파일하고, 직렬 lane이 도는 동안 나머지가 겹친다) |
| `mainCheck` | `configContractCheck` + `qualificationCheck`(`testQualityCheck` 포함) + 공개 경로 스냅숏 + 전송·메시징 qualification lane + 생성 명령 왕복(`verifyFeatureScaffold`) + 모든 leaf의 `mainCheck`(document-contract lane 등) | main | `main.yml` `main`: `./gradlew :integrationCheck :mainCheck --continue` |
| `integrationCheck` | 선언된 strict integration lane 전체(실 컨테이너). 입력이 없는 lane은 빼고 이름을 댄다 | main·nightly | `main.yml` `main`: `./gradlew :integrationCheck :mainCheck --continue`(두 단계를 Gradle 한 번에. 한 번 컴파일하고, 직렬 lane이 도는 동안 나머지가 겹친다. integration이 앞이라 lane이 첫 몇 분부터 슬롯을 쓴다) |
| `performanceCheck` | 선언된 performance lane 전체(부하·종료·풀·자원 한계, 실 서버와 컨테이너). 상한을 매번 단언한다. 손으로 돌리든 workflow든 같은 상한이다 | nightly(다른 무거운 job 뒤: 파일 맨 끝 job이고 runner 하나가 job을 만든 순서대로 돈다. `needs`는 쓰지 않는다 — Gitea 1.27이 `needs`와 `if`를 함께 가진 job을 Blocked에 둔다) | `main.yml` `performance`. 5절 |
| `releaseCheck` | 릴리스 provenance + 공개 경로 스냅숏. 커밋을 `GITHUB_SHA`·`GIT_SHA`·`-PgitRevision=<sha>`로 받고, 없으면 설계대로 실패한다 | 태그 | `release.yml` `release` |
| `:app-bootstrap:verifyEnvKeys` | env 키 레지스트리와 profile YAML·`.env.example` | `mainCheck` 안(`configContractCheck`) | build-logic `ca.config-contract` |
+1 -1
View File
@@ -71,7 +71,7 @@ run_pr() {
}
run_main() {
gradle :mainCheck :integrationCheck --continue
gradle :integrationCheck :mainCheck --continue
gradle -p build-logic test
bash scripts/ci/verify-configuration-cache.sh
}