From f82f9fc1041c5fc0d8160663b6de30a3760a1588 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Mon, 23 Nov 2026 12:02:50 +0900 Subject: [PATCH] =?UTF-8?q?build(app-bootstrap):=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=EC=86=8C=20=EA=B3=84=EC=95=BD=20=EC=8B=9C=ED=97=98=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EC=97=90=20Gradle=20wrapper=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=9D=84=20=EB=84=A3=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit repositoryContractTest의 gradleWrapperIsCheckedInAndValidatedByTheOfficialAction은 gradle/wrapper/gradle-wrapper.properties를 읽어 distributionSha256Sum=와 validateDistributionUrl=true를 요구하고, wrapper jar와 gradlew가 있는지 본다. 그런데 lane 입력 repositoryContractInputs에는 이 세 파일이 없다. Gradle 루트 fileTree는 gradle/ 아래를 'gradle/*.properties'처럼 한 단계만 넣어 gradle/wrapper/의 두 파일이 밖이고, 루트의 gradlew는 어느 include도 이름으로 잡지 않는다. 이 lane은 캐시를 쓰므로(main 단계도 실서버 lane도 아님) Gradle 버전을 그대로 두고 checksum 줄만 지운 PR은 cache key가 main의 마지막 run과 같아 시험을 돌리지 않고 FROM-CACHE로 통과한다. 고친 방법: 같은 include에 'gradle/wrapper/**'와 'gradlew'를 더하고 위 주석에 한 줄을 더한다. 시험이 보는 세 파일이 모두 입력이 된다. 이 파일들은 Gradle 버전을 올릴 때만 바뀌어 lane이 더 자주 돌지 않는다. documentContractInputs는 이 입력을 품어 따라 넓어진다. 버린 안: - 'gradle/**' 하나로 바꾸기: 오늘은 같은 파일 집합(gradle/README.md는 **/*.md exclude로 빠짐)이지만 gradlew는 gradle/ 밖이라 따로 더해야 하고, 앞으로 gradle/ 아래에 생길 파일을 읽는 시험이 없어도 lane을 다시 돌린다. include 줄이 읽는 파일을 이름으로 적는 지금 꼴을 따랐다. - lane을 mainStage()로 옮기기: checksum 검사가 PR에서 빠지고 main 단계 시간이 는다. - 시험을 documentContractTest로 옮기기: wrapper는 문서가 아니고 그 lane은 main 단계다. 위험·한계: gradlew.bat은 시험이 읽지 않아 넣지 않았다. wrapper jar 내용이 바뀌면 이 lane이 다시 돈다(오늘도 버전을 올리면 배포본 classpath가 바뀌어 다시 돈다). 병합 뒤 첫 PR run에서 FROM-CACHE가 이어지는지는 CI 로그로 따로 본다. 검증: desktop 버릴 worktree, build cache 켬, 명령은 모두 `./gradlew :app-bootstrap:repositoryContractTest --build-cache --no-daemon --console=plain` (잠금 아래, 로그 desktop ~/be-lane-g24-probe-logs/). - 고치기 전(509a8a78, 트리 7a93e757): 캐시 채움 rc=0(65개 실패 0) -> 4행 distributionSha256Sum 삭제 -> `UP-TO-DATE` rc=0, cleanRepositoryContractTest 뒤 `FROM-CACHE` rc=0. 6행 validateDistributionUrl=false도 clean 뒤 `FROM-CACHE` rc=0. - 고친 트리(3292b154): 변이 없이 채움(실행) -> cleanRepositoryContractTest -> `FROM-CACHE` rc=0. 4행 삭제 -> 실행, FAILED rc=1, gradleWrapperIsCheckedInAndValidatedByTheOfficialAction이 258행 "distributionSha256Sum=" 대조로 실패. 되돌리면 `FROM-CACHE`. 6행 변이 -> 실행, FAILED rc=1, 259행 "validateDistributionUrl=true" 대조로 실패. gradlew 끝에 주석 한 줄 -> 실행 rc=0. - 노트북 `python3 -m unittest discover -s scripts/tests` Ran 350 OK. - PR 단계 게이트(desktop `scripts/verify.sh pr --no-cache`)는 이 커밋에서 돌리고 결과를 PR 본문에 적는다. Refs: CI-BE-0012 --- src/bootstrap/app/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/app/build.gradle b/src/bootstrap/app/build.gradle index 16068210..be5edb91 100644 --- a/src/bootstrap/app/build.gradle +++ b/src/bootstrap/app/build.gradle @@ -370,8 +370,10 @@ def repositoryContractInputs = files( fileTree(rootProject.projectDir) { // The Gradle root is the repository root: the tool settings, every build script, and the // version catalog, module registry and test-image list beside the wrapper. + // The wrapper itself too (gradlew, its jar, the checksum its properties pin): gradle/* is one level. include 'config/**', '**/*.gradle', 'gradle/*.toml', 'gradle/*.json', 'gradle/*.properties', - 'Dockerfile*', '.env*', 'src/**/src/main/**', 'build-logic/src/main/**' + 'gradle/wrapper/**', 'gradlew', 'Dockerfile*', '.env*', 'src/**/src/main/**', + 'build-logic/src/main/**' // The compose lane fixtures this leaf owns (the lane contract, overlays, smoke clients). include 'src/bootstrap/app/compose-lanes/**' // The release data a capability leaf owns (readiness cards, release registries). -- 2.54.0