Skip to content

배포를 위한 merge.... - #66

Merged
roode1017 merged 31 commits into
mainfrom
dev
Aug 14, 2025
Merged

배포를 위한 merge....#66
roode1017 merged 31 commits into
mainfrom
dev

Conversation

@roode1017

@roode1017 roode1017 commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

원중님 살려주세요

Summary by CodeRabbit

  • 신기능
    • 실시간 매치: 인증 기반 WebSocket, 단일 세션 유지, 상태/DRAFT_START 푸시 알림.
    • 내 매치 배정 조회 API 추가.
    • 선수 캐시 API(캐싱/조회) 및 ES 기반 선수 검색 API 추가.
    • 포지션(Element Type) 전체 조회 API 추가.
    • 시스템 상태 확인 엔드포인트(/health) 추가.
  • 변경
    • 드래프트 오픈/락 시간(KST) 08:00/12:20로 조정.
    • 보안 설정 완화로 공개 엔드포인트 접근 용이.
  • 작업
    • EC2 자동 배포 워크플로 추가.
    • 운영용 Docker Compose 스택 추가(다중 API, Redis, Elasticsearch, Kafka).

wjkim9 and others added 30 commits August 8, 2025 14:47
Elasticsearch 의존성 제거
시간이 지나면 자동으로 드래프트를 생성하고,
생성한 내용을 바탕으로 사용자들의 페이지를 이동 시킴
통합 후 수정 작업 진행중
드래프트 생성
참가자 배정
채팅방 생성
Feature/#43 선수 검색 기능 추가
배포를 위한 docker-compose 파일 추가 및 securityConfig 수정, deploy 파일 추가
Feature/#43 선수 포지션 리스트 가져오기 기능 개발 및 선수 검색 기능 수정
hotfix/ deploy 퍄일 수정
@coderabbitai

coderabbitai Bot commented Aug 14, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

GitHub Actions 배포 워크플로우와 docker-compose-prod를 추가하고, 매치/드래프트 타임아웃 처리 및 배정 조회 기능을 도입했습니다. WebSocket 인증(핸드셰이크/세션 관리)과 스케줄러 기반 타임아웃 배치가 추가되었고, 플레이어 캐시/검색(Redis+Elasticsearch) API와 보안/설정 일부가 변경되었습니다.

Changes

Cohort / File(s) Summary
CI/CD & Compose
.github/workflows/deploy.yml, docker-compose-prod.yml
GitHub Actions 배포 파이프라인 추가(Gradle 빌드, EC2 SCP/SSH 배포, 선택적 CloudFront 무효화). 프로덕션용 Compose 스택 추가(API 2개, Redis 3개, Elasticsearch, Zookeeper, Kafka, 헬스체크/네트워크/볼륨 정의).
Match Draft 배정/타임아웃
.../match/controller/AssignmentController.java, .../match/service/AssignmentService.java, .../match/repository/ParticipantRepository.java, .../match/service/MatchTimeoutProcessor.java, .../match/scheduler/MatchScheduler.java, .../match/handler/MatchHandler.java, .../match/dto/AssignDto.java, .../match/dto/DraftStartMessage.java, .../match/entity/Participant.java, .../draft/entity/Draft.java, .../match/service/DraftTimingService.java
배정 조회 API/서비스/리포지토리 추가(JPQL 프로젝션). 타임아웃 배치 처리 서비스와 5초 주기 스케줄러 추가. WebSocket 핸들러 인증 기반 세션/브로드캐스트/라운드 타임아웃 단발 처리 및 DRAFT_START 푸시 구현. Participant 필드명 변경(dummy), Draft.roomNo DB 생성값으로 전환, 드래프트 윈도우 시간대 조정.
WebSocket 인증/보안 설정
.../global/configuration/AuthHandshakeHandler.java, .../global/configuration/MatchWebSocketConfig.java, .../global/security/jwt/JwtTokenProvider.java, .../global/security/config/SecurityConfig.java
핸드셰이크 시 SecurityContext/JWT(query token) 기반 Principal 결정. WebSocket 허용 오리진 환경변수화 및 커스텀 핸드셰이크 적용. JWT에서 Authentication 생성 메서드 추가. 보안 설정에서 광범위 permit 규칙 추가.
Player 캐시 & ES 검색
.../player/cache/controller/PlayerCacheController.java, .../player/cache/service/PlayerCacheService.java, .../player/cache/dto/PlayerDto.java, .../player/elasticsearch/controller/PlayerEsController.java, .../player/elasticsearch/service/PlayerEsService.java, .../player/elasticsearch/dto/PlayerEsDocument.java, .../player/elasticsearch/repository/PlayerEsRepository.java, .../player/entity/Player.java
플레이어 목록 Redis 캐시 적재/조회 API 및 서비스 추가, ES 도큐먼트/리포지토리/검색 서비스 및 검색 API 추가, Player/DTO 변환 유틸 추가.
ElementType 조회
.../player/controller/ElementTypeController.java, .../player/service/ElementTypeService.java, .../player/dto/ElementTypeDto.java, .../player/entity/ElementType.java
ElementType 전체 조회 API/서비스/DTO 추가 및 엔티티→DTO 변환 유틸 추가.
공통 설정/유틸
.../global/configuration/RedisConfig.java, .../global/configuration/KafkaConfig.java, .../global/exception/ErrorCode.java, .../global/health/HealthController.java, backendProject/build.gradle, backendProject/src/main/resources/application-dev.example.properties
RedisTemplate 값을 JSON 직렬화로 전환. Kafka 프로듀서/템플릿 Bean 주석 처리. 에러 코드 2종 추가(ASSIGNMENT_NOT_FOUND/CONFLICT). 헬스 체크 엔드포인트 추가. ES Java 클라이언트 의존성 주석 처리. 개발 예시 프로퍼티 삭제.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant WS as WebSocket Server
  participant Auth as AuthHandshakeHandler
  participant JWT as JwtTokenProvider
  participant MH as MatchHandler

  Client->>WS: Connect (optional ?token=Bearer x)
  WS->>Auth: determineUser(request)
  Auth->>Auth: check SecurityContext
  alt no Principal
    Auth->>JWT: validate & getAuthentication(token)
    JWT-->>Auth: Authentication or null
  end
  Auth-->>WS: Principal or null
  alt authenticated
    WS->>MH: afterConnectionEstablished(session, userId)
    MH-->>Client: USER_ID, STATUS
  else unauthenticated
    WS-->>Client: reject
  end
