Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
authentication: ${{ steps.filter.outputs.authentication }}
authorization-shared: ${{ steps.filter.outputs.authorization-shared }}
reservation: ${{ steps.filter.outputs.reservation }}
payment: ${{ steps.filter.outputs.payment }}
steps:
- uses: actions/checkout@v4

Expand All @@ -28,6 +29,8 @@ jobs:
- 'authorization-shared/**'
reservation:
- 'reservation/**'
payment:
- 'payment/**'

deploy-gateway:
needs: detect-changes
Expand Down Expand Up @@ -55,3 +58,12 @@ jobs:
packages: write
secrets: inherit
uses: ./.github/workflows/deploy-reservation.yml

deploy-payment:
needs: detect-changes
if: needs.detect-changes.outputs.payment == 'true'
permissions:
contents: read
packages: write
secrets: inherit
uses: ./.github/workflows/deploy-payment.yml
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
authorization-shared: ${{ steps.filter.outputs.authorization-shared }}
reservation: ${{ steps.filter.outputs.reservation }}
event-schema-shared: ${{ steps.filter.outputs.event-schema-shared }}
payment: ${{ steps.filter.outputs.payment }}
common-files: ${{ steps.filter.outputs.common-files }}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,6 +36,8 @@ jobs:
- 'reservation/**'
event-schema-shared:
- 'event-schema-shared/**'
payment:
- 'payment/**'
common-files:
- 'settings.gradle'
- 'gradle/**'
Expand Down Expand Up @@ -99,3 +102,13 @@ jobs:
pull-requests: write
secrets: inherit
uses: ./.github/workflows/test-event-schema-shared.yml

test-payment:
needs: detect-changes
if: needs.detect-changes.outputs.payment == 'true' || needs.detect-changes.outputs.common-files == 'true'
permissions:
contents: read
checks: write
pull-requests: write
secrets: inherit
uses: ./.github/workflows/test-payment.yml
41 changes: 41 additions & 0 deletions .github/workflows/deploy-payment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy Payment Service

on:
workflow_call:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY_PAYMENT }}
tags: |
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./payment/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
55 changes: 55 additions & 0 deletions .github/workflows/test-payment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test Payment Module

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Test payment module
run: ./gradlew --info :payment:test

- name: Publish test results for payment
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: 'payment/build/test-results/test/TEST-*.xml'
check_name: Test Results (payment)

- name: Publish test report for payment
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'payment/build/test-results/test/TEST-*.xml'
check_name: Test Report (payment)

- name: Upload coverage reports to Codecov for payment
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: payment/build/reports/jacoco/test/jacocoTestReport.xml
flags: payment
name: payment-coverage
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ flags:
# Event-Schema-Shared 테스트가 실행되지 않으면 이전 커버리지 유지
carryforward: true

# Payment 모듈
payment:
paths:
- payment/
# Payment 테스트가 실행되지 않으면 이전 커버리지 유지
carryforward: true

# PR에 달리는 커버리지 코멘트 설정
comment:
# 코멘트 레이아웃: 도달률, 차이, flag별 커버리지, 트리 뷰
Expand Down
44 changes: 44 additions & 0 deletions payment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM eclipse-temurin:17-jdk AS builder

WORKDIR /app

# Gradle wrapper 및 설정 파일 복사
COPY gradlew .
COPY gradle gradle
COPY build.gradle .

# payment 빌드를 위한 settings.gradle 생성 (payment만 포함)
RUN printf "include 'payment'\n" > settings.gradle

# 의존성 다운로드를 위한 빌드 파일 복사
COPY payment/build.gradle payment/build.gradle

# Gradle wrapper 실행 권한 부여
RUN chmod +x gradlew

# 의존성 다운로드
RUN ./gradlew :payment:dependencies --no-daemon || true

# 전체 소스 코드 복사
COPY payment payment

# 빌드 실행
RUN ./gradlew :payment:clean :payment:build -x test --no-daemon


FROM eclipse-temurin:17-jre

RUN groupadd -g 10001 appgroup \
&& useradd -u 10001 -g appgroup -s /usr/sbin/nologin -m appuser

WORKDIR /app

