Skip to content

Commit 2fc52c3

Browse files
alexization백효석
andauthored
(#81) backend verification과 AGENTS entrypoint 정렬
* chore: 백엔드 레거시 검증 자산 제거 - legacy verification Gradle task와 CI workflow 제거 - OpenAPI tracked 문서와 verification 전용 테스트 제거 - harness 재구성을 위한 clean baseline 정리 * ci: 백엔드 최소 검증 게이트 복구 * docs: 백엔드 엔트리포인트를 AGENTS로 정리 - backend root AGENTS.md 추가 - README overview-only 원칙과 verification/bootstrap discovery order 명시 - local skill 부재 시 repo-local fallback source 정리 * ci: 백엔드 PR 리뷰 피드백을 반영 - CI와 deploy verify 단계에 packaging build 추가 - 수동 배포를 main과 release tag ref로 제한 - AGENTS verification 문구를 실제 task wiring에 맞게 수정 --------- Co-authored-by: 백효석 <202580031@jei.com>
1 parent 13c2ae5 commit 2fc52c3

4 files changed

Lines changed: 115 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,29 @@ on:
1111
- develop
1212

1313
jobs:
14-
placeholder:
15-
name: CI Placeholder
14+
verify:
15+
name: Unit and Integration Verification
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- name: Verification reset notice
20-
run: echo "Backend automated test verification is temporarily disabled."
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Java 21
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '21'
26+
distribution: 'temurin'
27+
cache: 'gradle'
28+
29+
- name: Grant execute permission for gradlew
30+
run: chmod +x gradlew
31+
32+
- name: Run unit tests
33+
run: ./gradlew test
34+
35+
- name: Run integration tests
36+
run: ./gradlew integrationTest
37+
38+
- name: Run packaging build
39+
run: ./gradlew build -x test

.github/workflows/deploy.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,37 @@ env:
1212
IMAGE_NAME: git-ranker
1313

1414
jobs:
15+
verify:
16+
name: Pre-deploy Verification
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Java 21
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '21'
27+
distribution: 'temurin'
28+
cache: 'gradle'
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
33+
- name: Run unit tests
34+
run: ./gradlew test
35+
36+
- name: Run integration tests
37+
run: ./gradlew integrationTest
38+
39+
- name: Run packaging build
40+
run: ./gradlew build -x test
41+
1542
docker:
1643
name: Build & Push Docker Image
1744
runs-on: ubuntu-latest
45+
needs: verify
1846

1947
steps:
2048
- name: Checkout code
@@ -54,7 +82,7 @@ jobs:
5482
runs-on: ubuntu-latest
5583
needs: docker
5684

57-
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
85+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
5886

5987
steps:
6088
- name: Deploy via SSH

AGENTS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# AGENTS.md
2+
3+
`git-ranker`는 Git Ranker의 backend API 서버 저장소다. workflow repo는 orchestration만 소유하고, backend 구현과 verification/deploy entrypoint의 canonical source는 이 저장소가 직접 소유한다.
4+
5+
## 시작 순서
6+
7+
1. `README.md`에서 프로젝트 목적과 high-level overview를 확인한다.
8+
2. `build.gradle`, `settings.gradle`에서 모듈 구조, 의존성, verification task를 확인한다.
9+
3. `.github/workflows/ci.yml`, `.github/workflows/deploy.yml`에서 CI verification lane과 pre-deploy gate를 확인한다.
10+
4. `src/test/java/`에서 current verification slice를 본다.
11+
- `*IT.java`는 Testcontainers 기반 integration lane이다.
12+
5. `src/main/java/`, `src/main/resources/`에서 실제 구현과 runtime config를 읽는다.
13+
14+
## Source Of Truth
15+
16+
- repo overview: `README.md`
17+
- build and verification entrypoint: `build.gradle`
18+
- CI / deploy gate: `.github/workflows/ci.yml`, `.github/workflows/deploy.yml`
19+
- backend behavior and contracts: `src/main/java/`, `src/test/java/`
20+
- runtime container surface: `Dockerfile`, `docker-compose.yml`
21+
22+
## 운영 원칙
23+
24+
- backend 구현 세부사항은 workflow repo 문서가 아니라 이 저장소의 문서, 설정, 코드, 테스트가 canonical source다.
25+
- root `README.md`는 개요만 유지한다. concrete bootstrap, verification, entrypoint 설명은 `AGENTS.md`와 named entry docs가 맡는다.
26+
- 현재 verification baseline command set은 `./gradlew test`, `./gradlew integrationTest`, packaging check `./gradlew build`다.
27+
- `./gradlew build`만으로는 `integrationTest`가 실행되지 않는다. CI/deploy gate는 이 순서를 명시적으로 호출하고, workflow에서는 마지막 packaging check를 `./gradlew build -x test`로 실행해 중복 unit test를 피한다.
28+
- `integrationTest`는 Docker/Testcontainers 전제를 가진다. 로컬 환경에서 Docker가 없으면 CI evidence와 함께 해석한다.
29+
- verification lane이나 deploy gate를 바꾸면 `build.gradle`, workflow YAML, `AGENTS.md`를 함께 맞춘다.
30+
- 현재 repo-local `.codex/skills/`는 없다. 별도 skill이 없을 때는 이 문서와 nearest code/test를 먼저 읽고 진행한다.

build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,41 @@ dependencies {
4646
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
4747
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.3'
4848
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.3'
49+
50+
testImplementation 'io.projectreactor:reactor-test'
51+
testImplementation 'org.springframework.security:spring-security-test'
52+
testImplementation 'org.springframework.batch:spring-batch-test'
53+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
54+
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
55+
testImplementation 'org.testcontainers:junit-jupiter'
56+
testImplementation 'org.testcontainers:mysql'
57+
58+
testRuntimeOnly 'com.h2database:h2'
59+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
60+
}
61+
62+
// 단위 테스트: *IT.java 제외 (Docker 불필요)
63+
tasks.named('test') {
64+
useJUnitPlatform()
65+
exclude '**/*IT.class'
4966
}
5067

68+
// 통합 테스트: Testcontainers 기반 *IT.java만 별도 lane에서 실행
69+
// check 라이프사이클에는 연결하지 않고 CI/deploy verification이 명시적으로 호출한다.
70+
tasks.register('integrationTest', Test) {
71+
group = 'verification'
72+
description = 'Runs Testcontainers-backed integration tests.'
73+
useJUnitPlatform()
74+
include '**/*IT.class'
75+
76+
mustRunAfter tasks.named('test')
77+
78+
testClassesDirs = sourceSets.test.output.classesDirs
79+
classpath = sourceSets.test.runtimeClasspath
80+
81+
// Docker 29+는 최소 API 1.44를 요구하지만 docker-java 3.4.0은 기본값 1.32로 요청함
82+
systemProperty 'api.version', '1.44'
83+
}
5184
tasks.named('processResources') {
5285
filteringCharset = 'UTF-8'
5386
filesMatching('static/swagger-ui/index.html') {

0 commit comments

Comments
 (0)