-
Notifications
You must be signed in to change notification settings - Fork 1
[DEPLOY] 백엔드 v2.1.0 배포 #234
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
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @unifolio0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers backend version 2.1.0, focusing on significant enhancements across deployment, real-time communication, and core application features. It introduces robust zero-downtime deployment strategies, integrates WebSocket for interactive sharing, and provides a new system for managing organizational debate templates. Additionally, the update includes a scheduler for automated poll cleanup and general improvements to dependencies and application configurations. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
이번 PR은 웹소켓을 이용한 실시간 공유 기능, 기관별 토론 템플릿 API 추가 등 백엔드 v2.1.0 배포를 위한 변경 사항을 담고 있습니다. 특히 무중단 배포를 위한 Nginx 설정과 Blue/Green 배포 스크립트가 추가된 점이 인상적입니다. 전반적으로 코드 품질이 우수하며, 새로운 기능에 대한 테스트 커버리지도 잘 갖추어져 있습니다. 다만, 배포 스크립트의 안정성 향상, 일부 설정 구조의 명확성 개선을 위한 몇 가지 제안 사항이 있습니다. 전반적으로 애플리케이션의 기능과 안정성을 크게 향상시키는 훌륭한 기여입니다.
| if [ "$HEALTH_STATUS" = "200" ]; then | ||
| log "nginx successfully switched to port $NEW_PORT" | ||
| log "Health check: OK (status $HEALTH_STATUS)" | ||
| rm -f "$TEMP_CONF" | ||
| exit 0 | ||
| else | ||
| log "Health check failed after nginx reload (status: $HEALTH_STATUS)" | ||
| log "nginx may not be routing to the correct backend" | ||
| exit 1 | ||
| fi |
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.
| server { | ||
| if ($host = api.dev.debate-timer.com) { | ||
| return 308 https://$host$request_uri; | ||
| } # managed by Certbot | ||
|
|
||
| listen 80; | ||
| listen [::]:80; | ||
| server_name api.dev.debate-timer.com; | ||
| return 404; # managed by Certbot | ||
| } |
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.
HTTP에서 HTTPS로 리디렉션하는 로직을 더 간단하고 효율적으로 개선할 수 있습니다. server 블록 내에서 if 문을 사용하는 것은 일반적으로 성능과 가독성 측면에서 권장되지 않습니다. if 문 없이 return을 직접 사용하여 리디렉션하는 것이 좋습니다. 이 제안은 nginx/api.prod.debate-timer.com 파일에도 동일하게 적용됩니다.
server {
listen 80;
listen [::]:80;
server_name api.dev.debate-timer.com;
return 308 https://$host$request_uri; # managed by Certbot
}
| switch_nginx_upstream() { | ||
| local new_port=$1 | ||
| local nginx_conf="/etc/nginx/sites-available/api.dev.debate-timer.com" | ||
| local temp_conf="/tmp/api.dev.debate-timer.com.tmp" |
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.
임시 파일 경로에 고정된 이름(api.dev.debate-timer.com.tmp)을 사용하고 있습니다. 만약 여러 배포 프로세스가 동시에 실행될 경우 파일 이름이 충돌할 위험이 있습니다. mktemp 명령어를 사용하여 매번 고유한 임시 파일을 생성하는 것이 더 안전합니다. 또한, 스크립트가 예기치 않게 종료될 때 임시 파일이 자동으로 삭제되도록 함수 상단에 trap 'rm -f "$temp_conf"' EXIT와 같은 정리 로직을 추가하는 것이 좋습니다.
| local temp_conf="/tmp/api.dev.debate-timer.com.tmp" | |
| local temp_conf=$(mktemp) |
|
|
||
|
|
||
| @Getter | ||
| @ConfigurationProperties(prefix = "cors.origin") |
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.
@ConfigurationProperties(prefix = "cors.origin") 설정과 application.yml 파일의 cors.origin.cors-origin 속성 구조가 다소 장황하여 혼란을 줄 수 있습니다. 설정을 더 직관적으로 만들기 위해 다음과 같이 리팩토링하는 것을 제안합니다.
CorsProperties.java
@ConfigurationProperties(prefix = "cors")
public class CorsProperties {
private final String[] origin;
// ... constructor with origin
}application.yml
cors:
origin:
- ${secret.cors.origin}이렇게 변경하면 cors.origin으로 속성을 바로 바인딩할 수 있어 구조가 더 명확해집니다.
|
|
||
| private final String[] corsOrigin; | ||
|
|
||
| //TODO 머지될 때 dev, prod secret 갱신 필요 |
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.
🚩 연관 이슈
closed #
🗣️ 리뷰 요구사항 (선택)