Skip to content

Commit 921931b

Browse files
committed
[RELEASE] v2.2.6 PR 생성 시 테스트 자동 실행 CI 워크플로우 추가
2 parents 37d04f5 + 26e69e5 commit 921931b

11 files changed

Lines changed: 172 additions & 33 deletions

File tree

File renamed without changes.

.claude/commands/feature-issue.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ Rules:
3838
- Do not invent implementation details that are not implied by the request.
3939
- Prefer concrete acceptance criteria over vague descriptions.
4040
- If there is no attachment/reference, write `- 없음`.
41+
42+
When the user explicitly asks to create the issue (not just draft it), run:
43+
44+
```bash
45+
gh issue create --title "feature: <summary>" --body "<final markdown body>" --assignee @me --label feat
46+
```
47+
48+
- Always include `--assignee @me` so the issue is assigned to the current user.
49+
- Always include `--label feat` to match this template's convention.

.claude/commands/fix-issue.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ Rules:
3838
- If the issue is operational, include the relevant environment such as prod, dev, EC2, Docker, or CloudWatch.
3939
- Do not claim a root cause unless it is directly supported by the given context.
4040
- If there is no attachment/reference, write `- 없음`.
41+
42+
When the user explicitly asks to create the issue (not just draft it), run:
43+
44+
```bash
45+
gh issue create --title "fix: <summary>" --body "<final markdown body>" --assignee @me --label fix
46+
```
47+
48+
- Always include `--assignee @me` so the issue is assigned to the current user.
49+
- Always include `--label fix` to match this template's convention.

.claude/commands/pr.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ Rules:
5656
- For the checklist, mark an item checked only if the evidence is clear from the context or command results.
5757
- If tests were not run, leave the test checkbox unchecked and mention that in reviewer notes.
5858
- Do not include unrelated refactoring in the summary.
59+
60+
When the user explicitly asks to create the PR (not just draft it), run:
61+
62+
```bash
63+
gh pr create --title "<type>: <summary>" --body "<final markdown body>" --assignee @me --reviewer eunseo9311,sjinssun --label <label>
64+
```
65+
66+
- Always include `--assignee @me` so the PR is assigned to the current user.
67+
- Always include `--reviewer eunseo9311,sjinssun`.
68+
- Determine `<label>` from the current branch's type prefix (`feat/`, `fix/`, `refactor/`, `docs/`, `test/`, `chore/`, `style/`) using this mapping:
69+
70+
| Branch type | Label |
71+
| --- | --- |
72+
| feat | feat |
73+
| fix | fix |
74+
| refactor | refactoring |
75+
| docs | docs |
76+
| test | test |
77+
| chore | chore |
78+
| style | (no label — omit `--label`) |
79+
80+
If the branch type has no matching label in the table, omit `--label` entirely rather than guessing.

.claude/rules/commenting.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
paths:
3+
- "src/main/java/**/*.java"
4+
- "src/test/java/**/*.java"
5+
---
6+
7+
# Commenting Convention
8+
9+
- Comments should be written in a single line whenever possible.
10+
- Each comment must include the author's name and the date.
11+
- Use IntelliJ's default `FIX ME` comment format.
12+
- Use this for parts of the code where there may be a potential issue but immediate exception handling is unnecessary.
13+
- Also use this for parts that are not yet finalized due to unclear business requirements.

.claude/rules/persistence.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
paths:
3+
- "**/persistence/**/*.java"
4+
- "**/repository/**/*.java"
5+
- "**/entity/**/*.java"
6+
- "src/main/resources/db/migration/**"
7+
---
8+
9+
# Persistence & Migration Convention
10+
11+
- Complex queries use the `*RepositoryCustom` interface + `*RepositoryImpl` (QueryDSL) pattern.
12+
- Schema is managed with Flyway migration files at `src/main/resources/db/migration/V{n}__{설명}.sql`.
13+
- `ddl-auto` is set to `none`, so any schema change must be accompanied by a new migration file.

