Skip to content

[INFRA] Blue-Green 트래픽 전환 실패 시 URL Map 자동 롤백 - #138

Merged
ownue merged 2 commits into
developfrom
infra/#90-rollback
Aug 12, 2026
Merged

[INFRA] Blue-Green 트래픽 전환 실패 시 URL Map 자동 롤백#138
ownue merged 2 commits into
developfrom
infra/#90-rollback

Conversation

@ownue

@ownue ownue commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

📌 관련 이슈

✨ 작업 내용

  • Blue-Green 트래픽 전환 스텝에 식별자를 추가
  • URL Map 전환 성공 후 후속 검증이 실패한 경우 이전 Active Backend Service로 자동 롤백하도록 구성
  • 이전 Active 색상에 따라 Blue 또는 Green Backend Service를 롤백 대상으로 선택
  • 롤백 이후 URL Map을 polling하여 이전 Backend Service로 복구되었는지 검증
  • URL Map 조회가 일시적으로 실패해도 롤백 검증을 재시도하도록 처리
  • 롤백 명령 및 검증 실패 시 이전 Active, 롤백 대상, 현재 Backend를 로그로 확인할 수 있도록 추가함
  • 트래픽 전환 전에 실패하거나 전환 스텝 자체가 실패한 경우에는 롤백이 실행되지 않음

📸 UI 작업 시

X

✅ 체크 리스트

  • develop 브랜치를 pull 완료했는가?
  • Merge 하려는 브랜치가 올바른가?
  • Merge 하려는 PR 및 Commit들을 로컬에서 실행했을 때 에러가 발생하지 않았는가?

Summary by CodeRabbit

  • 새로운 기능

    • 트래픽 전환 단계에 전환 식별자를 추가했습니다.
    • 전환 후 검증에 실패하면 이전에 활성화된 백엔드로 자동 복구합니다.
    • 복구 결과를 반복 확인해 롤백이 정상 완료되었는지 검증합니다.
  • 버그 수정

    • 트래픽 전환, 검증 또는 복구 과정에서 명령 실행이 실패할 때 오류를 처리하도록 개선했습니다.

@ownue
ownue requested review from hyeonky0w0 and riveryunny August 12, 2026 08:03
@ownue ownue self-assigned this Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 12 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.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c63fbf3-50f0-4262-90b9-8782cfb3e5b9

📥 Commits

Reviewing files that changed from the base of the PR and between a0c2516 and deb5eb0.

📒 Files selected for processing (1)
  • .github/workflows/cd.yml
📝 Walkthrough

Walkthrough

Blue-Green 배포 워크플로에 전환 상태 추적과 자동 롤백을 추가했습니다. 전환 후 검증이 실패하면 이전 Backend Service로 URL Map을 복구하고, 최대 30회 복구 상태를 확인합니다.

Changes

Blue-Green 트래픽 롤백

Layer / File(s) Summary
트래픽 전환 상태 추적
.github/workflows/cd.yml
트래픽 전환 단계에 switch ID를 추가합니다. 후속 단계는 전환 성공 여부를 참조합니다.
롤백 및 결과 검증
.github/workflows/cd.yml
전환 성공 후 후속 단계가 실패하면 이전 활성 색상에 대응하는 Backend Service로 URL Map을 복구합니다. 롤백 후 기본 Backend Service를 최대 30회 조회합니다. 롤백 명령 또는 검증이 실패하면 현재 값과 예상 값을 로그에 출력하고 워크플로를 실패 처리합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant 배포 워크플로
  participant URL Map
  participant 이전 Backend Service
  배포 워크플로->>URL Map: 트래픽을 대기 Backend Service로 전환
  배포 워크플로->>URL Map: 전환 결과 검증
  URL Map-->>배포 워크플로: 검증 실패
  배포 워크플로->>URL Map: 이전 Backend Service로 기본 서비스 복구
  배포 워크플로->>URL Map: 복구 상태를 최대 30회 조회
  URL Map-->>배포 워크플로: 현재 기본 Backend Service 반환
Loading

Poem

전환이 먼저 길을 열고
실패하면 이전 길을 찾네
URL Map은 뒤로 돌아
최대 서른 번 상태를 살피고
Blue-Green 배포는 안전하게 착지하네

🚥 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 제목은 Blue-Green 트래픽 전환 실패 시 URL Map 자동 롤백이라는 핵심 변경을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed 변경 요약은 전환 후 실패 조건, 이전 Backend Service 복구, URL Map polling 검증, 로그 기록 요구사항을 충족합니다 [#90].
Out of Scope Changes check ✅ Passed 변경 범위는 .github/workflows/cd.yml의 트래픽 전환 후 롤백 및 검증 절차로 한정되어 Issue #90의 목적과 일치합니다.
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 infra/#90-rollback

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: 1

🤖 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/cd.yml:
- Around line 333-337: Update the rollback failure branch after the gcloud
compute url-maps set-default-service command to run gcloud compute url-maps
describe for URL_MAP and obtain the current backend service, falling back to
UNKNOWN if the lookup fails, then log that value before exiting. Preserve the
existing rollback failure message and exit behavior.
🪄 Autofix

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 06366b8a-9975-4ec2-94f3-0937affc12bc

📥 Commits

Reviewing files that changed from the base of the PR and between c903743 and a0c2516.

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

Comment thread .github/workflows/cd.yml
@ownue
ownue merged commit 8e950a6 into develop Aug 12, 2026
2 checks passed
@ownue
ownue deleted the infra/#90-rollback branch August 13, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧱 [INFRA] Blue-Green 트래픽 전환 실패 시 URL Map 자동 롤백 추가

1 participant