Skip to content
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

마지막 Weekly -> Master #248

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<b>나만의 작은 시니또</b>
</div>

## 목차
## 바로가기
- [🤔 시니또가 무엇인가요?](#시니또가-무엇인가요)
- [🧑🏻‍💻 어떤 서비스인가요?](#어떤-서비스인가요)
- [💬 핵심 기능 간략한 설명](#핵심-기능-간략한-설명)
Expand Down Expand Up @@ -48,7 +48,8 @@ https://sinitto.site/admin/login
### ✔️ Slack
[https://join.slack.com/t/sinitto/shared_invite](https://join.slack.com/t/sinitto/shared_invite/zt-2uqws45gg-bsPq8cuH2iQV6Jk1Y3Zglw)


### ✔️ 프론트엔드 Evaluation 브랜치
https://github.com/kakao-tech-campus-2nd-step3/Team8_FE/tree/Evaluation
## ✨ **프로젝트 실행 가이드**

아래의 단계를 따라 프로젝트를 실행할 수 있습니다.
Expand Down Expand Up @@ -457,6 +458,37 @@ redis-server
<img width="480" alt="image-3" src="https://github.com/user-attachments/assets/45fa7e58-9451-4d3b-857b-93c78f3b0794">
<img width="500" alt="image-3" src="https://github.com/user-attachments/assets/c0cac5df-2214-4004-b7dd-043971fe4274">

### 4. Docker와 CI/CD를 활용한 테스트 환경 일관성 및 자동화된 코드 품질 관리
> **1. Docker를 통한 테스트 환경 일관성**

**일관된 환경**: Docker로 Redis와 MySQL을 컨테이너로 관리해, 모든 개발자와 CI/CD 환경에서 동일한 테스트 환경을 보장했습니다.

**빠른 초기화**: Docker 이미지를 통해 데이터베이스와 캐시 서버를 빠르게 설정하여, CI/CD에서 시간을 절약하도록 조치했습니다.

> **2. 자동화된 테스트 및 코드 품질 관리**

**PR 자동 테스트**: PR 생성 시 자동으로 모든 테스트가 실행되며, 코드 변경 사항에 대한 즉각적인 검증이 가능합니다.

**결과 자동 코멘트**: 테스트 결과가 PR에 자동으로 코멘트로 남겨져, 리뷰어가 쉽게 확인할 수 있습니다.

> **3. 실패한 코드 라인 피드백**

**즉각적 피드백**: 실패한 테스트에 대한 코드 라인이 PR에 표시되어, 빠르게 문제를 해결할 수 있습니다.

> **4. 높은 테스트 커버리지**

**클래스 커버리지 80%**: 주요 모듈(callback, guard, review 등)에서 100% 커버리지를 달성하여, 높은 안정성을 확보했습니다.

<p align="center">
<img width="939" alt="image" src="https://github.com/user-attachments/assets/5deef25f-0c3b-455c-8797-8eca49450a0f">
</p>
<p align="center"><strong>[ PR 자동 테스트 코멘트 ]</strong></p>
<br>
<p align="center">
<img width="600" alt="image" src="https://github.com/user-attachments/assets/53e26e22-16f4-4086-ad84-633ebdde4ea4">
</p>
<p align="center"><strong>[ 테스트 Coverage ]</strong></p>


## 👩‍👩‍👧‍👧 협업 효율

Expand Down Expand Up @@ -616,4 +648,3 @@ Team8_BE
└── service

```

21 changes: 18 additions & 3 deletions src/main/java/com/example/sinitto/common/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.sinitto.common.config;

import com.example.sinitto.common.interceptor.JwtInterceptor;
import com.example.sinitto.common.properties.KakaoProperties;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
Expand All @@ -9,6 +10,7 @@
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.cors.CorsConfiguration;
Expand All @@ -25,10 +27,14 @@ public class WebConfig implements WebMvcConfigurer {
private static final int TIME_OUT_DURATION = 5;
private static final int MAX_OPEN_CONNECTIONS = 100;
private static final int CONNECTIONS_PER_IP_PORT_PAIR = 5;
private static final String DEV_SERVER_URL = "https://localhost:5173";

private final JwtInterceptor jwtInterceptor;
private final KakaoProperties kakaoProperties;

public WebConfig(JwtInterceptor jwtInterceptor) {
public WebConfig(JwtInterceptor jwtInterceptor, KakaoProperties kakaoProperties) {
this.jwtInterceptor = jwtInterceptor;
this.kakaoProperties = kakaoProperties;
}

@Bean
Expand Down Expand Up @@ -61,10 +67,19 @@ public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOriginPattern("https://www.sinitto.life");

config.addAllowedOriginPattern(kakaoProperties.frontUri());
config.addAllowedOriginPattern(DEV_SERVER_URL);

config.addAllowedMethod(HttpMethod.POST);
config.addAllowedMethod(HttpMethod.GET);
config.addAllowedMethod(HttpMethod.PUT);
config.addAllowedMethod(HttpMethod.DELETE);
config.addAllowedMethod(HttpMethod.OPTIONS);

config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.addExposedHeader("Authorization");

config.setMaxAge(3600L);
source.registerCorsConfiguration("/**", config);
return new CorsFilter(source);
Expand Down