Skip to content

merge: (#1041) prod-cd파일 수정 - #1042

Merged
yellowstarr0323 merged 5 commits into
developfrom
fix/1041-prod-cd
Jul 29, 2026
Merged

merge: (#1041) prod-cd파일 수정#1042
yellowstarr0323 merged 5 commits into
developfrom
fix/1041-prod-cd

Conversation

@yellowstarr0323

@yellowstarr0323 yellowstarr0323 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

작업 내용 설명

  • aws 마이그레이션으로 인한 cd 파일 수정

주요 변경 사항

  • 기존 ssm 통신 방식에서 ssh 통신 방식으로 수정
  • 배포전에 테스트 시행

체크리스트

  • 어플리케이션 구동(혹은 테스트)시 오류는 없나요?
  • 생성된 코드에 Javadoc 주석을 추가 하였나요?
  • 생성된 코드에 대한 테스트 코드가 작성 되었나요?

관련 이슈

Summary by CodeRabbit

  • 배포
    • 배포 파이프라인이 단일 애플리케이션 중심으로 간소화되었습니다.
    • 배포 전 자동 테스트를 실행하고, 빌드 결과를 컨테이너 이미지로 등록합니다.
    • 배포 후 애플리케이션 컨테이너의 상태를 확인해 정상 실행 여부를 검증합니다.
    • 배포 실패 또는 시간 초과 시 관련 로그를 제공하고, 사용하지 않는 이미지를 정리합니다.

@yellowstarr0323 yellowstarr0323 linked an issue Jul 29, 2026 that may be closed by this pull request
1 task
@yellowstarr0323 yellowstarr0323 self-assigned this Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yellowstarr0323, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: dd861019-78cb-4b16-b548-aa645c63bc96

📥 Commits

Reviewing files that changed from the base of the PR and between 9554676 and c1809a7.

📒 Files selected for processing (1)
  • .github/workflows/prod-cd.yml

Walkthrough

Changes

프로덕션 CD 파이프라인

Layer / File(s) Summary
단일 서비스 파이프라인과 테스트
.github/workflows/prod-cd.yml
변경 감지 및 멀티서비스 매트릭스가 제거되고, AWS/ECR 전역 환경 변수와 dms-main 테스트 중심의 흐름이 구성됨.
이미지 푸시와 SSH 배포
.github/workflows/prod-cd.yml
dms-main 이미지를 latest 및 커밋 SHA 태그로 ECR에 푸시하고, SSH로 EC2의 app 컨테이너를 갱신한 뒤 헬스를 확인함.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant ECR
  participant EC2
  participant DockerCompose
  GitHubActions->>GitHubActions: dms-main 테스트 실행
  GitHubActions->>ECR: latest 및 github.sha 이미지 푸시
  GitHubActions->>EC2: SSH 접속
  EC2->>ECR: ECR 로그인
  EC2->>DockerCompose: app 이미지 pull 및 재기동
  DockerCompose-->>EC2: app healthy/running 상태 반환
Loading

Possibly related PRs

Suggested reviewers: 4mjeo, ilyoil2, kkm06100

Poem

토끼가 이미지를 당근처럼 쌓고
latest 꼬리표를 살포시 달아요.
SSH 굴을 지나 app을 깨우면
healthy 맥박이 콩콩 뛰네요.
배포의 달밤, 깡충 완료! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 prod-cd 설정 수정이라는 핵심 변경을 정확히 가리키며, 변경 내용과 관련이 있습니다.
Linked Issues check ✅ Passed SSM을 SSH로 전환해 AWS 마이그레이션용 cd 파일을 수정하려는 직접 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 추가된 변경도 모두 SSH 기반 prod CD 전환과 배포 흐름 조정에 포함되어 별도 범위 이탈로 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1041-prod-cd

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

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

92-94: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

:latest pull은 방금 빌드한 이미지가 배포된다는 보장이 없습니다.

build-pushlatest${{ github.sha }}를 모두 푸시하지만, 배포는 latest만 참조합니다. 배포가 연달아 실행되면 나중 파이프라인의 latest가 먼저 반영될 수 있고, 어떤 커밋이 서버에 떠 있는지 추적·롤백도 어렵습니다. compose에 이미지 태그를 변수로 두고 커밋 SHA를 넘기는 방식을 권장합니다.

♻️ 제안 방향
-          docker compose pull app
-          docker compose up -d app
+          export APP_IMAGE_TAG="$IMAGE_TAG"   # ssh SendEnv 또는 스크립트 인자로 전달
+          docker compose pull app
+          docker compose up -d app

서버 docker-compose.yml에서는 image: ...:${APP_IMAGE_TAG:-latest} 형태로 참조하도록 변경하고, 워크플로우에서 github.sha를 전달하면 됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/prod-cd.yml around lines 92 - 94, Update the deployment
flow around docker compose pull and docker compose up so it deploys the current
github.sha image instead of relying on the mutable latest tag. Configure the app
image reference in the server compose configuration to use APP_IMAGE_TAG with
latest as its default, then pass github.sha through the workflow when pulling
and starting the app container.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/prod-cd.yml:
- Around line 73-75: Update the production deployment workflow by adding a
concurrency configuration for the deploy workflow, using a stable group that
serializes runs and cancels or queues rapid push-triggered duplicates so only
one deployment executes against EC2 at a time.
- Around line 96-102: Update the deployment health-check loop around docker
compose ps -q app to fail immediately with a clear error and app logs when the
container ID is empty or its inspected status is exited/dead. Preserve the
existing healthy/running success path and timeout handling for other non-ready
states.
- Line 82: Replace the ssh-keyscan-based known_hosts setup with the pinned
EC2_HOST_KEY secret, writing that value to ~/.ssh/known_hosts for host
verification. Remove the silent stderr suppression and avoid rescanning the host
on each run, ensuring the step fails if the required key secret is unavailable
or invalid.
- Around line 77-86: Update the “Prepare SSH key” and “Deploy on EC2” steps to
pass EC2_SSH_KEY, EC2_HOST, EC2_USER, and any other referenced secrets through
the steps’ env configuration, then reference those environment variables inside
quoted shell commands instead of interpolating secrets directly in run scripts.
Preserve the existing SSH key setup and deployment behavior.

---

Nitpick comments:
In @.github/workflows/prod-cd.yml:
- Around line 92-94: Update the deployment flow around docker compose pull and
docker compose up so it deploys the current github.sha image instead of relying
on the mutable latest tag. Configure the app image reference in the server
compose configuration to use APP_IMAGE_TAG with latest as its default, then pass
github.sha through the workflow when pulling and starting the app container.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 81f9bf9d-63eb-4da9-b4fa-1d3ddf0456d4

📥 Commits

Reviewing files that changed from the base of the PR and between 984a3cf and 9554676.

📒 Files selected for processing (1)
  • .github/workflows/prod-cd.yml

Comment thread .github/workflows/prod-cd.yml
Comment thread .github/workflows/prod-cd.yml Outdated
Comment thread .github/workflows/prod-cd.yml Outdated
Comment thread .github/workflows/prod-cd.yml
@github-actions

Copy link
Copy Markdown

📊 Main Service Coverage Report

Overall Project 15.11%

There is no coverage information present for the Files changed

@yellowstarr0323
yellowstarr0323 merged commit 8cd793c into develop Jul 29, 2026
4 of 5 checks passed
@yellowstarr0323
yellowstarr0323 deleted the fix/1041-prod-cd branch July 29, 2026 13:30
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.

prod-cd 파일 수정

1 participant