Skip to content

Comments

feat(api): Sentry 통합, 환경변수 정리, CI/CD 배포 워크플로우 (#212)#215

Merged
dydals3440 merged 3 commits intomainfrom
feature/sentry-docker-deploy
Feb 24, 2026
Merged

feat(api): Sentry 통합, 환경변수 정리, CI/CD 배포 워크플로우 (#212)#215
dydals3440 merged 3 commits intomainfrom
feature/sentry-docker-deploy

Conversation

@dydals3440
Copy link
Contributor

요약

  • Sentry 에러 모니터링 통합 (5xx만 캡처)
  • 환경변수 통일성 정리 (RevenueCat, Email 기본값, EXPO_ACCESS_TOKEN)
  • CI/CD 자동 배포 워크플로우 추가 (deploy.yml)
  • 배포 가이드 업데이트
  • pnpm v10 deploy --legacy 호환

Closes #212

- deploy.yml: CI 통과 후 EC2 자동 배포 워크플로우 추가
- Sentry: SentryGlobalFilter 제거, GlobalExceptionFilter에서 5xx만 직접 캡처
- 배포 가이드: nano→vim, Git URL 통일, Phase 9 CI/CD 섹션 추가
@dydals3440 dydals3440 merged commit 4e6f2fc into main Feb 24, 2026
3 checks passed
@dydals3440 dydals3440 deleted the feature/sentry-docker-deploy branch February 24, 2026 11:38
@gemini-code-assist
Copy link

Summary of Changes

Hello @dydals3440, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 API 서버의 안정성과 개발/배포 효율성을 크게 향상시키는 데 중점을 둡니다. Sentry를 통한 에러 모니터링 도입으로 런타임 오류를 조기에 감지하고, 환경변수 설정을 표준화하여 구성 관리의 일관성을 확보했습니다. 또한, 자동화된 CI/CD 배포 워크플로우를 구축하여 배포 과정을 간소화하고, Docker 및 pnpm 관련 설정을 최신화하여 전반적인 시스템 견고성을 강화했습니다.

Highlights

  • Sentry 에러 모니터링 통합: API 서버에 Sentry 에러 모니터링을 통합하여 5xx 서버 에러만 캡처하도록 설정했습니다. 이를 통해 운영 환경에서 발생하는 심각한 오류를 효과적으로 추적하고 대응할 수 있습니다.
  • 환경변수 통일성 정리 및 확장: 개발 및 프로덕션 환경변수 예시 파일(.env.docker.dev.example, .env.docker.prod.example)을 정리하고 RevenueCat, 이메일 기본값, EXPO_ACCESS_TOKEN 등 다양한 외부 서비스 및 시스템 관련 변수들을 추가 및 표준화했습니다.
  • CI/CD 자동 배포 워크플로우 추가: CI/CD 자동 배포 워크플로우(deploy.yml)를 추가하여 개발 및 배포 프로세스의 효율성을 높였습니다. 또한 pnpm v10의 --legacy 호환 옵션을 적용했습니다.
  • Docker 및 pnpm 버전 업데이트: Dockerfile 내 pnpm 버전을 9.15.4에서 10.29.3으로 업데이트하고, Prisma generate 명령어를 수정하여 Docker 빌드 환경에서 dotenv가 없는 경우에도 정상적으로 동작하도록 개선했습니다.
  • 배포 가이드 및 Docker Compose 설정 업데이트: 배포 가이드가 업데이트되었으며, docker-compose.prod.yml 파일에 restart: unless-stopped 정책을 추가하여 서비스 안정성을 강화했습니다.
Changelog
  • .dockerignore
    • 문서 관련 .md 파일 대신 myDocs/ 디렉토리를 무시하도록 업데이트되었습니다.
  • .env.docker.dev.example
    • JWT 비밀 키의 설명을 업데이트했습니다.
    • CORS 오리진, 스로틀링 관련 환경변수를 추가했습니다.
    • OAuth 콜백 URL 형식을 v1/auth/...로 변경했습니다.
    • Apple OAuth 관련 환경변수 주석을 추가했습니다.
    • 이메일 발신자 및 지원 이메일 기본값을 추가했습니다.
    • RevenueCat, 캐시, 푸시 알림, Sentry DSN 관련 환경변수 주석을 추가했습니다.
  • .env.docker.prod.example
    • DB_PASSWORD 변경 시 DATABASE_URL도 수정해야 한다는 경고 문구를 업데이트했습니다.
    • OAuth 콜백 URL 형식을 v1/auth/...로 변경했습니다.
    • Apple OAuth 관련 환경변수 주석을 추가했습니다.
    • RevenueCat, 푸시 알림, Sentry DSN 관련 환경변수 주석을 추가했습니다.
    • 캐시 관련 환경변수 기본값을 설정하고 활성화했습니다.
  • apps/api/Dockerfile
    • pnpm 버전을 9.15.4에서 10.29.3으로 업데이트했습니다.
    • 주석 형식을 간소화했습니다.
    • Prisma generate 명령어를 cd apps/api && pnpm prisma generate로 변경했습니다.
    • pnpm deploy 명령어에 --legacy 플래그를 추가했습니다.
    • migrate 스테이지에 apps/api/prisma.config.ts 파일을 복사하도록 추가했습니다.
  • apps/api/package.json
    • Sentry 통합을 위해 @sentry/nestjs 패키지를 추가했습니다.
  • apps/api/prisma.config.ts
    • dotenv 로딩 로직을 수정하여 Docker 빌드 환경에서 dotenv가 설치되지 않은 경우에도 오류 없이 동작하도록 개선했습니다.
  • apps/api/src/app.module.ts
    • SentryModule을 임포트하고 애플리케이션 모듈에 추가하여 Sentry를 초기화했습니다.
    • 모듈 섹션 주석의 순서를 조정했습니다.
  • apps/api/src/common/config/schemas/email.schema.ts
    • 기본 EMAIL_FROMSUPPORT_EMAIL 주소를 noreply@aido.krsupport@aido.kr로 변경했습니다.
  • apps/api/src/common/config/schemas/external.schema.ts
    • RevenueCat API 키 변수명을 REVENUECAT_API_KEY에서 REVENUECAT_SECRET_API_KEY로 변경하고 REVENUECAT_WEBHOOK_SECRET을 추가했습니다.
  • apps/api/src/common/config/services/config.service.ts
    • revenueCatApiKey getter를 revenuecat 객체 getter로 변경하여 secretApiKeywebhookSecret을 반환하도록 했습니다.
  • apps/api/src/common/exception/exception.module.ts
    • GlobalExceptionFilter에서 Sentry 캡처를 직접 수행한다는 주석을 추가했습니다.
  • apps/api/src/common/exception/filters/global-exception.filter.spec.ts
    • Sentry 모듈을 모의(mock) 처리했습니다.
    • 5xx 서버 에러가 Sentry에 캡처되는지 확인하는 테스트 케이스를 추가했습니다.
    • 4xx 클라이언트 에러 및 BusinessException이 Sentry에 캡처되지 않는지 확인하는 테스트 케이스를 추가했습니다.
  • apps/api/src/common/exception/filters/global-exception.filter.ts
    • Sentry를 임포트하고 5xx 상태 코드의 예외만 Sentry에 캡처하도록 로직을 추가했습니다.
  • apps/api/src/instrument.ts
    • Sentry 초기화 로직을 포함하는 새로운 파일을 추가했습니다.
  • apps/api/src/main.ts
    • Sentry 초기화를 위해 instrument 파일을 임포트했습니다.
  • docker-compose.prod.yml
    • db 및 api 서비스에 restart: unless-stopped 정책을 추가했습니다.
  • pnpm-lock.yaml
    • pnpm 버전 업데이트에 따른 의존성 해시를 업데이트했습니다.
    • Sentry 관련 패키지(@sentry/nestjs, @sentry/core, @sentry/node-core, @sentry/node, @sentry/opentelemetry) 및 관련 OpenTelemetry 패키지 의존성을 추가했습니다.
    • 다양한 @opentelemetry@types 패키지 의존성을 추가했습니다.
    • 기존 @babel/corebabel-jest, babel-preset-jest 관련 의존성을 업데이트 및 정리했습니다.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/deploy.yml
Activity
  • Sentry 에러 모니터링 통합을 위한 초기 설정 및 코드 변경이 이루어졌습니다.
  • 환경변수 정의 및 사용 방식의 일관성을 높이기 위한 작업이 진행되었습니다.
  • CI/CD 자동 배포 워크플로우 파일이 생성 및 구성되었습니다.
  • pnpm 버전 업그레이드 및 Dockerfile 관련 수정이 완료되었습니다.
  • docker-compose.prod.yml 파일에 서비스 재시작 정책이 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 Sentry를 통한 에러 모니터링 통합, 환경 변수 정리, 그리고 CI/CD 워크플로우 추가 등 API 서버의 안정성과 운영 효율성을 높이는 중요한 개선 사항들을 포함하고 있습니다. 전반적으로 코드 변경 사항들은 깔끔하게 작성되었으며, 특히 Sentry 통합 부분에서 5xx 에러만 선별적으로 캡처하는 로직과 관련 테스트 코드를 추가한 점이 인상적입니다. 몇 가지 추가적인 개선을 위해 Sentry 설정의 유연성을 높이는 방안과 Docker 이미지 크기를 최적화하는 방안에 대한 의견을 남겼습니다.

@dydals3440 dydals3440 self-assigned this Feb 24, 2026
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.

[Feature]: Sentry 에러 모니터링 통합 및 Docker 배포 설정 정비

1 participant