Skip to content

fix: 헬스체크 grep 쿼팅 버그 수정#758

Merged
Hexeong merged 1 commit into
developfrom
refactor/607-adjust-blue-green-deploy
Jun 15, 2026
Merged

fix: 헬스체크 grep 쿼팅 버그 수정#758
Hexeong merged 1 commit into
developfrom
refactor/607-adjust-blue-green-deploy

Conversation

@Hexeong

@Hexeong Hexeong commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

작업 내용

SSH 단일 인용부호 내부에서 '"status":"UP"' 패턴이 올바르게 전달되지 않는 쉘 쿼팅 버그를 수정합니다.

문제

SSH 명령이 single-quote로 감싸진 상태에서 내부의 '"status":"UP"'가 파싱될 때, bash가 single-quote를 닫았다 열면서 grep -o status:UP으로 해석됩니다. {"status":"UP"} 응답에서 status:UP은 매칭되지 않아 헬스체크가 항상 실패했습니다.

변경 내용

grep -o '"status":"UP"' 방식 → HTTP 상태코드 확인 방식으로 변경

# AS-IS (quoting 버그)
STATUS=$(curl ... | grep -o '"status":"UP"' || true)
[ "$STATUS" = '"status":"UP"' ] && break

# TO-BE (quoting 문제 없음)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" ... || true)
[ "$HTTP_CODE" = "200" ] && break

Spring Boot는 상태가 UP이면 HTTP 200, DOWN이면 503을 반환하므로 상태코드로 판단합니다.

변경 파일: .github/workflows/dev-cd.yml, .github/workflows/prod-cd.yml

특이 사항

  • 로직 변경 없음, 쿼팅 방식만 변경
  • %{http_code}는 single-quote 내부에서도 올바르게 전달됨

리뷰 요구사항 (선택)

  • SSH heredoc 내부 single-quote 쿼팅 이슈가 원인이 맞는지 확인 부탁드립니다

@Hexeong Hexeong self-assigned this Jun 15, 2026
@Hexeong Hexeong requested review from JAEHEE25 and lsy1307 as code owners June 15, 2026 11:53
@Hexeong Hexeong added the 진행 중 자유롭게 merge 가능 label Jun 15, 2026
@Hexeong Hexeong requested a review from sukangpunch as a code owner June 15, 2026 11:53
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6e5eb274-0312-4e7b-b0c0-aa96856e711d

📥 Commits

Reviewing files that changed from the base of the PR and between aedf4bc and 69afa05.

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

Walkthrough

  1. dev-cd.yml — 헬스 체크 판정 방식 변경

    • 기존의 /actuator/health 응답 본문에서 "status":"UP" 문자열을 검색하던 로직이 제거되었습니다.
    • 이제 curl의 HTTP 응답 코드(%{http_code})를 가져와 200이면 정상으로 판정합니다.
    • 타임아웃 발생 시 새 슬롯 컨테이너를 중지·삭제하고 exit 1로 실패 처리하는 흐름은 그대로 유지됩니다.
  2. prod-cd.yml — 헬스 체크 판정 방식 변경

    • SSH 배포 스크립트 내 헬스 체크 루프에서 루프 변수명이 STATUS에서 HTTP_CODE로 교체되었습니다.
    • 정상 판정 조건이 "status":"UP" 문자열 비교에서 HTTP 코드 200 비교로 전환되었습니다.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • wibaek
  • whqtker
  • JAEHEE25
  • lsy1307
  • sukangpunch
  • Gyuhyeok99
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/607-adjust-blue-green-deploy

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.

@Hexeong Hexeong merged commit bf0b7b2 into develop Jun 15, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

인프라 진행 중 자유롭게 merge 가능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant