Conversation
📝 WalkthroughWalkthroughSentry 에러 추적 및 성능 모니터링을 React 애플리케이션에 통합합니다. 배포 워크플로우에 환경별 시크릿 검증 단계를 추가하고, Sentry 의존성을 설치하며, 초기화 함수와 타입 정의를 작성합니다. App.tsx에 SentryRoutes를 적용하고, main.tsx에 에러 바운더리를 감싸며, vite.config.ts에 소스맵 업로드 플러그인을 구성합니다. Possibly related issues
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/deploy.yml:
- Around line 56-62: The workflow step "Resolve Sentry project" sets
SENTRY_PROJECT_FOR_BUILD from either secrets.SENTRY_PROJECT or
secrets.SENTRY_PROJECT_STAGE depending on github.ref_name but doesn't validate
that SENTRY_PROJECT_STAGE exists for non-main branches; update the step to check
that when github.ref_name != "main" the secrets.SENTRY_PROJECT_STAGE is set
(non-empty) and fail the job with a clear error message if missing, mirroring
whatever validation is done for secrets.SENTRY_PROJECT, so
SENTRY_PROJECT_FOR_BUILD is never left unset and source map upload won't
silently fail.
In @.gitignore:
- Around line 26-27: .gitignore currently ignores all .env* files and also
explicitly lists .env.example, which prevents committing the template; open the
.gitignore file and remove the explicit ".env.example" entry so only actual .env
files are ignored (keep the ".env*" rule intact) ensuring the .env.example
template remains in version control.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yamland included by**
📒 Files selected for processing (8)
.github/workflows/deploy.yml.gitignorepackage.jsonsrc/App.tsxsrc/config/sentry.tssrc/global.d.tssrc/main.tsxvite.config.ts
| - name: Resolve Sentry project | ||
| run: | | ||
| if [ "${{ github.ref_name }}" = "main" ]; then | ||
| echo "SENTRY_PROJECT_FOR_BUILD=${{ secrets.SENTRY_PROJECT }}" >> "$GITHUB_ENV" | ||
| else | ||
| echo "SENTRY_PROJECT_FOR_BUILD=${{ secrets.SENTRY_PROJECT_STAGE }}" >> "$GITHUB_ENV" | ||
| fi |
There was a problem hiding this comment.
staging 브랜치에서 SENTRY_PROJECT_STAGE 시크릿 검증이 누락되었습니다.
main이 아닌 브랜치에서 SENTRY_PROJECT_STAGE를 사용하지만, 해당 시크릿에 대한 검증이 없습니다. 시크릿이 없으면 빌드 시 소스맵 업로드가 실패할 수 있습니다.
제안된 수정
- name: Validate runtime secrets
run: |
missing=0
if [ "${{ github.ref_name }}" = "main" ]; then
[ -n "${{ secrets.VITE_API_PATH }}" ] || { echo "::error::Missing secret: VITE_API_PATH"; missing=1; }
[ -n "${{ secrets.VITE_SENTRY_DSN }}" ] || { echo "::error::Missing secret: VITE_SENTRY_DSN"; missing=1; }
else
[ -n "${{ secrets.VITE_API_PATH_STAGE }}" ] || { echo "::error::Missing secret: VITE_API_PATH_STAGE"; missing=1; }
[ -n "${{ secrets.VITE_SENTRY_DSN_STAGE }}" ] || { echo "::error::Missing secret: VITE_SENTRY_DSN_STAGE"; missing=1; }
+ [ -n "${{ secrets.SENTRY_PROJECT_STAGE }}" ] || { echo "::error::Missing secret: SENTRY_PROJECT_STAGE"; missing=1; }
fi
[ "$missing" -eq 0 ] || exit 1🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/deploy.yml around lines 56 - 62, The workflow step
"Resolve Sentry project" sets SENTRY_PROJECT_FOR_BUILD from either
secrets.SENTRY_PROJECT or secrets.SENTRY_PROJECT_STAGE depending on
github.ref_name but doesn't validate that SENTRY_PROJECT_STAGE exists for
non-main branches; update the step to check that when github.ref_name != "main"
the secrets.SENTRY_PROJECT_STAGE is set (non-empty) and fail the job with a
clear error message if missing, mirroring whatever validation is done for
secrets.SENTRY_PROJECT, so SENTRY_PROJECT_FOR_BUILD is never left unset and
source map upload won't silently fail.
| .env* | ||
| .env.example |
There was a problem hiding this comment.
.env.example은 일반적으로 버전 관리에 포함해야 합니다.
.env.example은 개발자들에게 필요한 환경 변수 템플릿을 제공하는 파일입니다. .env* 패턴이 이미 존재하므로, .env.example을 명시적으로 무시하면 템플릿 파일이 커밋되지 않습니다.
제안된 수정
.env*
+!.env.example
-.env.example📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .env* | |
| .env.example | |
| .env* | |
| !.env.example |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.gitignore around lines 26 - 27, .gitignore currently ignores all .env*
files and also explicitly lists .env.example, which prevents committing the
template; open the .gitignore file and remove the explicit ".env.example" entry
so only actual .env files are ignored (keep the ".env*" rule intact) ensuring
the .env.example template remains in version control.
Summary by CodeRabbit
릴리스 노트
New Features
Chores