fix: Firebase 크리덴셜 CD 파이프라인 누락으로 인한 배포 실패 수정 - #220
Conversation
- CD 배포 시 FIREBASE_SERVICE_ACCOUNT 시크릿(base64)을 서버의 ~/app/firebase-service-account.json으로 복원 - docker-compose blue/green 양쪽에 볼륨 마운트 추가 - FirebaseConfig @PostConstruct가 classpath에서 파일을 찾아 IOException으로 앱 기동 실패하던 문제 해결
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough배포 워크플로우가 Firebase 서비스 계정 파일을 원격 호스트에 복원하고, ChangesFirebase 자격 증명 배포
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 53-60: 개발 및 운영 배포의 Firebase 자격 증명 복원 단계에서 파일 생성 직후 test -s로 비어 있지
않은지 확인하고 JSON 형식 검증을 추가하세요. .github/workflows/cd.yml의 53-60행과 105-112행 두 위치에 동일한
검증을 적용하며, 검증 실패 시 배포가 즉시 실패하도록 구성하세요.
- Around line 53-60: Update both Firebase credential creation sites in
.github/workflows/cd.yml at lines 53-60 and 105-112, within the deploy-dev and
deploy-prod SSH scripts, to explicitly apply chmod 700 to
~/app/firebase-service-account.json immediately after decoding and creating the
file; retain the existing credential path and ensure both deployment flows
enforce the same minimum permissions.
🪄 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.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 577f9340-eee0-4333-b2d2-3dbf44658d6b
📒 Files selected for processing (2)
.github/workflows/cd.ymldocker-compose.yml
- chmod 600으로 소유자만 읽을 수 있도록 파일 권한 제한 - 빈 파일 여부(test -s) 및 JSON 형식 유효성 검증 추가 - 잘못된 크리덴셜이면 배포 전 즉시 실패 처리
원인
PR #211 (FCM 토큰)에서
FirebaseConfig가 추가됨. 이 클래스는 앱 시작 시@PostConstruct에서firebase-service-account.json을 classpath에서 로드함.그런데 이 파일은
.gitignore에 등록된 민감 파일이라 Docker 이미지에 포함되지 않아 IOException → 앱 기동 실패 → 헬스체크 실패 → 배포 롤백 발생.해결
FIREBASE_SERVICE_ACCOUNTGitHub Secret(base64 인코딩된 JSON)을 CD에서 서버에 복원하는 step 추가docker-compose.ymlblue/green 양쪽에 볼륨 마운트 추가:./firebase-service-account.json:/app/resources/firebase-service-account.json:ro사전 작업 (완료)
FIREBASE_SERVICE_ACCOUNTGitHub Secret 등록 완료~/app/firebase-service-account.json수동 업로드 완료 (이번 배포 전까지 임시 대응)테스트
머지 후 CD 자동 실행 → 헬스체크 통과 여부 확인
Summary by CodeRabbit