Skip to content

Conversation

@unifolio0
Copy link
Contributor

🚩 연관 이슈

closed #

🗣️ 리뷰 요구사항 (선택)

@coderabbitai
Copy link

coderabbitai bot commented Dec 31, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Zero-Downtime Deployment: Implemented blue-green deployment scripts for both development and production environments, leveraging Nginx for seamless, zero-downtime application updates.
  • WebSocket Integration: Introduced real-time event sharing capabilities via WebSockets, including a custom authentication resolver for secure WebSocket connections and a message broker configuration.
  • Organization Templates Feature: Added a new feature allowing the management and retrieval of organization-specific debate templates, complete with dedicated API endpoints, domain models, and persistence layers.
  • Automated Poll Cleanup: Integrated a scheduled task to automatically identify and mark old, in-progress polls as 'DONE', ensuring data hygiene and efficient resource management.
  • Dependency and Configuration Updates: Updated the Springdoc OpenAPI dependency, removed Apache POI (Excel export) dependencies, and refactored CORS configuration for improved maintainability and security.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/Dev_CD.yml
    • .github/workflows/Prod_CD.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@unifolio0 unifolio0 merged commit 7e269c9 into main Dec 31, 2025
6 of 7 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 배포 스크립트가 추가된 점이 인상적입니다. 전반적으로 코드 품질이 우수하며, 새로운 기능에 대한 테스트 커버리지도 잘 갖추어져 있습니다. 다만, 배포 스크립트의 안정성 향상, 일부 설정 구조의 명확성 개선을 위한 몇 가지 제안 사항이 있습니다. 전반적으로 애플리케이션의 기능과 안정성을 크게 향상시키는 훌륭한 기여입니다.

Comment on lines +57 to +66
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Nginx 리로드 후 헬스 체크에 실패했을 때, 설정을 이전 상태로 롤백하는 로직이 누락되어 있습니다. 이로 인해 헬스 체크 실패 시 서비스가 비정상 상태에 머무를 수 있습니다. zero-downtime-deploy.sh 스크립트처럼, 헬스 체크 실패 시 백업해둔 설정 파일로 복원하고 Nginx를 다시 리로드하는 롤백 로직을 추가하여 스크립트의 안정성을 높여야 합니다.

Comment on lines +25 to +34
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
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

임시 파일 경로에 고정된 이름(api.dev.debate-timer.com.tmp)을 사용하고 있습니다. 만약 여러 배포 프로세스가 동시에 실행될 경우 파일 이름이 충돌할 위험이 있습니다. mktemp 명령어를 사용하여 매번 고유한 임시 파일을 생성하는 것이 더 안전합니다. 또한, 스크립트가 예기치 않게 종료될 때 임시 파일이 자동으로 삭제되도록 함수 상단에 trap 'rm -f "$temp_conf"' EXIT와 같은 정리 로직을 추가하는 것이 좋습니다.

Suggested change
local temp_conf="/tmp/api.dev.debate-timer.com.tmp"
local temp_conf=$(mktemp)



@Getter
@ConfigurationProperties(prefix = "cors.origin")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

@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 갱신 필요

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

코드에 TODO 주석이 남아있습니다. 머지하기 전에 해당 내용을 처리하거나, 별도의 이슈로 등록하여 관리하는 것이 좋습니다. 코드베이스에 TODO를 남겨두면 추적이 어려워져 잊혀지기 쉽습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants