1) 브랜치 보호(main): CI 두 개 초록불 + 승인 1 없이는 merge 불가, 학생 직접 push 차단(PR 워크플로), 관리자만 운영·배포용 직접 push (Gitea 설정) 2) 커버리지 측정: - 백엔드 JaCoCo — 현재 라인 36.7%, 바닥 30% ratchet(테스트 지우며 후퇴하면 빌드 실패) - 프론트 vitest 커버리지 — 채점 로직 runSql.js 라인 40% 바닥 3) 린트/포맷 CI 강제: - 프론트 ESLint 9(flat) 신규 — 버그류 에러, 훅 오용 검출 (현재 위반 0) - 백엔드 Spotless — 안 쓰는 import·줄끝 공백·파일끝 개행 (기존 코드 이미 clean, 재정렬 없음) - ci.yml에 포맷검사·린트·커버리지 단계 추가 백엔드 37개 테스트 + 커버리지 게이트 통과, 프론트 ESLint·커버리지 통과 확인. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
127 lines
4.7 KiB
XML
127 lines
4.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- 미림 수습 학습 플랫폼 백엔드 (Spring Boot)
|
|
학습 포인트: Maven이 라이브러리(의존성)를 관리하는 방법을 이 파일에서 봅니다. -->
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-parent</artifactId>
|
|
<version>3.4.2</version>
|
|
<relativePath/>
|
|
</parent>
|
|
|
|
<groupId>dev.awesomedev</groupId>
|
|
<artifactId>mirim-backend</artifactId>
|
|
<version>0.1.0</version>
|
|
<name>mirim-backend</name>
|
|
<description>어썸데브 수습 학습 플랫폼 API 서버</description>
|
|
|
|
<properties>
|
|
<java.version>21</java.version>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<!-- 웹 API (컨트롤러) -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-web</artifactId>
|
|
</dependency>
|
|
<!-- DB 접근 (JPA) -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
</dependency>
|
|
<!-- 로그인/권한 (세션 기반) -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-security</artifactId>
|
|
</dependency>
|
|
<!-- 요청 값 검증 (@Valid) -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-validation</artifactId>
|
|
</dependency>
|
|
<!-- PostgreSQL 드라이버 -->
|
|
<dependency>
|
|
<groupId>org.postgresql</groupId>
|
|
<artifactId>postgresql</artifactId>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
<!-- 테스트 -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
</plugin>
|
|
<!-- 코드 포맷·위생 검사 (Spotless)
|
|
학습 포인트: 사람마다 다른 "안 쓰는 import·줄끝 공백·파일 끝 개행" 같은 잡티를
|
|
기계가 통일한다. 과도한 재정렬은 하지 않고(코드 의미·주석 정렬 보존) 위생만 맞춘다.
|
|
mvn spotless:apply → 자동 교정, mvn spotless:check → 어긋나면 실패(CI가 이걸 검사). -->
|
|
<plugin>
|
|
<groupId>com.diffplug.spotless</groupId>
|
|
<artifactId>spotless-maven-plugin</artifactId>
|
|
<version>2.44.0</version>
|
|
<configuration>
|
|
<java>
|
|
<removeUnusedImports/>
|
|
<trimTrailingWhitespace/>
|
|
<endWithNewline/>
|
|
</java>
|
|
</configuration>
|
|
</plugin>
|
|
<!-- 테스트 커버리지 측정 (JaCoCo)
|
|
학습 포인트: "테스트가 코드의 몇 %를 실제로 실행해 봤나"를 숫자로 보여준다.
|
|
숫자가 낮은 곳 = 아직 안전망이 없는 곳. mvn test 후 target/site/jacoco/index.html 에 리포트.
|
|
check 규칙: 라인 커버리지가 기준선 아래로 "떨어지면" 빌드 실패 → 테스트를 지우며 후퇴하는 걸 막는다. -->
|
|
<plugin>
|
|
<groupId>org.jacoco</groupId>
|
|
<artifactId>jacoco-maven-plugin</artifactId>
|
|
<version>0.8.12</version>
|
|
<executions>
|
|
<execution>
|
|
<id>prepare-agent</id>
|
|
<goals><goal>prepare-agent</goal></goals>
|
|
</execution>
|
|
<execution>
|
|
<id>report</id>
|
|
<phase>test</phase>
|
|
<goals><goal>report</goal></goals>
|
|
</execution>
|
|
<execution>
|
|
<id>check</id>
|
|
<phase>test</phase>
|
|
<goals><goal>check</goal></goals>
|
|
<configuration>
|
|
<rules>
|
|
<rule>
|
|
<element>BUNDLE</element>
|
|
<limits>
|
|
<!-- 현재 기준선 라인 36.7%. 바닥을 30%로 걸어 "후퇴"만 막는다(전진은 자유).
|
|
학생이 테스트를 늘리면 이 숫자를 함께 올려 바닥을 끌어올리는 게 건강한 패턴. -->
|
|
<limit>
|
|
<counter>LINE</counter>
|
|
<value>COVEREDRATIO</value>
|
|
<minimum>0.30</minimum>
|
|
</limit>
|
|
</limits>
|
|
</rule>
|
|
</rules>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|