COPY --from=builder /app/payment/build/libs/*.jar /app/app.jar

RUN chown appuser:appgroup /app/app.jar

USER appuser

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "/app/app.jar"]
50 changes: 50 additions & 0 deletions payment/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.10'
id 'io.spring.dependency-management' version '1.1.7'
id 'jacoco'
}

group = 'net.catsnap'
version = '0.0.1-SNAPSHOT'
description = 'Catsnap Payment Service'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
mavenCentral()
}

jacoco {
toolVersion = "0.8.7"
}
Comment on lines +22 to +24
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all Jacoco toolVersion declarations across modules
rg "toolVersion" --glob "*/build.gradle" -n -B 1 -A 1

Repository: CUKCatSnap/CUKCATSNAP_Server

Length of output: 950


🌐 Web query:

Jacoco 0.8.7 Java 17 compatibility requirements

💡 Result:

JaCoCo 0.8.7 has only experimental compatibility with Java 17:

  • Java 17 class files: 0.8.7 adds experimental support for Java 17 class files (i.e., analyzing/reporting/instrumenting bytecode compiled for Java 17 is not “officially supported” yet). Official Java 17 support comes in JaCoCo 0.8.8. [1][2]
  • Minimum runtime to run JaCoCo components: JaCoCo’s minimum required Java runtime version is Java 5 (per JaCoCo maintainer; applies to all releases). [2]
  • If you’re using the Maven plugin: the JaCoCo Maven plugin requires Maven 3+, Java 8+ for the Maven runtime, and Java 5+ for the test executor (the JVM running tests with the agent). [3]

Practical takeaway: If you need dependable Java 17 coverage, use JaCoCo ≥ 0.8.8 (0.8.7 is “experimental” for Java 17). [1]

Sources: [1] JaCoCo change history / 0.8.7–0.8.8 notes, [2] JaCoCo users list (maintainer reply referencing 0.8.7 + runtime minimum), [3] JaCoCo Maven plugin prerequisites.


Jacoco 0.8.7은 Java 17 호환성을 위해 0.8.12로 업그레이드 권장됩니다.

0.8.7은 Java 17에 대한 실험적 지원만 제공하며, 공식적인 지원은 0.8.8 이상에서 시작됩니다. 현재 프로젝트에서 일관성 없게 0.8.7 (payment, reservation, gateway, authentication, mono)과 0.8.12 (event-schema-shared, authorization-shared)가 혼용 중이므로, 모든 모듈을 0.8.12로 통일하는 것을 권장합니다.

🤖 Prompt for AI Agents
In `@payment/build.gradle` around lines 22 - 24, The jacoco block currently sets
toolVersion = "0.8.7"; update the jacoco toolVersion to "0.8.12" in this
build.gradle (change the jacoco { toolVersion = "0.8.7" } entry) and ensure you
apply the same 0.8.12 version consistently across all modules (payment,
reservation, gateway, authentication, mono, and any shared modules) so the
project uses a single Jacoco version compatible with Java 17.


jacocoTestReport {
reports {
html.required = true
xml.required = true
csv.required = false
}
}

test {
finalizedBy jacocoTestReport
}

jacocoTestReport {
finalizedBy jacocoTestCoverageVerification
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
useJUnitPlatform()
}
Comment on lines +48 to +50
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build.gradle is missing the jar configuration that is present in other modules. Other modules in the codebase include 'jar { enabled = false }' to prevent the creation of plain jar files (only bootJar is created). Consider adding this configuration for consistency with other modules like reservation and authentication.

Copilot uses AI. Check for mistakes.
Binary file added payment/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions payment/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Comment on lines +1 to +7
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The payment module includes its own gradle wrapper directory with Gradle 8.14.4, while the root project uses Gradle 9.2.1. Other modules (reservation, authentication) don't have their own gradle wrapper directories and rely on the root gradle wrapper. For consistency with the codebase, consider removing the payment-specific gradle wrapper directory (payment/gradle/) and using the root gradle wrapper like other modules. The Dockerfile already copies the root gradle directory, so these local wrapper files may not be used and could cause confusion.

Copilot uses AI. Check for mistakes.
Loading
Loading