Skip to content

정상 배포마다 남던 배포 요약 스텝의 실패 표시 제거 - #940

Open
m-a-king wants to merge 1 commit into
devfrom
infra/937-deploy-summary-exit-code
Open

정상 배포마다 남던 배포 요약 스텝의 실패 표시 제거#940
m-a-king wants to merge 1 commit into
devfrom
infra/937-deploy-summary-exit-code

Conversation

@m-a-king

Copy link
Copy Markdown
Collaborator

Situation

prod promote(v1.2.0) 배포 결과를 확인하던 중 run 페이지에 Process completed with exit code 1 이 빨갛게 떠서 실패를 의심하고 멈췄다. 확인해 보니 job 3개 전부 success 였고 배포도 정상이었다.

배포 요약 스텝(Write deployment summary)이 정상 배포마다 이 표시를 남기고 있었다. prod 만의 일도 아니었다.

대상 job annotation
prod deploy (2026-08-13) 94356528421 [failure] Process completed with exit code 1.
직전 dev deploy 94318572726 동일

Task

  • 정상 상태가 실패로 표시되는 원인을 없앤다.
  • 가드가 실제로 발동한 배포에서는 "중단 사유" 행이 요약 표에 그대로 나와야 한다.

Action

원인

요약 표를 만드는 블록의 마지막 줄이 조건 단축평가였다.

[ -n "$GUARD_REASON" ] && echo "| 중단 사유 | $GUARD_REASON |"
  • 가드 미발동이 정상 상태다. GUARD_REASON 은 환경과 호스트가 어긋나 배포를 중단했을 때만 채워진다. 정상 배포에서는 빈 문자열이다.
  • 조건 거짓이 그대로 종료코드가 된다. 조건이 거짓이면 뒤의 echo 를 건너뛰고 그 줄의 종료코드는 1 이 된다. 이 줄이 블록의 마지막이라 스텝 종료코드가 1 로 확정됐다. 즉 "중단 사유가 없다"는 정상 상태가 셸에서 실패로 번역됐다.
  • job 은 초록, 표시만 빨강이었다. 스텝에 continue-on-error: true 가 붙어 있어 job 결과는 success 로 유지됐다. 목록에서는 정상으로 보이고 run 을 열어야 빨간 표시가 드러나, 오랫동안 눈에 띄지 않았다.

수정 방식 선택

방식 성격 채택
if 문으로 전환 조건 거짓이 애초에 종료코드가 되지 않음 채택
뒤에 || true 추가 실패 종료코드를 사후에 덮음. 나중에 진짜 실패가 생겨도 함께 삼킴 안 함
continue-on-error 제거 job 이 실제로 빨개짐. 애초에 원인이 아님 안 함

덮는 대신 조건 거짓이 종료코드로 새지 않는 형태로 바꿨다.

검증

수정 전후 패턴을 bash 로 직접 실행해 확인했다.

경우 수정 전 수정 후
사유 없음 (정상 배포) exit 1 exit 0
사유 있음 (가드 발동) 행 출력 + exit 0 행 출력 + exit 0

워크플로 10개의 YAML 파싱 유효성도 함께 확인했다.

다른 지점 재조사

같은 단축평가가 블록 마지막에 오는 지점을 워크플로 전체에서 훑었다.

  • certbot SSL 파일 복사 지점 (deploy.yml): 구조는 같지만 대상 파일이 없고 find 로도 못 찾은 경우에만 종료코드가 샌다. 그 상황은 복사가 실제로 실패한 것이라 실패 신호가 맞아 그대로 뒀다. 정상 상태가 실패로 번역되는 이번 케이스와 성격이 다르다.
  • 나머지 지점: 뒤에 명령이 더 있거나 || echo 로 보정돼 있어 종료코드가 새지 않는다.

Result

  • 정상 배포의 run 에는 빨간 표시가 남지 않는다. 배포 로그의 빨간색이 진짜 실패만 뜻하게 된다.
  • 실효는 다음 배포 run 의 Annotations 가 비는 것으로 확인할 수 있다. 이 PR 자체는 배포를 트리거하지 않는다.

연관 이슈

- Write deployment summary 의 마지막 줄이 "[ -n "$GUARD_REASON" ] && echo" 라, 가드 미발동(정상 배포)이면 조건 거짓의 종료코드 1 이 그대로 스텝 종료코드가 됐다. continue-on-error 덕에 job 은 success 였지만 run 페이지 Annotations 와 스텝 로그 끝에 빨간 실패가 매번 남았다
- 2026-08-13 prod promote(job 94356528421)와 직전 dev 배포(job 94318572726) 양쪽에서 동일 annotation 을 확인했다. 배포 로그를 읽을 때 진짜 실패와 구분되지 않아 실제로 오독을 유발했다
- "|| true" 로 종료코드를 덮는 대신 if 문으로 바꿔, 조건 거짓이 애초에 종료코드가 되지 않게 했다. 가드가 실제 발동한 배포에서는 중단 사유 행이 그대로 출력된다
- 같은 단축평가가 블록 마지막에 오는 다른 지점을 워크플로 전체에서 재조사했다. certbot SSL 파일 복사 지점은 복사가 실제로 실패했을 때만 종료코드가 새는 다른 성격이라 그대로 뒀다
@m-a-king m-a-king added the infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow) label Aug 13, 2026
@m-a-king m-a-king self-assigned this Aug 13, 2026
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@m-a-king, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 112 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 12ec0c64-9b26-47b2-922a-41f8af0f6925

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8389d and 85ec0d2.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yml

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.

@github-actions

Copy link
Copy Markdown

Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다.

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

Labels

infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

정상 배포마다 남는 요약 스텝 exit code 1 annotation 을 없앤다

1 participant