[global] Gradle에서 Bazel로 빌드 시스템 전면 전환#366
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the project's build system from Gradle to Bazel, removing all Gradle-related files and introducing Bazel module definitions, custom Kotlin toolchains, and module-specific BUILD files. It also updates the Dockerfiles to use layered runtime classpaths instead of fat jars, and refactors the KmpExportProcessor to use standard KSP code generation with a guard against multi-round PSI invalidation. Feedback on the changes identifies a security vulnerability in datagsm-shared/publish.sh where the use of exec mvn prevents the cleanup of a temporary file containing the sensitive GITHUB_TOKEN; it is recommended to remove exec and use a trap to guarantee deletion.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…ut v6, setup-node v5)
There was a problem hiding this comment.
Code Review
This pull request migrates the project's build system from Gradle to Bazel, removing all Gradle-related configuration files and wrapper scripts. It introduces Bazel module definitions, custom Kotlin toolchains, and shared macros for Spring Boot service containerization and Kotest execution. Additionally, the KSP processor was refactored to safely use CodeGenerator with a multi-round guard, and the Dockerfiles were updated to run services using a layered classpath (java -cp) instead of a fat JAR. During the review, a high-severity issue was identified in the publishing script (datagsm-shared/publish.sh), which incorrectly searches for shared.jar instead of the Bazel-generated libshared.jar.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
아래표가 제가 생각하는 해당 작업을 통해 얻는 주요 트레이드 오프입니다.
가장 큰 문제는 IDE와의 통합이 떨어지고, 팀원들이 익숙하지 않은 DSL과 빌드 툴을 사용하면서 겪는 러닝 커브라고 생각되는데, 그에 비해 해결하는 문제가 마이너하다고 생각됩니다. 기존의 ksp, kmp 동작에서 내부 구조적으로 문제가 있었지만 실사용에 문제가 될 정도는 아니였는데, 이 부분을 위해 빌드툴 전체를 교체하고, 팀원들이 새 빌드툴을 배우는데에 리소스가 사용되는 것은 제 생각에 좋은 변경이 아닌 것 같습니다. |
IDE 통합은 JetBrains의 공식 지원에 포함되는 부분이라 크게 문제가 되지 않는다고 생각합니다. |
- build.gradle.kts: Bazel 전환에 따라 삭제 유지 (develop의 버전 bump 무시) - datagsm-prod-cd.yaml: develop의 ref/트리거 로직 유지 + 빌드 셋업은 Bazel/JDK17로 통일
개요
빌드 시스템을 Gradle에서 Bazel로 전면 전환합니다. 7개 모듈 빌드·테스트·린트·컨테이너·발행·CI/CD를 모두 Bazel로 옮기고, Gradle 관련 파일(
build.gradle.kts×9,buildSrc,gradlew,settings.gradle.kts,gradle/,kotlin-js-store)을 제거했습니다.연관 이슈
KmpExportProcessor를codeGenerator.createNewFile기반으로 되돌리고, 2차 라운드 가드를 추가해 PSI 무효화 문제를 회피했습니다.configuration cache지원 시problems=fail로 격상 #340 — [global] KMPconfiguration cache제약: Gradle 제거로 해당 제약 자체가 소멸합니다.검증 상태
bazel build //...→ 71개 타깃 그린bazel test //...→ 6개 테스트 타깃 PASS (web 모듈만 332개 케이스)docker run기동 검증 (Spring 컨텍스트·멀티스토어 정상)java -cp 'lib/*') prod 프로파일 기동 검증@JsExport잔재 외 100% 동일,.d.ts는tsc --strict --noEmit통과나아진 점
createNewFile+ 라운드 가드). 부수적으로 멀티라운드에서index.d.ts가 부분 덮어쓰기되던 잠재 버그도 구조적으로 차단.configuration cache지원 시problems=fail로 격상 #340 무의미화 — Gradleconfiguration cache× KMP 한계가 사라짐.//bazel:kt_jvm_target플래그로 분리.bazel run //<module>:<name>_image_load).퇴보한 점 / 트레이드오프
bazel test //...는 OCI 이미지·deploy tar·TS 패키지까지 함께 빌드해 Gradlebuild보다 산출물이 많음(아래 벤치 참고). 타깃 단위(bazel test //datagsm-web:web_test)로 빌드하면 동등.bazel test에 미통합 — 별도 명령(bazel run //bazel:ktlint). Gradle은build에 포함했음.mvn deploy:deploy-file에 의존(PATH에mvn필요).@JsExport제거 및createNewFile전환(단, 이는 [global] KSP 파일 직접 쓰기 회피책 원복 및 증분 처리 복구 검토 #341 해소이기도 함).정량 벤치마크 (로컬, M-series / 의존성 캐시 상태)
//..., 서비스 1파일)해석: 7모듈 규모에선 로컬 빌드 성능은 대등합니다. Bazel의 실익은 로컬 속도가 아니라 원격 캐시(CI)·재현성·세분화된 의존 그래프·컨테이너 네이티브에 있습니다.
미검증 / 후속 과제