Loading
sequenceDiagram
  participant Scheduler
  participant Proc as MatchTimeoutProcessor
  participant Redis
  participant DB as Repos(DB)
  participant WS as MatchHandler

  Scheduler->>Proc: processTimeoutAndInsert()
  Proc->>Redis: SMEMBERS match:session
  alt empty
    Proc-->>Scheduler: {}
  else has users
    Proc->>Proc: group by 4 & pad DUMMY
    Proc->>DB: find Round(getNextDraftWindow)
    Proc->>DB: save Draft + Participants
    Proc->>Redis: SREM used real userIds
    Proc-->>Scheduler: {userId -> AssignDto}
    loop for each user
      Scheduler->>WS: notifyDraftStart(userId, draftId, userNumber)
      WS-->>WS: send DRAFT_START to latest session
    end
  end
Loading
sequenceDiagram
  participant Admin as Admin/Job
  participant API as PlayerCacheController
  participant S as PlayerCacheService
  participant DB as PlayerRepository
  participant ES as PlayerEsService
  participant R as Redis

  Admin->>API: POST /api/playerCache/cache
  API->>S: loadPlayersToRedis()
  S->>DB: findAllWithTeamAndElementType()
  S->>R: SETEX players:all (List<PlayerDto>)
  S->>ES: saveAll(PlayerEsDocument list)
  API-->>Admin: 200 OK

  participant User
  User->>API: GET /api/playerCache
  API->>S: getPlayersFromRedis()
  S->>R: GET players:all
  alt hit
    R-->>S: List<PlayerDto>
  else miss
    S->>DB: findAll...
    S->>R: SETEX players:all
  end
  S-->>API: List<PlayerDto>
  API-->>User: 200 OK (list)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • hwichoi0317
  • wjkim9
  • Kim-Jaehyun0328

Poem

토끼 발굽 탁, 스케줄 째깍딱!
잠든 유저 깨워 드래프트 띵동-각!
레디스 바스켓, 선수는 척척 쌓고,
엘라스틱 숲에 발자국 콩콩 남기고.
웹소켓 문 열고 “배정!” 쪽지 퐁—퐁!
오늘 배포? 점프 두 번이면 끝! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a84605 and 6f1d51a.

📒 Files selected for processing (36)
  • .github/workflows/deploy.yml (1 hunks)
  • backendProject/build.gradle (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/draft/entity/Draft.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/controller/AssignmentController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/dto/AssignDto.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/dto/DraftStartMessage.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/entity/Participant.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/handler/MatchHandler.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/repository/ParticipantRepository.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/scheduler/MatchScheduler.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/service/AssignmentService.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/service/DraftTimingService.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/match/service/MatchTimeoutProcessor.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/cache/controller/PlayerCacheController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/cache/dto/PlayerDto.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/cache/service/PlayerCacheService.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/controller/ElementTypeController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/dto/ElementTypeDto.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/elasticsearch/controller/PlayerEsController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/elasticsearch/dto/PlayerEsDocument.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/elasticsearch/repository/PlayerEsRepository.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/elasticsearch/service/PlayerEsService.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/entity/ElementType.java (3 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/entity/Player.java (3 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/service/ElementTypeService.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/AuthHandshakeHandler.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/KafkaConfig.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/MatchWebSocketConfig.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/RedisConfig.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/exception/ErrorCode.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/health/HealthController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/security/config/SecurityConfig.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/security/jwt/JwtTokenProvider.java (3 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/security/oauth/CustomUserDetailsService.java (1 hunks)
  • backendProject/src/main/resources/application-dev.example.properties (0 hunks)
  • docker-compose-prod.yml (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@roode1017
roode1017 merged commit eab841a into main Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants