Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Walkthrough이번 PR은 새로운 인증 모듈인 aics-auth를 프로젝트에 추가하고, Docker 이미지 빌드 및 배포 워크플로우에 통합하는 변경 내용을 포함합니다. 또한, 기존 aics-admin과 aics-api 모듈의 Swagger 설정 및 구성 파일에 인증 API 관련 프로퍼티(예: Changes
Possibly related issues
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (10)
aics-auth/src/main/java/kgu/developers/auth/config/SwaggerConfig.java (1)
96-120: 다국어 및 문서 유지보수를 위한 분리 구조를 권장합니다.
getDescription()에서 멀티라인 문자열로 문서를 구성하면 추후 다국어 지원이나 문구 수정 시 변경 범위가 커질 수 있습니다. 별도 설정 파일이나 메시지 소스 분리를 통해 유지보수성을 높여보세요.aics-auth/src/main/java/kgu/developers/auth/config/InfraConfig.java (1)
9-15: 컴포넌트 스캔 및 설정 활성화는 적절하지만, 필요 없는 영역까지 스캔하지 않는지 확인해보세요.
@ComponentScan("kgu.developers")범위가 매우 넓을 경우, 불필요한 빈이 생성될 수도 있으니 패키지 구조에 맞춰 세분화하는 방안을 검토해볼 수 있습니다.aics-auth/src/testFixtures/java/auth/application/AuthServiceTest.java (1)
15-19: 테스트 메서드 어노테이션 관리에 유의하세요.
JUnit5(@Test,@BeforeEach)를 잘 적용하셨습니다. 추후 확장 가능한 테스트 툴킷(Mocking 라이브러리, Parameterized Tests 등) 사용 시 충돌이 없는지 점검해보세요.aics-api/src/main/resources/application-local.yml (1)
10-10: 인증 API 포트 설정이 추가되었습니다.환경 변수를 통해 포트를 설정할 수 있도록 적절히 구성되었습니다.
파일 끝에 개행 문자가 누락되었습니다.
YAML 파일 형식 규칙에 따라 파일 끝에 개행 문자를 추가해주세요.
profiles: current-ip: ${CURRENT_IP:localhost} api-port: ${API_SERVER_PORT:8080} admin-api-port: ${ADMIN_API_SERVER_PORT:8081} - auth-api-port: ${AUTH_API_SERVER_PORT:8082} + auth-api-port: ${AUTH_API_SERVER_PORT:8082} +🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 10-10: no new line character at the end of file
(new-line-at-end-of-file)
aics-admin/src/main/resources/application-local.yml (1)
9-10: 코드 일관성 및 린트 수정 필요새로 추가된
admin-api-port와auth-api-port속성이 올바르게 설정되어 있습니다. 다만, YAMLlint에서 지적한 바와 같이 파일 마지막 줄에 newline 문자가 없으므로 추가해 주세요.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 10-10: no new line character at the end of file
(new-line-at-end-of-file)
aics-auth/src/main/resources/application-local.yml (1)
1-10: 프로파일 설정 파일 검토이 설정 파일은 다른 모듈과 일관되게
auth-api-port를 포함한 프로파일 속성을 정의하여 구성 관리에 도움이 됩니다. 단, 파일 끝에 newline 문자가 누락되어 있으니 추가해 주시기 바랍니다.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 10-10: no new line character at the end of file
(new-line-at-end-of-file)
aics-admin/src/main/resources/application-dev.yml (1)
14-15: 환경별 API 포트 설정 검증 필요
auth-api-port속성이 추가되어 인증 API에 대한 설정이 명확해졌으며, 기존의admin-api-port와 함께 일관성 있게 사용되고 있습니다. 파일 마지막에 newline 문자가 없어 YAMLlint에서 오류가 발생하므로, 해당 부분을 수정해 주세요.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
aics-api/src/main/resources/application-dev.yml (1)
14-15: 일관된 포트 설정 및 파일 마무리 작업
auth-api-port및admin-api-port속성이 추가되어 여러 모듈에서 동일한 방식으로 API 포트 설정이 관리되고 있습니다. 설정 자체는 명확하지만, 파일 끝에 newline 문자가 추가되어야 하므로 해당 사항을 반영해 주세요.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
aics-auth/src/main/resources/application-prod.yml (1)
1-15: 생산 환경 설정 및 파일 마무리 작업생산 환경에 적합한 Hibernate 및 Redis 설정이 잘 구성되어 있으며,
ddl-auto: validate,default_batch_fetch_size,jdbc.time_zone등 주요 설정 항목이 적절합니다. 다만, 마지막 줄에 newline 문자가 누락되어 있으니 수정 부탁드립니다.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/dev-build-deploy.yml (1)
91-91: aics-auth 서비스 기동 명령어 추가 및 파일 끝 newline 추가 요청
배포 단계에 aics-auth 서비스를 실행시키는docker-compose up -d aics-auth명령어가 올바르게 추가되었습니다.
추가로, YAMLlint에서 지적한 바와 같이 파일 마지막에 newline 문자가 없습니다. YAML 표준에 맞게 마지막 줄에 newline 문자를 추가해 주시기 바랍니다.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 91-91: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (29)
.github/workflows/dev-build-deploy.yml(3 hunks).github/workflows/pull-request-test-coverage.yml(1 hunks)aics-admin/src/main/java/kgu/developers/admin/config/SwaggerConfig.java(3 hunks)aics-admin/src/main/resources/application-dev.yml(1 hunks)aics-admin/src/main/resources/application-local.yml(1 hunks)aics-api/src/main/java/kgu/developers/api/config/SwaggerConfig.java(4 hunks)aics-api/src/main/resources/application-dev.yml(1 hunks)aics-api/src/main/resources/application-local.yml(1 hunks)aics-auth/build.gradle(1 hunks)aics-auth/src/main/java/kgu/developers/auth/AicsAuthApplication.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/application/AuthService.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/AuthController.java(2 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/AuthControllerImpl.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/exception/AuthExceptionCode.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/exception/TokenNotFoundException.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/request/LoginRequest.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/request/RefreshTokenRequest.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/api/presentation/response/TokenResponse.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/config/InfraConfig.java(1 hunks)aics-auth/src/main/java/kgu/developers/auth/config/SwaggerConfig.java(1 hunks)aics-auth/src/main/resources/application-dev.yml(1 hunks)aics-auth/src/main/resources/application-local.yml(1 hunks)aics-auth/src/main/resources/application-prod.yml(1 hunks)aics-auth/src/main/resources/application.yml(1 hunks)aics-auth/src/testFixtures/java/auth/application/AuthServiceTest.java(2 hunks)aics-auth/src/testFixtures/java/auth/presentation/AuthControllerTest.java(0 hunks)gradle/jacoco.gradle(1 hunks)gradlew.bat(1 hunks)settings.gradle(1 hunks)
💤 Files with no reviewable changes (1)
- aics-auth/src/testFixtures/java/auth/presentation/AuthControllerTest.java
✅ Files skipped from review due to trivial changes (10)
- gradlew.bat
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/request/RefreshTokenRequest.java
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/request/LoginRequest.java
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/exception/TokenNotFoundException.java
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/exception/AuthExceptionCode.java
- aics-auth/src/main/java/kgu/developers/auth/AicsAuthApplication.java
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/AuthController.java
- aics-auth/src/main/java/kgu/developers/auth/api/application/AuthService.java
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/AuthControllerImpl.java
- aics-auth/src/main/java/kgu/developers/auth/api/presentation/response/TokenResponse.java
🧰 Additional context used
🪛 YAMLlint (1.35.1)
aics-admin/src/main/resources/application-dev.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
aics-api/src/main/resources/application-local.yml
[error] 10-10: no new line character at the end of file
(new-line-at-end-of-file)
aics-admin/src/main/resources/application-local.yml
[error] 10-10: no new line character at the end of file
(new-line-at-end-of-file)
aics-api/src/main/resources/application-dev.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
aics-auth/src/main/resources/application-local.yml
[error] 10-10: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/dev-build-deploy.yml
[error] 91-91: no new line character at the end of file
(new-line-at-end-of-file)
aics-auth/src/main/resources/application-dev.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
aics-auth/src/main/resources/application-prod.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (31)
aics-auth/src/main/java/kgu/developers/auth/config/SwaggerConfig.java (2)
50-57: OpenAPI 설정 로직이 명확하고 가독성이 우수합니다.
openAPI()메서드에서 API 정보, 보안, 서버 목록 등을 명시적으로 구성해 유지보수에 용이합니다. 특별한 수정 없이 승인합니다.
69-78: 프로필 서버 설정 누락 시 예외 처리를 고려하세요.
profileConfig에 해당 프로필이 등록되어 있지 않으면 빈 리스트가 반환될 수 있습니다. 향후 다른 환경에서 오류가 발생하지 않도록 예외 처리를 검토해보세요.aics-auth/src/testFixtures/java/auth/application/AuthServiceTest.java (1)
3-6: 패키지 경로 변경이 정상적으로 반영되었습니다.
AuthService,TokenNotFoundException,LoginRequest,RefreshTokenRequest등의 import 경로가 올바르게 수정되어 있습니다.aics-admin/src/main/java/kgu/developers/admin/config/SwaggerConfig.java (3)
40-41: 새로운 인증 API 포트 설정이 추가되었습니다.프로필 설정에서 auth-api-port를 주입받도록 적절히 구성되었습니다.
97-118: API 문서 설명이 개선되었습니다.인증 API 문서에 대한 링크가 추가되어 사용자가 쉽게 접근할 수 있도록 구성되었습니다.
121-124: getAuthSwaggerByProfile 메서드가 적절히 구현되었습니다.기존 메서드 패턴을 따르며 일관성 있게 구현되었습니다.
aics-api/src/main/java/kgu/developers/api/config/SwaggerConfig.java (2)
40-41: 인증 API 포트 설정이 일관성 있게 추가되었습니다.admin 모듈과 동일한 방식으로 auth-api-port 설정이 구현되었습니다.
128-131: getAuthSwaggerByProfile 메서드가 일관성 있게 구현되었습니다.admin 모듈의 구현과 동일한 패턴을 따르고 있어 코드의 일관성이 유지되었습니다.
settings.gradle (1)
4-4: 인증 모듈이 프로젝트에 추가되었습니다.aics-auth 모듈이 적절히 프로젝트 구조에 통합되었습니다.
aics-auth/src/main/resources/application-dev.yml (2)
1-10: 설정 구성 및 기본값 검토
스프링 JPA의ddl-auto: update설정과 Redis 관련 속성들이 환경 변수로 오버라이드될 수 있도록 구성되어 있습니다. 개발 환경에서는 자동 스키마 업데이트가 유용하므로 문제가 없어 보입니다.
11-15: 프로파일 설정 및 파일 종료 처리
profiles섹션에current-ip,api-port,admin-api-port,auth-api-port가 환경 변수 기본값과 함께 잘 정의되어 있습니다. 단, 파일 마지막에 새 줄(newline)이 없는 것으로 보이므로 YAML lint 경고를 해소하기 위해 마지막에 newline 문자를 추가하는 것을 권장합니다.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
aics-auth/build.gradle (4)
1-3: BootJar 태스크 활성화 확인
bootJar태스크가 활성화되어 있어, 이 모듈의 실행 가능한 JAR 파일 생성이 보장됩니다.
5-7: Jar 태스크 활성화 확인
일반jar태스크도 활성화되어 있으며, 필요에 따라 두 가지 아티팩트를 생성할 수 있도록 구성되었습니다.
9-22: 의존성 및 테스트 픽스쳐 설정 검토
여러 모듈에 대한implementation의존성과 테스트 픽스쳐(dependencies 및 testFixturesImplementation) 설정이 일관되게 구성되어 있습니다.
24-32: Jacoco 설정 및 리포트 구성 확인
외부 Gradle 스크립트(../gradle/jacoco.gradle)를 적용하여 Jacoco를 통한 커버리지 리포트를 생성하고, XML 및 HTML 리포트가 모두 활성화되어 있는 점이 적절합니다.aics-auth/src/main/resources/application.yml (9)
1-3: 서버 설정 검토
server.port가 8082로 명시되어 있어, aics-auth 모듈 전용 서버 포트가 올바르게 설정되어 있습니다.
4-7: 애플리케이션 이름 구성
spring.application.name이aics-auth로 설정되어 있어 모듈의 역할을 명확하게 나타내고 있습니다.
8-13: 데이터베이스 연결 정보 구성
PostgreSQL 데이터소스 URL, 사용자명, 비밀번호, 그리고 드라이버 클래스가 환경 변수를 통해 유연하게 관리되도록 구성되어 있습니다. 보안상의 이유로 실제 운영 환경에서는 민감 정보 관리에 주의하시기 바랍니다.
14-23: JPA 설정 검토
Hibernate 설정에서ddl-auto가validate로 지정되어 있어, 스키마 자동 업데이트 대신 스키마 검증을 수행합니다. 이는 운영 환경에 적합한 설정으로 보이며, 필요에 따라 개발 환경에서는update옵션을 고려할 수 있습니다.
24-29: 멀티파트 파일 업로드 설정
파일 업로드 관련max-file-size와max-request-size가 환경 변수로 오버라이드될 수 있도록 설정되어 있으며, 기본값도 명시되어 있어 적절합니다.
30-35: Redis 연결 설정 검토
spring.data.redis관련 설정이 로컬 기본값과 함께 제공되어, 환경 변수로 쉽게 변경 가능하도록 구성되었습니다.
36-41: 파일 업로드 및 보안 설정
파일 URL, 업로드 경로, 비밀 키, 그리고 허용되지 않는 확장자 목록이 명시되어 있어, 파일 관리 및 보안 정책을 명확히 하고 있습니다.
42-48: Springdoc 및 Swagger UI 구성 검토
API 문서를 위한 Springdoc 설정과 Swagger UI의 정렬 옵션이 알파벳 순으로 지정되어 있어, API 스펙 관리를 용이하게 합니다.
49-52: JWT 설정 검토
JWT의 issuer와 secret_key가 환경 변수로 주입되도록 구성되어 있어, 보안 키 관리 및 동적 설정에 적합합니다..github/workflows/pull-request-test-coverage.yml (1)
45-45: aics-auth 모듈 커버리지 리포트 경로 추가
새로 추가된${{ github.workspace }}/aics-auth/build/jacoco/test/jacocoTestReport.xml경로가 전체 테스트 커버리지 계산에 포함되도록 되어 있습니다. 변경 사항이 올바르며, 모듈 분리에 따른 테스트 커버리지 확장이 적절합니다.gradle/jacoco.gradle (2)
59-59: aics-auth 애플리케이션 클래스 제외 추가
"kgu/developers/auth/AicsAuthApplication.class"가 커버리지 계산에서 제외되도록 추가되었습니다. 이는 새로운 인증 모듈의 부트스트랩 클래스를 커버리지에서 제외하여, 불필요한 커버리지 낮은 지표를 방지하기 위한 의도로 보입니다.
63-63: Auth Presentation 제외 패턴 추가
"**/auth/**/presentation/**"패턴이 추가되어, 인증 모듈의 presentation 계층 관련 클래스가 커버리지 대상에서 제외됩니다. 추후 필요에 따라 이 제외 패턴이 적절한지 검토하시기 바랍니다..github/workflows/dev-build-deploy.yml (4)
52-56: aics-auth 도커 이미지 빌드 스텝 추가 확인
새로운 aics-auth 서비스를 위한 Docker 이미지 빌드 스텝이 기존의 aics-api 및 aics-admin과 동일한 형식으로 구현되어 있습니다. Dockerfile 경로와 태그 지정 방식 모두 일관성을 유지하고 있어 문제 없어 보입니다.
68-72: aics-auth 도커 이미지 푸시 스텝 확인
새롭게 추가된 aics-auth 이미지 푸시 스텝은 Docker Hub로 이미지를 푸시하는 명령어가 기존 서비스와 동일한 방식으로 작성되어 있어 정상적으로 동작할 것으로 예상됩니다.
88-88: aics-auth 서비스 배포 pull 명령어 추가 확인
배포 단계에 aics-auth 이미지를 pull 하는 명령어가 추가되었습니다. 다른 서비스와 동일한 방식으로 docker-compose 명령어가 적용되어 있어 배포 프로세스에 잘 통합된 것으로 판단됩니다.
90-90: aics-admin 서비스 기동 명령어 재확인
업데이트된 aics-admin 서비스 기동 명령어는 기존 명령어와 일관된 구조를 유지하고 있습니다. 변경 사항이 형식상의 업데이트라면, 문제없이 동작할 것으로 보입니다.
Test Coverage Report
Files
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #187 +/- ##
=============================================
- Coverage 93.29% 93.18% -0.12%
+ Complexity 134 129 -5
=============================================
Files 49 48 -1
Lines 388 367 -21
Branches 4 3 -1
=============================================
- Hits 362 342 -20
Misses 21 21
+ Partials 5 4 -1
Continue to review full report in Codecov by Sentry.
|
Summary
API에서 Auth 모듈 분리
Tasks
To Reviewer
첫 실행 시 프로파일 및 환경 변수 설정 후 실행 바랍니다!