-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DEV-000] sonarcloud 설정 추가 #193
Conversation
# Conflicts: # src/test/java/ddingdong/ddingdongBE/domain/club/service/FacadeCentralClubServiceImplTest.java
Walkthrough이 변경 사항은 SonarCloud를 사용하여 프로젝트를 빌드하고 분석하는 새로운 GitHub Actions 워크플로 파일 Changes
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🔇 Additional comments (5)build.gradle (5)
현재 사용 중인 SonarQube 플러그인 버전(5.1.0.4882)이 최신 안정 버전보다 낮습니다. 보안 및 기능 개선을 위해 최신 버전으로 업데이트하는 것을 권장드립니다.
테스트 실행 후 자동으로 Jacoco 리포트가 생성되도록 Line range hint 설정이 올바르게 작동하는지 확인하기 위해 다음 사항들을 검증해보시기 바랍니다:
다음 명령어로 로컬에서 테스트해보실 수 있습니다: ./gradlew clean test
./gradlew sonar -Dsonar.login=your-token
코드 커버리지 목표치 설정이 필요합니다 SonarCloud 분석의 품질을 보장하기 위해 다음 속성을 추가하는 것을 권장드립니다: sonar {
properties {
+ property "sonar.coverage.minimum", "80" 또한 다음 속성들도 고려해보시기 바랍니다:
중복된 제외 패턴 리팩토링이 필요합니다 Sonar와 Jacoco 설정에서 동일한 제외 패턴이 중복되어 있습니다. 다음과 같이 공통 변수로 분리하여 재사용하는 것을 권장드립니다: +def excludePatterns = [
+ "**/ddingdong/ddingdongBE/common/**",
+ "**/ddingdong/ddingdongBE/*Request*",
+ "**/ddingdong/ddingdongBE/*Response*",
+ "**/ddingdong/ddingdongBE/*Command*",
+ "**/ddingdong/ddingdongBE/*Query*",
+ "**/ddingdong/ddingdongBE/*Dto*"
+]
sonar {
properties {
- property "sonar.exclusions", [
- "**/ddingdong/ddingdongBE/common/**",
- ...
- ].join(',')
+ property "sonar.exclusions", excludePatterns.join(',')
}
}
jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: excludePatterns)
}))
}
}
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
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
.github/workflows/sonar_cloud.yml (3)
2-7
: develop 브랜치에 대한 보호 규칙 추가 검토 필요SonarCloud 분석이 develop 브랜치에 직접 푸시될 때도 실행되도록 설정되어 있습니다. develop 브랜치의 코드 품질을 보장하기 위해 직접 푸시를 제한하고 PR을 통해서만 변경되도록 브랜치 보호 규칙을 설정하는 것을 권장드립니다.
9-11
: 작업 제한 시간 및 실패 알림 추가 필요빌드 작업에 다음 설정들을 추가하는 것을 제안드립니다:
timeout-minutes
설정으로 작업 시간 제한- 작업 실패 시 알림 설정 (예: Slack)
jobs: build: name: Build and analyze runs-on: ubuntu-latest + timeout-minutes: 10
21-32
: 캐시 보존 기간 설정 검토 필요캐시 설정이 잘 되어 있으나, 장기간 누적되는 것을 방지하기 위해 캐시 보존 기간을 설정하는 것이 좋습니다.
- name: Cache SonarCloud packages uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar + retention-days: 7
build.gradle (2)
5-5
: SonarQube 플러그인 버전 업데이트 권장현재 사용 중인 5.1.0.4882 버전은 최신 버전이 아닙니다. 보안 및 안정성 향상을 위해 최신 버전(5.2.1)으로 업데이트하는 것을 권장드립니다.
- id "org.sonarqube" version "5.1.0.4882" + id "org.sonarqube" version "5.2.1"
88-94
: SonarCloud 설정에 권장 속성 추가 제안기본적인 SonarCloud 설정은 잘 구성되어 있습니다. 하지만 더 효과적인 코드 분석을 위해 다음과 같은 추가 속성들을 고려해보시기 바랍니다:
- 테스트 커버리지 제외 패턴
- 분석 제외 패턴
- Java 버전 명시
sonar { properties { property "sonar.projectKey", "COW-dev_ddingdong-be" property "sonar.organization", "cow-dev" property "sonar.host.url", "https://sonarcloud.io" + property "sonar.coverage.exclusions", "**/test/**, **/Q*.java" + property "sonar.exclusions", "**/test/**, **/Q*.java" + property "sonar.java.source", "17" } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/sonar_cloud.yml
(1 hunks)build.gradle
(2 hunks)
🔇 Additional comments (2)
.github/workflows/sonar_cloud.yml (2)
13-20
: 코드 체크아웃 및 JDK 설정이 적절합니다
- shallow clone을 비활성화하여 더 정확한 분석이 가능하도록 설정되었습니다
- JDK 버전이 명시적으로 지정되어 있어 좋습니다
33-37
:
Sonar 설정 및 토큰 검증 필요
- sonar.properties 설정이 누락되어 있습니다. 프로젝트 키, 조직 등의 기본 설정이 필요합니다.
- SONAR_TOKEN secret이 저장소에 설정되어 있는지 확인이 필요합니다.
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.
고생하셨어요 ㅎㅎㅎ
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.
고생하셨습니다!
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.
Actionable comments posted: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/sonar_cloud.yml
(1 hunks)build.gradle
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/sonar_cloud.yml
🔇 Additional comments (1)
build.gradle (1)
87-88
: 테스트 태스크 설정이 적절합니다
테스트 실행 후 자동으로 Jacoco 리포트가 생성되도록 설정된 것이 좋습니다.
Quality Gate passedIssues Measures |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
🚀 작업 내용
🤔 고민했던 내용
💬 리뷰 중점사항
Summary by CodeRabbit
새로운 기능
버그 수정