Skip to content

[fix] Mixpanel 활성 호스트에 www 도메인 추가 #876

Merged
seongwon030 merged 1 commit intodevelop-fefrom
fix/mixpanel-host-whitelist
Nov 22, 2025
Merged

[fix] Mixpanel 활성 호스트에 www 도메인 추가 #876
seongwon030 merged 1 commit intodevelop-fefrom
fix/mixpanel-host-whitelist

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented Nov 20, 2025

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

#875

핫픽스로 main에 이미 올라갔습니다

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • 개선사항
    • 프로덕션 환경 감지 로직을 개선하여 더욱 안정적인 환경 판별을 구현했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@seongwon030 seongwon030 self-assigned this Nov 20, 2025
@seongwon030 seongwon030 added 💻 FE Frontend 🚀 hotfix 즉시 릴리즈할 부분 labels Nov 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

frontend/src/utils/initSDK.ts 파일에서 프로덕션 환경 판별 로직을 변경했습니다. 기존의 PRODUCTION_URL에서 startsWith() 확인 방식을 제거하고, PRODUCTION_HOSTNAMES 배열과 window.location.hostname을 사용한 호스트명 기반 확인으로 대체했습니다. 이는 Mixpanel 비활성화 제어 흐름에 영향을 줍니다.

Changes

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

Suggested reviewers

  • lepitaaar
  • oesnuj

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
moadong Ready Ready Preview Comment Nov 20, 2025 10:04am

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 504f573 and 7c57475.

📒 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에서 추가적인 동작 변화는 없는 것으로 판단됩니다.

@seongwon030 seongwon030 changed the title [fix] fix: Mixpanel 활성 호스트에 www 도메인 추가 [fix] Mixpanel 활성 호스트에 www 도메인 추가 Nov 20, 2025
@lepitaaar lepitaaar self-requested a review November 21, 2025 06:03
Copy link
Contributor

@lepitaaar lepitaaar left a comment

Choose a reason for hiding this comment

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

프로덕션 주소 추가를잊었네요 수고하셨습니다

@seongwon030 seongwon030 merged commit 2040cfb into develop-fe Nov 22, 2025
3 checks passed
@seongwon030 seongwon030 deleted the fix/mixpanel-host-whitelist branch November 22, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🚀 hotfix 즉시 릴리즈할 부분

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments