-
Notifications
You must be signed in to change notification settings - Fork 0
[RELEASE] v2.2.6 PR 생성 시 테스트 자동 실행 CI 워크플로우 추가 #392
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
95ff146
refactor: CLAUDE.md 컨벤션을 .claude/rules로 분리
pooreumjung 65765cc
refactor: review 커맨드를 backend-review로 이름 변경
pooreumjung 9b335f4
docs: 코드 작성 전 되묻기 및 이슈 단위 작업 규칙 추가
pooreumjung 0c9fc52
feat: 이슈/PR 생성 시 담당자·라벨·리뷰어 자동 지정
pooreumjung 48ac01f
fix: rules paths 스코프 보완 (코드 리뷰 반영)
pooreumjung b7eaa13
Merge pull request #384 from EAT-SSU/feat/#383-add-claude-rules-renam…
pooreumjung 1cb487a
feat: PR 생성 시 테스트 자동 실행하는 CI 워크플로우 추가
pooreumjung 7a7ea73
refactor: JWT 테스트 시크릿을 하드코딩 대신 실행 시점 랜덤 생성으로 변경
pooreumjung 4f6af9f
fix: Ratings 생성 시 평점 값이 null이면 NPE 발생하던 문제 수정
pooreumjung b148510
fix: 코드 리뷰 반영 - mainRating null 검증 추가 및 평점 범위 1~5로 통일
pooreumjung 00a0a45
Merge pull request #390 from EAT-SSU/fix/#387-handle-null-ratings
pooreumjung 20e1ff7
test: 닉네임 시작/끝 숫자 허용 스펙에 맞게 NicknameValidatorTest 기대값 수정
pooreumjung ddbfc67
style: 코드 리뷰 반영 - 테스트 메서드명 영문화 및 given/when/then 주석 추가
pooreumjung 5bf02c7
Merge pull request #391 from EAT-SSU/fix/#388-validate-nickname-edges
pooreumjung 7cd80e8
Merge remote-tracking branch 'origin/develop' into feat/#385-add-pr-t…
pooreumjung 26e69e5
Merge pull request #389 from EAT-SSU/feat/#385-add-pr-test-ci-workflow
pooreumjung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| paths: | ||
| - "src/main/java/**/*.java" | ||
| - "src/test/java/**/*.java" | ||
| --- | ||
|
|
||
| # Commenting Convention | ||
|
|
||
| - Comments should be written in a single line whenever possible. | ||
| - Each comment must include the author's name and the date. | ||
| - Use IntelliJ's default `FIX ME` comment format. | ||
| - Use this for parts of the code where there may be a potential issue but immediate exception handling is unnecessary. | ||
| - Also use this for parts that are not yet finalized due to unclear business requirements. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| paths: | ||
| - "**/persistence/**/*.java" | ||
| - "**/repository/**/*.java" | ||
| - "**/entity/**/*.java" | ||
| - "src/main/resources/db/migration/**" | ||
| --- | ||
|
|
||
| # Persistence & Migration Convention | ||
|
|
||
| - Complex queries use the `*RepositoryCustom` interface + `*RepositoryImpl` (QueryDSL) pattern. | ||
| - Schema is managed with Flyway migration files at `src/main/resources/db/migration/V{n}__{설명}.sql`. | ||
| - `ddl-auto` is set to `none`, so any schema change must be accompanied by a new migration file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| paths: | ||
| - "src/test/**/*.java" | ||
| --- | ||
|
|
||
| # Test Code Convention | ||
|
|
||
| - Test method names must be written in **English**. | ||
| - If the code is related to test, write comments for "given, when, then". | ||
| - Tests run with `@SpringBootTest` connected to a real DB. Do not mock the DB. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: EAT-SSU Server PR 테스트 게이트 | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "develop", "main" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| mysql: | ||
| image: mysql:8.0 | ||
| env: | ||
| MYSQL_DATABASE: eatssu_test | ||
| MYSQL_ROOT_PASSWORD: test | ||
| ports: | ||
| - 3306:3306 | ||
| options: >- | ||
| --health-cmd="mysqladmin ping -h localhost" | ||
| --health-interval=10s | ||
| --health-timeout=5s | ||
| --health-retries=10 | ||
| env: | ||
| EATSSU_DB_URL_TEST: jdbc:mysql://localhost:3306/eatssu_test | ||
| EATSSU_DB_USERNAME: root | ||
| EATSSU_DB_PASSWORD: test | ||
| EATSSU_AWS_ACCESS_KEY_DEV: dummy-access-key | ||
| EATSSU_AWS_SECRET_KEY_DEV: dummy-secret-key | ||
| EATSSU_SLACK_TOKEN: dummy-slack-token | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: JDK 17 설치 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Gradle 캐싱 | ||
| 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: gradlew 실행 권한 부여 | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: 테스트용 JWT 시크릿 생성 | ||
| run: echo "EATSSU_JWT_SECRET_TEST=$(openssl rand -base64 64 | tr -d '\n')" >> "$GITHUB_ENV" | ||
|
|
||
| - name: 테스트 실행 | ||
| run: ./gradlew test --no-daemon | ||
|
|
||
| - name: 테스트 리포트 업로드 | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-results | ||
| path: build/reports/tests/test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,23 @@ public class Ratings { | |
| private Integer tasteRating; | ||
|
|
||
| private Ratings(Integer mainRating, Integer amountRating, Integer tasteRating) { | ||
| Assert.isTrue(mainRating >= 0 && mainRating <= 5, "mainRating must be between 0 and 5"); | ||
| Assert.isTrue(amountRating >= 0 && amountRating <= 5, "amountRating must be between 0 and 5"); | ||
| Assert.isTrue(tasteRating >= 0 && tasteRating <= 5, "tasteRating must be between 0 and 5"); | ||
| Assert.notNull(mainRating, "mainRating must not be null"); | ||
| validateRange(mainRating, "mainRating"); | ||
| // FIXME(pooreumjung, 2026-07-04): amountRating/tasteRating을 선택값으로 둘지는 비즈니스 요구사항 확정 필요 | ||
| validateRange(amountRating, "amountRating"); | ||
| validateRange(tasteRating, "tasteRating"); | ||
| this.mainRating = mainRating; | ||
| this.amountRating = amountRating; | ||
| this.tasteRating = tasteRating; | ||
| } | ||
|
|
||
| private static void validateRange(Integer rating, String fieldName) { | ||
| if (rating == null) { | ||
| return; | ||
| } | ||
| Assert.isTrue(rating >= 1 && rating <= 5, fieldName + " must be between 1 and 5"); | ||
| } | ||
|
Comment on lines
+34
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 동일하게 private static void validateRange(Integer rating, String fieldName) {
if (rating == null) {
return;
}
if (rating < 1 || rating > 5) {
throw new IllegalArgumentException(fieldName + " must be between 1 and 5");
}
}References
|
||
|
|
||
| public static Ratings of(Integer mainRating, Integer amountRating, Integer tasteRating) { | ||
| return new Ratings(mainRating, amountRating, tasteRating); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
도메인 엔티티에서 JWT 라이브러리의 내부 유틸리티 클래스인
io.jsonwebtoken.lang.Assert를 사용하는 것은 도메인 레이어가 외부 보안 라이브러리에 강하게 결합되는 설계적 문제가 있습니다. 표준 Java 예외(IllegalArgumentException)를 직접 던지거나java.util.Objects를 사용하여 검증하는 것이 좋습니다.References