Skip to content

Conversation

@sung-silver
Copy link
Contributor

Related Issue 🚀

Work Description ✏️

  • dev 환경 람다 배포를 통해 비용 절감을 하기 위해서는 jar 파일의 크기가 압축 전 -> 후 각각 250MB, 50MB 이하여야 합니다
  • 현재 인증 서버 같은 경우 불필요한 라이브러리로 인해 압축 전 69MB, 압축 후 61MB인 상황이었고, 파일 용량을 줄여보고자 현재 사용하지 않고 있는 불필요한 라이브러리 제거하였습니다.
  • 제거 결과: 압축 전 66MB, 압축 후 59MB
  • 압축 전 용량이 250MB 이하이기 때문에 라이브러리만 lambda layer로 분리하는 방법에 대해서 조금 더 알아볼 예정이에요

PR Point 📸

@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 빌드 구성 최적화를 위해 일부 의존성 선언을 제거하고 정리했습니다.
    • 데이터베이스 드라이버 구성을 조정했습니다.

Walkthrough

build.gradle.kts에서 불필요한 라이브러리 의존성을 제거했습니다. JWT 관련 라이브러리(jjwt-api, jjwt-impl, jjwt-jackson), ArchUnit, Fixture Monkey Starter 테스트 의존성 및 MySQL 커넥터를 삭제하고 PostgreSQL 런타임 의존성을 유지했습니다.

Changes

Cohort / File(s) 변경 요약
의존성 및 버전 선언 제거
build.gradle.kts
최상위 속성 선언 3개 제거: archunitVersion, fixtureMonkeyVersion, jsonwebtokenVersion
컴파일 의존성 정리
build.gradle.kts
JWT 의존성(jjwt-api, jjwt-impl, jjwt-jackson) 제거 및 MySQL 커넥터 의존성 제거
테스트 의존성 정리
build.gradle.kts
ArchUnit 및 Fixture Monkey Starter 테스트 의존성 제거
런타임 의존성 조정
build.gradle.kts
PostgreSQL 런타임 의존성 유지 및 포맷팅 정리

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 분

  • 확인 사항: 제거된 의존성들이 실제로 코드베이스에서 사용되지 않는지 검증 필요
  • 주의 영역: JWT 기능이 애플리케이션 어디에서도 사용되지 않는지 확인 (ArchUnit, Fixture Monkey 테스트도 동일)
  • 람다 배포: JAR 파일 크기 감소 효과 및 런타임 동작 검증 권장

Poem

🐰 의존성의 짐을 벗어내고,
JAR 파일은 가벼워지네요.
불필요한 것들 꾹꾹 눌러,
람다 배포 준비 완료!
효율적인 코드여 환영합니다. 🚀

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 제거된 라이브러리(mysql, fixturemonkey 등)를 명시하고 변경사항의 핵심을 잘 반영하고 있습니다.
Description check ✅ Passed 필수 섹션(Related Issue, Work Description)이 모두 작성되었고, Lambda 배포 목적과 구체적인 용량 감소 결과가 명시되어 있습니다.
Linked Issues check ✅ Passed pull request의 변경사항(불필요한 라이브러리 제거)이 연결된 이슈 #226의 목표(Lambda 배포를 위한 JAR 크기 감소)를 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 build.gradle.kts의 의존성 제거에 집중되어 있으며, 이슈 #226 범위 내의 라이브러리 최적화 작업입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#226

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
build.gradle.kts (2)

40-71: PostgreSQL 런타임 의존성 배치 위치 확인

Line 62의 runtimeOnly("org.postgresql:postgresql") 배치가 테스트 관련 의존성 블록(lines 67-70) 이전에 위치하고 있습니다. 일반적으로 런타임 의존성은 테스트 의존성과 구분되는 것이 좋으나, 현재 배치는 기능적으로 문제가 없습니다.

H2 데이터베이스(line 70: testRuntimeOnly("com.h2database:h2"))는 테스트 환경에서 사용될 것으로 예상되는데, PostgreSQL 드라이버가 런타임에만 포함되어 테스트 중 데이터베이스 의존성이 있다면 잠재적 영향이 있을 수 있습니다. 테스트 환경에서 올바른 데이터베이스를 사용 중인지 확인하십시오.


62-71: PostgreSQL과 H2 데이터베이스 드라이버 구성 확인

Line 62의 runtimeOnly("org.postgresql:postgresql")는 프로덕션 런타임용이고, Line 70의 testRuntimeOnly("com.h2database:h2")는 테스트용입니다. 이 구성이 정상적이나, 다음을 확인하세요:

  1. 테스트 환경에서 H2를 데이터베이스로 사용 중인지 확인
  2. 테스트 프로파일(application-test.yaml)에 H2 설정이 있는지 확인
  3. MySQL 제거가 기존 테스트나 개발 환경에 영향을 미치지 않는지 확인
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 620c1e2 and 4fa3623.

