Conversation
There was a problem hiding this comment.
Pull request overview
develop/main 대상으로 PR 생성 시 Gradle 기반 빌드·테스트(및 코드 스타일 검사)를 자동 실행하는 GitHub Actions CI 워크플로우를 추가합니다.
Changes:
- PR 트리거(
develop,main) 기반 CI 워크플로우 추가 - JDK 25(Temurin) 및 Gradle 액션 세팅 후 Gradle 태스크 실행(ktlintCheck, build)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
eundeang
left a comment
There was a problem hiding this comment.
토큰 문제만 해결하면 될거 같아요! 고생해써요 🫳🏻🫳🏻
|
@claude 리뷰해줭 |
|
Claude finished @suker80's task in 1m 5s —— View job CI 워크플로우 코드 리뷰
전반적인 구성기본적인 CI 파이프라인 구조는 잘 갖춰져 있습니다. 아래 몇 가지 개선 포인트를 공유합니다. P1: SUBMODULE_TOKEN fallback 처리 필요 (line 19)token: ${{ secrets.SUBMODULE_TOKEN }}Copilot 리뷰에서도 지적된 부분인데, token: ${{ secrets.SUBMODULE_TOKEN != '' && secrets.SUBMODULE_TOKEN || github.token }}PR 본문에서 "SUBMODULE_TOKEN 시크릿은 submodule 레포 접근 권한 확보 후 등록 예정"이라고 언급하셨는데, 그 전까지는 fallback 처리를 해두는 게 안전합니다. P1: ktlintCheck 태스크 미존재 (line 31)- name: Run ktlint
run: ./gradlew ktlintCheck
PR 본문에서 "ktlint 플러그인 설정은
P2: JDK 25 사용 (line 24)java-version: '25'JDK 25는 현재(2026-04) Early Access 단계입니다. - name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
check-latest: trueP3: Gradle 캐시 활용
P3:
|
| 우선순위 | 항목 | 상태 |
|---|---|---|
| P1 | SUBMODULE_TOKEN fallback 처리 | 수정 필요 |
| P1 | ktlintCheck 태스크 미존재 | 수정 필요 (혹은 임시 제거) |
| P2 | JDK 25 EA 안정성 확인 | 검토 권장 |
| P3 | 향후 DB 테스트 대비 | 참고 사항 |
CI 개선 제안현재 워크플로우에 아래 4가지를 추가하면 좋을 것 같습니다. 1. JaCoCo 테스트 커버리지 PR 코멘트
2. Detekt 정적 분석
3. Docker 이미지 빌드 검증
4. Gradle Build Cache 최적화
사전 세팅 필요
수정된 ci.yml 전체name: CI
on:
pull_request:
branches: [ develop, main ]
permissions:
contents: read
pull-requests: write # JaCoCo 커버리지 코멘트용
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN != '' && secrets.SUBMODULE_TOKEN || github.token }}
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
# ── Gradle Setup (Build Cache 포함) ──
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
# ── Lint ──
- name: Run ktlint
run: ./gradlew ktlintCheck
# ── Detekt (정적 분석) ──
- name: Run Detekt
run: ./gradlew detekt
# ── Build & Test + JaCoCo 리포트 생성 ──
- name: Build and Test
run: ./gradlew build jacocoTestReport
# ── JaCoCo 커버리지 PR 코멘트 ──
- name: JaCoCo Coverage Report
if: github.event_name == 'pull_request'
uses: madrapps/jacoco-report@v1.7.1
with:
paths: '**/build/reports/jacoco/test/jacocoTestReport.xml'
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 50
min-coverage-changed-files: 70
title: '📊 테스트 커버리지 리포트'
update-comment: true
# ── Docker 이미지 빌드 검증 ──
- name: Docker Build (verification only)
run: |
docker build -t ${{ github.repository }}:pr-${{ github.event.pull_request.number }} . |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthroughdevelop/main 대상 PR에서 실행되는 GitHub Actions CI 워크플로우를 추가하고 Gradle 설정에 detekt, jacoco 및 테스트-리포트 후속 처리를 도입했습니다. 소스 코드에서는 테스트 어노테이션과 사소한 포맷 변경만 있습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub
participant GHA as GitHub\ Actions
participant Repo as Repository
participant Gradle as Gradle
participant Detekt as Detekt
participant JaCoCo as JaCoCo
participant Docker as Docker
GH->>GHA: PR to develop/main triggers workflow
GHA->>Repo: Checkout repo (with submodules, optional token)
GHA->>Gradle: Setup JDK 25 & Gradle cache
GHA->>Detekt: Run detekt
Detekt-->>GHA: Analysis results
GHA->>Gradle: Run ktlintCheck
Gradle-->>GHA: Lint results
GHA->>Gradle: ./gradlew build jacocoTestReport
Gradle->>JaCoCo: Generate XML/HTML reports
JaCoCo-->>GHA: Coverage reports
GHA->>GH: Post/update PR comment with coverage (overall 50%, changed 70%)
alt Dockerfile present
GHA->>Docker: Build image (tagged with PR number)
Docker-->>GHA: Build result
end
GHA-->>GH: Workflow status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Line 32: The cache-read-only expression currently uses github.ref !=
'refs/heads/main' which is always true for pull_request events; change the logic
for the cache-read-only key so PRs are evaluated against github.base_ref
(compare base branch name to "main") while non-PR events continue to use
github.ref (compare to 'refs/heads/main'), e.g. implement a conditional using
github.event_name to pick github.base_ref != "main" for pull_request events and
github.ref != "refs/heads/main" otherwise so cache writes are enabled when the
target is main.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 5d9f2993-988d-47d3-b01a-5fc0c40c6010
📒 Files selected for processing (3)
.github/workflows/ci.ymlbuild.gradle.ktssrc/test/kotlin/com/team2/server/ServerApplicationTests.kt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- JaCoCo 테스트 커버리지 PR 코멘트 추가 - Detekt 정적 분석 스텝 추가 - Docker 빌드 검증 스텝 추가 (Dockerfile 존재 시) - Gradle Build Cache 최적화 (main 외 캐시 읽기 전용) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Kotlin 2.3.0으로 설정 (Detekt 호환) - Detekt 2.0.0-alpha.2, ktlint 1.6.0 적용 - JaCoCo 커버리지 PR 코멘트 추가 - Docker 빌드 검증 스텝 추가 (Dockerfile 존재 시) - Gradle Build Cache 최적화 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR 이벤트에서 github.ref가 항상 refs/pull/*/merge라서 main 타겟 PR에서도 캐시 쓰기가 비활성화되는 문제 수정 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
32-32:⚠️ Potential issue | 🟠 Major
cache-read-only조건식이 PR에서 항상true가 될 수 있습니다.Line 32 조건은
pull_request에서github.ref가refs/pull/.../merge인 점 때문에 의도와 다르게 캐시 쓰기가 계속 막힐 수 있습니다. 이전 리뷰 지적과 동일한 유형으로 보입니다.수정안
- cache-read-only: ${{ github.event_name == 'pull_request' && github.base_ref != 'main' || github.ref != 'refs/heads/main' }} + cache-read-only: ${{ (github.event_name == 'pull_request' && github.base_ref != 'main') || (github.event_name != 'pull_request' && github.ref != 'refs/heads/main') }}In GitHub Actions, for `pull_request` events, what are the exact formats/values of `github.ref` and `github.base_ref`?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml at line 32, The current `cache-read-only` boolean expression improperly evaluates `github.ref` for `pull_request` events causing cache to remain read-only; update the condition so it first checks `github.event_name == 'pull_request'` and in that branch only consults `github.base_ref != 'main'`, otherwise (when not a pull_request) consult `github.ref != 'refs/heads/main'`; modify the `cache-read-only` expression accordingly (ensure proper grouping/parentheses) so PRs use `github.base_ref` and non-PR runs use `github.ref`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@build.gradle.kts`:
- Line 64: There is an extraneous blank line causing ktlintKotlinScriptCheck to
fail; remove the empty line (the unnecessary whitespace) at the location around
the build script where the blank line appears (previously at line 64) so the
Kotlin script has no redundant empty line and ktlint passes; ensure there are no
other adjacent stray blank lines in the same block or top-level of the
build.gradle.kts file.
- Line 8: Replace the alpha Detekt plugin version with the stable release:
locate the plugin declaration id("dev.detekt") version "2.0.0-alpha.2" in
build.gradle.kts and change the version string to "1.23.8" so the project uses
the stable Detekt release for CI/production.
---
Duplicate comments:
In @.github/workflows/ci.yml:
- Line 32: The current `cache-read-only` boolean expression improperly evaluates
`github.ref` for `pull_request` events causing cache to remain read-only; update
the condition so it first checks `github.event_name == 'pull_request'` and in
that branch only consults `github.base_ref != 'main'`, otherwise (when not a
pull_request) consult `github.ref != 'refs/heads/main'`; modify the
`cache-read-only` expression accordingly (ensure proper grouping/parentheses) so
PRs use `github.base_ref` and non-PR runs use `github.ref`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 431197df-edf8-467e-9b70-b879c79ae51d
📒 Files selected for processing (3)
.github/workflows/ci.ymlbuild.gradle.ktssrc/test/kotlin/com/team2/server/ServerApplicationTests.kt
✅ Files skipped from review due to trivial changes (1)
- src/test/kotlin/com/team2/server/ServerApplicationTests.kt
- Kotlin 2.3.0 호환을 위해 dev.detekt:2.0.0-alpha.2 사용 (1.23.8은 Kotlin 2.0.21 기준) - MdcLoggingFilter 클래스 본문 첫 줄 공백 제거 (ktlint 위반) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📊 테스트 커버리지 리포트
|
🔗 Issue
closes #14
💬 Context
PR 시 자동으로 빌드·테스트를 수행하는 GitHub Actions CI 워크플로우를 추가합니다.
develop,main브랜치 대상 PR이 생성되면 ktlint 검사 및 Gradle 빌드·테스트가 자동 실행됩니다.🛠 Changes
.github/workflows/ci.yml— GitHub Actions CI 워크플로우 추가./gradlew ktlintCheck)./gradlew build)👀 Review Focus
✅ Check List
Summary by CodeRabbit
New Features
Chores
Tests