deploy 가 CI 빌드 JAR 을 재사용해 중복 빌드 제거#753
Conversation
CI(assemble)와 deploy(bootJar)가 같은 커밋 JAR 을 두 번 빌드하던 중복을 없앤다. CI build 잡이 JAR 을 아티팩트로 올리고, deploy 는 자기를 트리거한 CI 실행(run-id)의 아티팩트를 받아 재빌드(약 47초)를 건너뛴다. run-id 로 못박아 배포 커밋과 다른 커밋의 JAR 을 집는 레이스를 차단한다. 수동배포(workflow_dispatch)는 트리거 CI 가 없어 기존 빌드로 fallback 한다. - build.gradle.kts: plain jar 비활성 — assemble 이 jar 2개를 만들면 COPY build/libs/*.jar 가 모호해져 깨진다. boot jar 하나로 고정. - ci.yml: push 일 때 build/libs/*.jar 를 app-jar 로 업로드(3일 보존). - deploy.yml: actions:read 추가, 자동배포=아티팩트 다운로드/수동배포=빌드 fallback, 실패 알림·요약표에 다운로드 실패 케이스 반영.
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
WalkthroughGradle에서 plain JAR 생성을 비활성화하고, CI가 push 시 단일 JAR을 아티팩트로 업로드하도록 변경했다. 자동 배포는 해당 아티팩트를 다운로드하며, 수동 배포만 로컬 빌드를 수행한다. Docker 배포 방식과 실행 결과 보고도 경로별로 갱신했다. ChangesJAR 아티팩트 기반 배포
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Gradle
participant CI_build_job
participant Artifact_store
participant Deploy_workflow
participant Container_registry
Gradle->>CI_build_job: assemble로 boot JAR 생성
CI_build_job->>Artifact_store: push 시 app-jar 업로드
Deploy_workflow->>Artifact_store: workflow_run의 run-id로 app-jar 다운로드
Artifact_store-->>Deploy_workflow: JAR 반환
Deploy_workflow->>Gradle: workflow_dispatch에서만 bootJar 실행
Deploy_workflow->>Container_registry: docker build 및 docker push 실행
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
49-51: 🩺 Stability & Availability | 🔵 Trivial아티팩트 수명과 자동 배포 복구 정책이 맞지 않을 수 있습니다.
.github/workflows/ci.yml#L49-L51:retention-days를 자동 재배포·롤백 SLA 이상으로 설정하거나, 3일 제한이 운영 정책임을 명시하세요..github/workflows/deploy.yml#L150-L180:app-jar만료·누락 시 JDK/Gradle 기반 자동 fallback을 추가하거나, 해당 경우 수동 배포가 필요하다는 복구 절차를 명확히 하세요.GitHub Actions 아티팩트는 보관 기간이 지나면 만료되므로, 현재 구조에서는 오래된 자동 배포 재시도가 실패할 수 있습니다. (github.com)
As per path instructions,
.github/workflows/**의 concurrency 설정과 운영 리스크를 우선 검토해야 합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 49 - 51, 아티팩트 보관 기간과 자동 재배포·롤백 SLA를 일치시키세요. .github/workflows/ci.yml 49-51의 app-jar 보관 기간을 운영 정책에 맞게 늘리거나 3일 제한이 정책임을 명시하고, .github/workflows/deploy.yml 150-180의 app-jar 만료·누락 경로에는 JDK/Gradle 기반 자동 fallback을 추가하거나 수동 배포가 필요하다는 복구 절차를 명확히 하세요. 관련 workflow의 concurrency 설정과 재배포·롤백 운영 리스크도 함께 검토하세요.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 49-51: 아티팩트 보관 기간과 자동 재배포·롤백 SLA를 일치시키세요. .github/workflows/ci.yml
49-51의 app-jar 보관 기간을 운영 정책에 맞게 늘리거나 3일 제한이 정책임을 명시하고,
.github/workflows/deploy.yml 150-180의 app-jar 만료·누락 경로에는 JDK/Gradle 기반 자동
fallback을 추가하거나 수동 배포가 필요하다는 복구 절차를 명확히 하세요. 관련 workflow의 concurrency 설정과 재배포·롤백
운영 리스크도 함께 검토하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1334ca0b-6a2f-4693-bd1b-2c41c28f40d2
📒 Files selected for processing (3)
.github/workflows/ci.yml.github/workflows/deploy.ymlbuild.gradle.kts
CodeRabbit nitpick 대응. 롤백·재배포가 옛 아티팩트에 의존하지 않음(자동=새 push, 수동=러너 빌드 fallback, blue-green=컨테이너 유지)을 주석으로 self-documenting.
|
CodeRabbit nitpick (ci.yml 아티팩트 retention-days) 대응 — 3일 보존은 안전합니다. 아티팩트를 옛 것으로 소비하는 경로가 없어서입니다:
이 안전 근거가 주석에 없어 혼동을 준 것이라, 근거를 ci.yml 업로드 스텝 주석에 명시해 self-documenting 으로 만들었습니다. |
JAR 은 이미 압축된 zip 이라 기본 level 6 재압축은 크기 이득 없이 CPU 만 쓴다. store 로 업로드 CPU 를 아낀다. CI 는 deploy 가 workflow_run 으로 기다리는 크리티컬 패스.
러너가 arm64 네이티브(#749)라 크로스빌드가 불필요해, build-push-action(buildx)을 기본 docker 데몬의 plain docker build+push 로 바꿔 setup-buildx 스텝(약 10초)을 없앤다. 결과 이미지는 동일(arm64 네이티브). 로컬 docker build 로 Dockerfile.ci 전체 빌드 실증.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/deploy.yml (1)
150-158: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
actions/download-artifact를 v7로 올려 주세요.
이 단계는 자동 배포의 핵심 경로라서,actions/download-artifact@v4의node20런타임보다v7의node24런타임으로 맞춰 두는 편이 안전합니다. 현재run-id와github-token조합은 그대로 유지하면 됩니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/deploy.yml around lines 150 - 158, Update the Download JAR from triggering CI run step, identified by id fetch_jar, to use actions/download-artifact@v7 instead of `@v4`. Preserve the existing run-id and github-token configuration unchanged.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/deploy.yml:
- Around line 150-158: Update the Download JAR from triggering CI run step,
identified by id fetch_jar, to use actions/download-artifact@v7 instead of `@v4`.
Preserve the existing run-id and github-token configuration unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8154b77e-9629-4385-ad1a-7eb237da1bc9
📒 Files selected for processing (1)
.github/workflows/deploy.yml
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Situation
Task
Action
재사용 배선
plain jar 함정 제거
assemble은 실행용 boot jar 와 라이브러리용 plain jar 를 함께 만든다. build/libs 에 jar 가 2개면 배포·CI 의COPY build/libs/*.jar가 어느 jar 인지 모호해져 깨진다.실패 가시성
Docker 빌드 최적화 (전 환경 공통)
Result
연관 이슈
Summary by CodeRabbit
push이벤트일 때에만 애플리케이션 JAR을app-jar아티팩트로 업로드(3일 보관)하고, 누락 시 실패하도록 했습니다.