[fix] Mixpanel 활성 호스트에 www 도메인 추가 #876
Conversation
|
Warning
|
| Cohort / File(s) | Summary |
|---|---|
Production hostname detection logic frontend/src/utils/initSDK.ts |
PRODUCTION_URL 기반 startsWith 체크를 PRODUCTION_HOSTNAMES 배열과 window.location.hostname을 사용한 호스트명 기반 체크로 변경. initializeMixpanel 함수의 프로덕션 환경 판별 로직 수정 |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
- 단일 파일의 제한된 범위의 변경으로, 프로덕션 판별 로직의 일관성과 올바른 호스트명 배열 설정 확인 필요
- 기존 PRODUCTION_URL 참조가 모두 제거되었는지, 다른 파일에서의 사용 여부 확인 권장
Possibly related PRs
- [feature] 프로덕션 외 Mixpanel 비활성화 #869: 동일 파일의 initializeMixpanel 함수를 수정하며, 프로덕션 감지 방식에 대해 상반된 변경(hostname-array 체크 vs PRODUCTION_URL startsWith 체크)을 구현
- [feature] Mixpanel IP 추적하도록 변경 및 ignore_dnt 적용 #850:
frontend/src/utils/initSDK.ts의 initializeMixpanel 함수를 수정하며, 본 PR은 프로덕션 호스트명 체크를 변경하고 해당 PR은 mixpanel.init 설정(ip/ignore_dnt)을 변경
Suggested reviewers
- lepitaaar
- oesnuj
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | PR 제목은 실제 변경 사항과 일치합니다. Mixpanel 활성 호스트에 www 도메인을 추가하는 것이 주요 변경 내용이며, 제목이 이를 명확하게 요약하고 있습니다. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
fix/mixpanel-host-whitelist
Tip
📝 Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting. - Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.
Example instruction:
"Divide the high-level summary into five sections:
- 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
- 📓 References — List relevant issues, discussions, documentation, or related PRs.
- 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
- 📊 Contributor Summary — Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- ✔️ Additional Notes — Add any extra reviewer context.
Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
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 @coderabbitai help to get the list of available commands and usage tips.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
frontend/src/utils/initSDK.ts (2)
5-5: PRODUCTION_HOSTNAMES 구성은 PR 의도에 잘 맞습니다
'moadong.com'과'www.moadong.com'을 명시적으로 화이트리스트에 두어서 제목에 언급된 “www 도메인 추가” 요구사항은 충족되어 보입니다.필수는 아니지만, 실수로 배열이 변경되는 것을 막고 싶다면 아래처럼
as const를 붙여서 상수성을 조금 더 강화할 수 있습니다.const PRODUCTION_HOSTNAMES = ['moadong.com', 'www.moadong.com'] as const;
15-18: 호스트 기반 프로덕션 판별 로직은 합리적이나, 스테이징/프리뷰 도메인 의도는 한 번 더 확인해 주세요현재 로직은
window.location.hostname이PRODUCTION_HOSTNAMES에 포함되지 않으면 무조건mixpanel.disable()을 호출합니다.
즉, 아래 환경에서는 항상 Mixpanel이 비활성화됩니다.
- 로컬 개발 (
localhost,127.0.0.1등)- 스테이징/프리뷰/배포 검증용 도메인 등,
moadong.com/www.moadong.com이외의 모든 호스트이게 팀의 의도(“진짜 프로덕션 도메인에서만 트래킹 허용”)라면 구현은 깔끔하고 문제 없어 보입니다. 다만 스테이징에서 실제 트래킹을 보고 싶다면, 해당 도메인을
PRODUCTION_HOSTNAMES에 추가하거나 별도 리스트로 관리해야 할 수 있습니다.또, 이 함수가 혹시라도 SSR 환경(예: Next.js)에서 서버 사이드에서 호출될 가능성이 있다면
window접근 전에 다음과 같이 방어 로직을 추가하는 것도 고려해볼 만합니다.if (typeof window === 'undefined') { mixpanel.disable(); return; }현재 코드베이스가 순수 CSR/Vite 기반이라면 그대로 두어도 무방하지만, 사용 맥락을 한 번만 더 확인해 주세요.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
frontend/src/utils/initSDK.ts(3 hunks)
🔇 Additional comments (1)
frontend/src/utils/initSDK.ts (1)
43-59: Kakao SDK 초기화 로직은 이번 PR과 무관하며 동작에도 변화가 없어 보입니다마지막 중괄호 라인 변경은 포맷/개행 수준 변화로 보이고,
initializeKakaoSDK내부 로직 자체는 기존과 동일하게 보입니다. 이 PR에서 추가적인 동작 변화는 없는 것으로 판단됩니다.
lepitaaar
left a comment
There was a problem hiding this comment.
프로덕션 주소 추가를잊었네요 수고하셨습니다
#️⃣연관된 이슈
📝작업 내용
#875
핫픽스로 main에 이미 올라갔습니다
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings.