Skip to content

Conversation

@Daae-Kim
Copy link
Member

@Daae-Kim Daae-Kim commented Mar 27, 2025

📌 관련 이슈

#247

✒️ 작업 내용

  1. healthCheck 를 10초에서 20초로 늘렸습니다.
  2. step 으로 구성되어있던 deploy, healthCheck, slack Notification 을 개별 job 으로 작동하도록 수정했습니다.

💬 REVIEWER에게 요구사항 💬

Summary by CodeRabbit

  • New Features
    • 배포 후 API 상태를 자동으로 확인하여 시스템 안정성을 강화하였습니다.
    • 개선된 타임아웃 처리로 응답 지연 시에도 원활한 점검을 지원합니다.
    • Slack 알림 기능을 추가하여 배포 및 상태 점검 결과를 실시간으로 전달합니다.

@Daae-Kim Daae-Kim requested review from kssumin and rlajm1203 March 27, 2025 08:12
@Daae-Kim Daae-Kim self-assigned this Mar 27, 2025
@coderabbitai
Copy link

coderabbitai bot commented Mar 27, 2025

Walkthrough

이번 PR은 GitHub Actions 워크플로우에 새로운 CI 작업들을 추가 및 수정합니다. 기존의 배포 작업 후 실행되는 API 헬스 체크 로직을 업데이트하여, 20초 대기 후 curl 명령을 실행하고 타임아웃 처리를 추가했습니다. 헬스 체크 작업 내 스텝 ID가 health_check에서 check로 변경되었으며, 배포 결과 변수도 STATUS에서 DEPLOY_STATUS로 업데이트되었습니다. 또한, 배포 및 헬스 체크 결과를 기반으로 슬랙 알림을 보내는 slack_notify 작업이 새롭게 추가되었습니다. 일부 포맷팅 수정도 함께 포함되었습니다.

Changes

File Change Summary
.github/workflows/backend-cd-dev.yml - 추가된 health_check 작업: 20초 대기 후 API 헬스 체크, 타임아웃 처리 추가, 스텝 ID check 사용
- 추가된 slack_notify 작업: 배포 및 헬스 체크 결과에 따른 슬랙 알림 발송
- 변수명(STATUSDEPLOY_STATUS) 및 포맷팅 수정

Sequence Diagram(s)

sequenceDiagram
    participant D as Deploy
    participant HC as HealthCheck
    participant SN as SlackNotify

    D->>HC: 배포 완료 신호 전송
    HC->>HC: 20초 대기 후 curl 실행, 헬스 체크 수행
    HC-->>SN: 헬스 체크 결과 전송 (타임아웃 포함)
    D-->>SN: 배포 상태(DEPLOY_STATUS) 전송
    SN->>Slack: 슬랙 알림 발송
Loading

Possibly related PRs

Suggested reviewers

  • kssumin
  • rlajm1203

Poem

깡총깡총 내가 쓴 CI의 이야기,
새로 추가된 작업들이 춤추며 나타나네,
20초 기다림 따라 헬스 체크 실행,
배포 상태와 함께 슬랙에 소식을 전하네,
나의 귀도 기쁘게, 코드와 함께 놀아! 🐰🎉


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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@github-actions
Copy link

Test Results

89 tests  ±0   86 ✅ ±0   4s ⏱️ ±0s
35 suites ±0    3 💤 ±0 
35 files   ±0    0 ❌ ±0 

Results for commit 2c5e86a. ± Comparison against base commit 20966e5.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/backend-cd-dev.yml (1)

6-6: 분기 필터링 조건 확인:
현재 브랜치 필터가 "develop"으로 설정되어 있습니다. PR 닫힘 이벤트가 오직 develop 브랜치에 대해서만 트리거되는 것이 의도한 동작인지 확인해주시기 바랍니다.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 20966e5 and 2c5e86a.

📒 Files selected for processing (1)
  • .github/workflows/backend-cd-dev.yml (4 hunks)
🔇 Additional comments (4)
.github/workflows/backend-cd-dev.yml (4)

17-19: SSH 접속 파라미터 검증:
SSH 접속에 필요한 host, username, passwordsecrets를 통해 안전하게 관리되고 있습니다. 해당 파라미터의 변경사항은 보안 및 기능 측면에서 문제 없어 보입니다.


34-53: Health Check Job 로직 점검:
새로 추가된 health_check job이 deploy job 후에 실행되며, 20초 대기 후 API 헬스 체크를 수행합니다.

  • sleep 20를 통해 컨테이너 시작 대기 시간을 늘린 점이 PR 목표와 부합합니다.
  • curl 명령어에 --max-time 10 옵션을 사용하여 타임아웃을 효과적으로 처리한 점도 좋습니다.
  • 반환되는 상태(success, failure, timeout)를 $GITHUB_OUTPUT에 기록하는 조건문 로직이 명확합니다.

55-90: Slack 알림 전송 Job 검토:
slack_notify job에서 배포(deploy) 및 헬스 체크(health_check) 결과를 활용하여 Slack 메시지를 구성하고 전송하고 있습니다.

  • 환경 변수 HEALTH_STATUSDEPLOY_STATUS를 올바르게 참조하여 결과에 따른 분기 처리가 구현되었습니다.
  • 배포 성공 시 헬스 체크 상태에 따라 메시지 색상(BASE_COLOR)과 텍스트(DEPLOY_TEXT, HEALTH_TEXT)가 적절히 설정됩니다.
    다만, "needs.deploy.result"가 실제 배포 결과를 정확하게 반영하는지 추가로 확인해주시기 바랍니다.

97-137: Slack 페이로드 구성 및 알림 전송 검토:
JSON 페이로드가 Slack 알림 메시지로 적절하게 구성되어 있습니다.

  • 배포 타입, 헬스 체크 결과, 커밋 메시지, 브랜치, 워크플로 URL, 그리고 병합 시간 등이 포함되어 있어 정보를 명확하게 전달합니다.
  • cat <<EOF를 이용한 페이로드 구성 및 curl을 통한 POST 요청 처리 로직도 올바르게 구현되었습니다.
    전체적으로 변경 사항이 PR 목적(헬스 체크 시간 수정 및 작업 분리)에 부합합니다.

@kssumin kssumin changed the title refactor : #247 health check 시간 수정 및 job 분리 [REFACTOR] : #247 health check 시간 수정 및 job 분리 Mar 31, 2025
@kssumin kssumin changed the title [REFACTOR] : #247 health check 시간 수정 및 job 분리 [REFACTOR] : health check 시간 수정 및 job 분리 Mar 31, 2025
@kssumin kssumin merged commit 92f118e into develop Apr 4, 2025
9 checks passed
@kssumin kssumin deleted the DD/refactor/#247/fixHealthCheck branch April 4, 2025 02:39
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