-
Notifications
You must be signed in to change notification settings - Fork 0
SonarCloud CI 실험 #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SonarCloud CI 실험 #69
Conversation
Summary of ChangesHello @KimGyeongLock, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 Pull Request는 프로젝트의 CI/CD 파이프라인을 강화하고 코드 품질을 향상시키기 위한 광범위한 변경 사항을 포함합니다. 주요 서비스 로직을 리팩토링하여 아키텍처를 개선하고, Docker 컨테이너의 보안을 강화하며, 최신 Java 기능을 활용하여 코드의 가독성과 유지보수성을 높였습니다. 또한, 광범위한 테스트 코드 추가를 통해 변경 사항의 안정성을 확보했습니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
안녕하세요. SonarCloud CI 연동 및 코드 품질 개선을 위한 대규모 리팩토링 작업을 리뷰했습니다. 전반적으로 매우 훌륭한 변경 사항들입니다.
주요 변경 내용
- Jacoco, SonarQube, SpotBugs, Gitleaks 등 정적 분석 및 CI 도구 연동
- Dockerfile에서 non-root 사용자 설정을 통한 보안 강화
- CQRS 패턴을 적용하여
CourseService,SummaryService를 Command와 Query로 분리 record타입을 적극적으로 사용하여 DTO를 리팩토링하고, 불변성(immutability) 강화- 다수의 유닛 테스트를 추가하여 코드 안정성 대폭 향상
코드 품질과 안정성을 높이려는 노력이 돋보이는 훌륭한 PR입니다.
주의: CRITICAL BUG
리뷰 코멘트 제약으로 인해 파일에 직접 코멘트를 남기지 못했지만, 심각한 버그가 있습니다.
JwtAuthenticationFilter에서 principal을 Long 타입으로 설정하도록 변경되었으나, SecurityUtil.getCurrentStudentId() 메소드는 여전히 principal을 String으로 캐스팅하려고 시도합니다. 이로 인해 @CheckStudentAccess를 사용하는 모든 API에서 ClassCastException이 발생하여 실패하게 됩니다. 반드시 SecurityUtil을 수정해야 합니다.
그 외 몇 가지 추가 개선 사항에 대한 의견을 코멘트로 남겼습니다.
build.gradle의 일부 설정 정리 및 외부화gitleaks리포트 파일의 버전 관리 제외SummaryCalculator의 잠재적인NullPointerException방어 코드 추가
확인 부탁드립니다.
| [ | ||
| { | ||
| "RuleID": "generic-api-key", | ||
| "Description": "Detected a Generic API Key, potentially exposing access to various services and sensitive operations.", | ||
| "StartLine": 13, | ||
| "EndLine": 13, | ||
| "StartColumn": 11, | ||
| "EndColumn": 96, | ||
| "Match": "app.crypto.email-key=REDACTED\"", | ||
| "Secret": "REDACTED", | ||
| "File": "src/test/java/com/example/gradu/global/crypto/AesGcmUtilTest.java", | ||
| "SymlinkFile": "", | ||
| "Commit": "1ced46de276aa0a46c514937c68dfb8769bb392d", | ||
| "Link": "https://github.com/KimGyeongLock/GRADU/blob/1ced46de276aa0a46c514937c68dfb8769bb392d/src/test/java/com/example/gradu/global/crypto/AesGcmUtilTest.java#L13", | ||
| "Entropy": 4, | ||
| "Author": "LocKey", | ||
| "Email": "rudfhr97@naver.com", | ||
| "Date": "2025-12-21T18:49:33Z", | ||
| "Message": "test: 테스트 코드 커버리지 80% 달성", | ||
| "Tags": [], | ||
| "Fingerprint": "1ced46de276aa0a46c514937c68dfb8769bb392d:src/test/java/com/example/gradu/global/crypto/AesGcmUtilTest.java:generic-api-key:13" | ||
| }, | ||
| { | ||
| "RuleID": "jwt", | ||
| "Description": "Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.", | ||
| "StartLine": 83, | ||
| "EndLine": 83, | ||
| "StartColumn": 32, | ||
| "EndColumn": 167, | ||
| "Match": "REDACTED\"", | ||
| "Secret": "REDACTED", | ||
| "File": "src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java", | ||
| "SymlinkFile": "", | ||
| "Commit": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0", | ||
| "Link": "https://github.com/KimGyeongLock/GRADU/blob/80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0/src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java#L83", | ||
| "Entropy": 5.384508, | ||
| "Author": "LocKey", | ||
| "Email": "rudfhr97@naver.com", | ||
| "Date": "2025-08-05T14:39:29Z", | ||
| "Message": "feat: Redis를 이용한 Refresh Token 관리 구현\n\n- Redis 설정 추가\n - RedisConfig 클래스 생성\n - RedisTemplate Bean 구성 및 Serializer 설정\n\n- RefreshToken 저장소 구현\n - RefreshTokenStore 클래스 추가\n - 토큰 저장, 검증, 삭제 기능 구현\n - 토큰 만료 시간 자동 관리\n\n- 로그아웃 기능 테스트 코드 작성\n - AuthControllerTest에 로그아웃 성공 테스트 추가\n - Redis 기반 토큰 저장소 연동 테스트\n\nResolves: #5", | ||
| "Tags": [], | ||
| "Fingerprint": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0:src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java:jwt:83" | ||
| }, | ||
| { | ||
| "RuleID": "jwt", | ||
| "Description": "Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.", | ||
| "StartLine": 84, | ||
| "EndLine": 84, | ||
| "StartColumn": 33, | ||
| "EndColumn": 168, | ||
| "Match": "REDACTED\"", | ||
| "Secret": "REDACTED", | ||
| "File": "src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java", | ||
| "SymlinkFile": "", | ||
| "Commit": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0", | ||
| "Link": "https://github.com/KimGyeongLock/GRADU/blob/80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0/src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java#L84", | ||
| "Entropy": 5.434736, | ||
| "Author": "LocKey", | ||
| "Email": "rudfhr97@naver.com", | ||
| "Date": "2025-08-05T14:39:29Z", | ||
| "Message": "feat: Redis를 이용한 Refresh Token 관리 구현\n\n- Redis 설정 추가\n - RedisConfig 클래스 생성\n - RedisTemplate Bean 구성 및 Serializer 설정\n\n- RefreshToken 저장소 구현\n - RefreshTokenStore 클래스 추가\n - 토큰 저장, 검증, 삭제 기능 구현\n - 토큰 만료 시간 자동 관리\n\n- 로그아웃 기능 테스트 코드 작성\n - AuthControllerTest에 로그아웃 성공 테스트 추가\n - Redis 기반 토큰 저장소 연동 테스트\n\nResolves: #5", | ||
| "Tags": [], | ||
| "Fingerprint": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0:src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java:jwt:84" | ||
| }, | ||
| { | ||
| "RuleID": "jwt", | ||
| "Description": "Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.", | ||
| "StartLine": 100, | ||
| "EndLine": 100, | ||
| "StartColumn": 32, | ||
| "EndColumn": 167, | ||
| "Match": "REDACTED\"", | ||
| "Secret": "REDACTED", | ||
| "File": "src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java", | ||
| "SymlinkFile": "", | ||
| "Commit": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0", | ||
| "Link": "https://github.com/KimGyeongLock/GRADU/blob/80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0/src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java#L100", | ||
| "Entropy": 5.384508, | ||
| "Author": "LocKey", | ||
| "Email": "rudfhr97@naver.com", | ||
| "Date": "2025-08-05T14:39:29Z", | ||
| "Message": "feat: Redis를 이용한 Refresh Token 관리 구현\n\n- Redis 설정 추가\n - RedisConfig 클래스 생성\n - RedisTemplate Bean 구성 및 Serializer 설정\n\n- RefreshToken 저장소 구현\n - RefreshTokenStore 클래스 추가\n - 토큰 저장, 검증, 삭제 기능 구현\n - 토큰 만료 시간 자동 관리\n\n- 로그아웃 기능 테스트 코드 작성\n - AuthControllerTest에 로그아웃 성공 테스트 추가\n - Redis 기반 토큰 저장소 연동 테스트\n\nResolves: #5", | ||
| "Tags": [], | ||
| "Fingerprint": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0:src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java:jwt:100" | ||
| }, | ||
| { | ||
| "RuleID": "jwt", | ||
| "Description": "Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.", | ||
| "StartLine": 101, | ||
| "EndLine": 101, | ||
| "StartColumn": 33, | ||
| "EndColumn": 168, | ||
| "Match": "REDACTED\"", | ||
| "Secret": "REDACTED", | ||
| "File": "src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java", | ||
| "SymlinkFile": "", | ||
| "Commit": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0", | ||
| "Link": "https://github.com/KimGyeongLock/GRADU/blob/80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0/src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java#L101", | ||
| "Entropy": 5.434736, | ||
| "Author": "LocKey", | ||
| "Email": "rudfhr97@naver.com", | ||
| "Date": "2025-08-05T14:39:29Z", | ||
| "Message": "feat: Redis를 이용한 Refresh Token 관리 구현\n\n- Redis 설정 추가\n - RedisConfig 클래스 생성\n - RedisTemplate Bean 구성 및 Serializer 설정\n\n- RefreshToken 저장소 구현\n - RefreshTokenStore 클래스 추가\n - 토큰 저장, 검증, 삭제 기능 구현\n - 토큰 만료 시간 자동 관리\n\n- 로그아웃 기능 테스트 코드 작성\n - AuthControllerTest에 로그아웃 성공 테스트 추가\n - Redis 기반 토큰 저장소 연동 테스트\n\nResolves: #5", | ||
| "Tags": [], | ||
| "Fingerprint": "80a81972cc8f9ff1348f01ed7bd0bccdcc67a7b0:src/test/java/com/example/gradu/domain/student/controller/AuthControllerTest.java:jwt:101" | ||
| } | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for (Course c : courses) { | ||
| if (!isPassGrade(c.getGrade())) continue; | ||
|
|
||
| if (!RowAssembler.isPassGrade(c.getGrade())) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.getGrade()가 null일 수 있습니다. 현재 RowAssembler.isPassGrade 메소드는 null을 인자로 받으면 NullPointerException을 발생시킬 수 있습니다. isPassGrade를 호출하기 전에 null 체크를 추가하는 것이 안전합니다.
| if (!RowAssembler.isPassGrade(c.getGrade())) continue; | |
| if (c.getGrade() == null || !RowAssembler.isPassGrade(c.getGrade())) continue; |
| properties { | ||
| property "sonar.projectKey", "gradu-backend" | ||
| property "sonar.projectName", "GRADU Backend" | ||
| property "sonar.host.url", "http://localhost:9000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,4 +1,5 @@ | |||
| .env | |||
| .gitleaks.toml | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| html.required = true | ||
| xml.required = true | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|



.