.claude/rules/testing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
paths:
3+
- "src/test/**/*.java"
4+
---
5+
6+
# Test Code Convention
7+
8+
- Test method names must be written in **English**.
9+
- If the code is related to test, write comments for "given, when, then".
10+
- Tests run with `@SpringBootTest` connected to a real DB. Do not mock the DB.

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: EAT-SSU Server PR 테스트 게이트
2+
3+
on:
4+
pull_request:
5+
branches: [ "develop", "main" ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
services:
15+
mysql:
16+
image: mysql:8.0
17+
env:
18+
MYSQL_DATABASE: eatssu_test
19+
MYSQL_ROOT_PASSWORD: test
20+
ports:
21+
- 3306:3306
22+
options: >-
23+
--health-cmd="mysqladmin ping -h localhost"
24+
--health-interval=10s
25+
--health-timeout=5s
26+
--health-retries=10
27+
env:
28+
EATSSU_DB_URL_TEST: jdbc:mysql://localhost:3306/eatssu_test
29+
EATSSU_DB_USERNAME: root
30+
EATSSU_DB_PASSWORD: test
31+
EATSSU_AWS_ACCESS_KEY_DEV: dummy-access-key
32+
EATSSU_AWS_SECRET_KEY_DEV: dummy-secret-key
33+
EATSSU_SLACK_TOKEN: dummy-slack-token
34+
steps:
35+
- uses: actions/checkout@v3
36+
37+
- name: JDK 17 설치
38+
uses: actions/setup-java@v3
39+
with:
40+
java-version: '17'
41+
distribution: 'temurin'
42+
43+
- name: Gradle 캐싱
44+
uses: actions/cache@v3
45+
with:
46+
path: |
47+
~/.gradle/caches
48+
~/.gradle/wrapper
49+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
50+
restore-keys: |
51+
${{ runner.os }}-gradle-
52+
53+
- name: gradlew 실행 권한 부여
54+
run: chmod +x gradlew
55+
56+
- name: 테스트용 JWT 시크릿 생성
57+
run: echo "EATSSU_JWT_SECRET_TEST=$(openssl rand -base64 64 | tr -d '\n')" >> "$GITHUB_ENV"
58+
59+
- name: 테스트 실행
60+
run: ./gradlew test --no-daemon
61+
62+
- name: 테스트 리포트 업로드
63+
if: always()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: test-results
67+
path: build/reports/tests/test

CLAUDE.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1111
- Suggest based on logical reasons.
1212
- For every request, follow this order before writing any code:
1313
1. Analyze the process (현재 구조/흐름 파악)
14-
2. Suggest a direction (어떤 방향으로 접근할지 제시)
15-
3. Present trade-offs (각 방향의 장단점 제시)
16-
4. Do NOT write code unless the user explicitly asks with a direct command such as "개발해줘", "작성해줘", "구현해줘".
17-
18-
## Commenting Convention
19-
20-
- Comments should be written in a single line whenever possible.
21-
- Each comment must include the author's name and the date.
22-
- Use IntelliJ's default `FIX ME` comment format.
23-
- Use this for parts of the code where there may be a potential issue but immediate exception handling is unnecessary.
24-
- Also use this for parts that are not yet finalized due to unclear business requirements.
25-
26-
## Test Code Convention
27-
28-
- Test method names must be written in **English**.
29-
- But if the codes is related to test, write the comment for "given, when, then".
14+
2. If anything is unclear or requires a decision only the user can make, ask clarifying questions before proposing a direction
15+
3. Suggest a direction based on the analysis (and any answers received)
16+
4. Present trade-offs for each direction
17+
5. Do NOT write code unless the user explicitly asks with a direct command such as "개발해줘", "작성해줘", "구현해줘".
18+
- When implementing from a GitHub issue with multiple feature items, process one item at a time: complete the full analyze → clarify → direction → trade-off → explicit approval cycle for a single item before moving to the next.
3019

3120
## Build & Run Commands
3221

@@ -84,18 +73,10 @@ src/main/java/ssu/eatssu/
8473

8574
**다국어(i18n)**: `Localizable` 인터페이스의 `getLocalizedValue(language, ko, en, ja, vi)`를 구현하여 언어별 필드를 반환한다.
8675

87-
**복잡한 쿼리**: `*RepositoryCustom` 인터페이스 + `*RepositoryImpl`(QueryDSL) 패턴을 사용한다.
88-
89-
**DB 마이그레이션**: Flyway를 사용하며, `src/main/resources/db/migration/V{n}__{설명}.sql` 형식으로 관리한다. `ddl-auto: none`이므로 스키마 변경 시 반드시 마이그레이션 파일을 추가해야 한다.
90-
9176
### API 버전 관리
9277

9378
일부 Controller/Service는 V1/V2로 버전이 분리되어 있다(예: `ReviewController`/`ReviewControllerV2`, `ReviewService`/`ReviewServiceV2`). 새 기능은 V2 이상에 추가하거나, 필요 시 새 버전을 생성한다.
9479

95-
### 테스트
96-
97-
테스트는 `@SpringBootTest`로 실제 DB에 연결하여 실행한다. 목(Mock) DB를 사용하지 않는다.
98-
9980
### 배포
10081

10182
GitHub Actions(`deploy.yml`)로 Docker 이미지를 빌드하여 EC2에 SSH 배포한다. `prod`/`dev` 브랜치에 따라 배포 환경이 분기된다.

src/main/java/ssu/eatssu/domain/rating/entity/Ratings.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,23 @@ public class Ratings {
2121
private Integer tasteRating;
2222

2323
private Ratings(Integer mainRating, Integer amountRating, Integer tasteRating) {
24-
Assert.isTrue(mainRating >= 0 && mainRating <= 5, "mainRating must be between 0 and 5");
25-
Assert.isTrue(amountRating >= 0 && amountRating <= 5, "amountRating must be between 0 and 5");
26-
Assert.isTrue(tasteRating >= 0 && tasteRating <= 5, "tasteRating must be between 0 and 5");
24+
Assert.notNull(mainRating, "mainRating must not be null");
25+
validateRange(mainRating, "mainRating");
26+
// FIXME(pooreumjung, 2026-07-04): amountRating/tasteRating을 선택값으로 둘지는 비즈니스 요구사항 확정 필요
27+
validateRange(amountRating, "amountRating");
28+
validateRange(tasteRating, "tasteRating");
2729
this.mainRating = mainRating;
2830
this.amountRating = amountRating;
2931
this.tasteRating = tasteRating;
3032
}
3133

34+
private static void validateRange(Integer rating, String fieldName) {
35+
if (rating == null) {
36+
return;
37+
}
38+
Assert.isTrue(rating >= 1 && rating <= 5, fieldName + " must be between 1 and 5");
39+
}
40+
3241
public static Ratings of(Integer mainRating, Integer amountRating, Integer tasteRating) {
3342
return new Ratings(mainRating, amountRating, tasteRating);
3443
}

0 commit comments

Comments
 (0)