📒 Files selected for processing (1)
  • build.gradle.kts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (4)
build.gradle.kts (4)

35-62: 의존성 제거 후 빌드 및 기능 테스트 검증 필수

다음 라이브러리 제거가 확인되었습니다 (AI 요약 기반):

  • JWT: jjwt-api, jjwt-impl, jjwt-jackson
  • 테스트: ArchUnit, Fixture Monkey Starter
  • 데이터베이스: MySQL connector

제거 후 다음 항목을 검증해야 합니다:

  1. 컴파일 에러 확인: 제거된 라이브러리에 의존하는 코드 존재 여부
  2. Spring Auto-configuration: 제거된 라이브러리의 auto-config이 활성화되어 있었는지 확인
  3. 테스트 커버리지: 기존 테스트가 여전히 실행 가능한지 확인 (특히 Fixture Monkey 제거의 영향)
  4. 런타임 기능: 모든 인증/보안 기능이 정상 작동하는지 확인

빌드 및 테스트 결과를 다음과 같이 검증해주세요:

  • ./gradlew clean build 실행 완료 확인
  • ./gradlew test 전체 테스트 통과 확인
  • 애플리케이션 시작 로그에서 에러/경고 확인

62-62: 원본 검토 의견 재평가: 잘못된 분석

제거된 JWT 라이브러리에 대한 우려는 근거 없음입니다.

코드 분석 결과:

  • JJWT 라이브러리(jjwt-api, jjwt-impl, jjwt-jackson): 코드에서 사용되지 않음 (제거해도 안전)
  • JWT 기능: Nimbus JOSE 라이브러리(com.nimbusds.jose)로 구현됨 (spring-boot-starter-oauth2-resource-server의 이행 종속성으로 유지)
  • GoogleAuthService, AppleAuthService, JwksRetrieveService: 모두 Nimbus 라이브러리 사용 중
  • 제거된 다른 의존성: ArchUnit, Fixture Monkey, MySQL 모두 코드에서 미사용

이 PR의 변경사항은 검증되었으며, Lambda 배포 크기 감소 목표에 적절합니다. 원본 검토 의견의 우려는 JJWT와 Nimbus JOSE를 혼동한 것입니다.

Likely an incorrect or invalid review comment.


35-62: 중요한 발견: 코드 분석 결과 원래 리뷰 의견이 잘못되었습니다.

핵심 발견사항:

  1. JWT 구현이 JJWT 라이브러리를 사용하지 않음

    • 모든 JWT 코드는 org.springframework.security.oauth2.jwt.* 에서 import
    • com.nimbusds 라이브러리 사용 (spring-security-oauth2의 일부)
    • io.jsonwebtoken (JJWT) 는 코드에서 한 번도 import되지 않음
  2. JWT는 프로젝트에서 적극 사용 중

    • JwtRSAKeyConfiguration: JwtEncoder/JwtDecoder bean 정의
    • JwtAuthAccessTokenService: 액세스 토큰 생성/검증
    • JwtAuthRefreshTokenService: 리프레시 토큰 생성/검증
  3. 결론: JJWT 제거는 안전함

    • JJWT 라이브러리는 이 프로젝트에서 사용되지 않는 미사용 의존성
    • Spring Security OAuth2가 JWT 처리 담당
    • 코드 기능에 영향 없음

Likely an incorrect or invalid review comment.


40-71: 의존성 제거 검증 완료 - 문제 없음

정적 코드 분석 결과, 제거된 라이브러리들이 코드베이스에서 전혀 사용되지 않았음을 확인했습니다:

  • JWT (jjwt): 모든 소스 파일에서 jjwt 관련 import 또는 사용이 0건. 현재 코드는 Spring Security의 OAuth2 기반 JWT 구현(com.nimbusds)을 사용하고 있으며, 인증 관련 모든 컴포넌트(JwtProvider, JwtAuthAccessTokenService, JwtAuthRefreshTokenService, 보안 필터 등)가 정상 작동합니다.

  • Fixture Monkey: 테스트 디렉토리에서 0건 발견. 유일한 테스트 파일은 기본 context load 테스트만 포함되어 있습니다.

  • MySQL connector: 데이터베이스 드라이버는 PostgreSQL만 사용 중이며, MySQL 관련 코드 0건.

결론: 제거된 의존성들은 실제로 사용되지 않았으므로, 빌드 실패, 누락된 심볼, 테스트 영향, 인증 기능 장애는 발생하지 않습니다.

@sung-silver sung-silver self-assigned this Nov 19, 2025
@sung-silver sung-silver added the 🧼 refactor 코드의 효율/가독성을 위해 수정한 경우 label Nov 19, 2025
@sung-silver sung-silver merged commit 8371fb6 into dev Nov 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧼 refactor 코드의 효율/가독성을 위해 수정한 경우 size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 불필요한 라이브러리 제거

2 participants