Skip to content

Conversation

@PeraSite
Copy link
Member

@PeraSite PeraSite commented Dec 22, 2025

Summary

Session Replay, Event Capturing 등 상세한 애널리틱스를 위해 Posthog를 도입합니다.

Describe your changes

PostHog 관련 BuildConfig 필드 추가에 따라 local.properties를 수정해야 합니다.
https://www.notion.so/eat-ssu/local-properties-24ceeef75a1680fa9ff6d85b33afbe2f?source=copy_link
를 참조해주세요!

Issue

  • Resolves #

To reviewers

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @PeraSite, 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!

이 PR은 애플리케이션에 Posthog 애널리틱스 도구를 통합하여 사용자 행동에 대한 심층적인 데이터를 수집하고 분석할 수 있도록 합니다. 이를 통해 세션 리플레이 및 이벤트 캡처링과 같은 고급 애널리틱스 기능을 활용할 수 있게 됩니다.

Highlights

  • Posthog 도입: 세션 리플레이 및 이벤트 캡처링 등 상세한 애널리틱스를 위해 Posthog를 프로젝트에 도입했습니다.
  • 환경 변수 설정: Posthog API 키와 호스트를 "build.gradle.kts" 파일에 "BuildConfigField"로 추가하여 빌드 시 환경 변수로 사용할 수 있도록 설정했습니다.
  • Posthog SDK 통합: "App.kt" 파일에서 Posthog Android SDK를 초기화하고, 세션 리플레이 기능을 활성화하며 관련 설정을 구성했습니다.
  • 의존성 추가: "gradle/libs.versions.toml"에 Posthog 라이브러리 의존성을 추가했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
Contributor

@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은 PostHog를 도입하여 애널리틱스 기능을 강화하는 좋은 시도입니다. 몇 가지 개선점을 제안합니다. build.gradle.kts 파일에서 빌드 설정 중복을 줄여 유지보수성을 높일 수 있습니다. 또한, App.kt에서 PostHog 설정 시 개인정보 보호를 위해 release 빌드에서는 사용자 입력과 이미지를 마스킹하도록 수정하는 것이 매우 중요합니다. 마지막으로, libs.versions.toml에서 의존성 버전을 명확히 지정하여 빌드의 안정성을 높이는 것을 권장합니다. 자세한 내용은 각 파일의 주석을 참고해주세요.

Comment on lines 74 to 77
sessionReplay = true
sessionReplayConfig.maskAllTextInputs = false
sessionReplayConfig.maskAllImages = false
sessionReplayConfig.screenshot = true
Copy link
Contributor

Choose a reason for hiding this comment

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

security-critical critical

세션 리플레이 설정에서 maskAllTextInputsmaskAllImagesfalse로 설정하면 사용자의 민감한 정보(비밀번호, 개인정보 등)가 기록될 위험이 있습니다. 이는 심각한 개인정보 보호 문제로 이어질 수 있습니다. release 빌드에서는 기본값인 true를 사용하여 사용자 입력을 마스킹하고, 디버깅 목적으로 debug 빌드에서만 마스킹을 해제하는 것을 강력히 권장합니다.

            sessionReplay = true
            sessionReplayConfig.screenshot = true
            if (BuildConfig.DEBUG) {
                sessionReplayConfig.maskAllTextInputs = false
                sessionReplayConfig.maskAllImages = false
            }

Comment on lines +62 to +66
val postHogApiKey: String = p.getProperty("POSTHOG_API_KEY")
buildConfigField("String", "POSTHOG_API_KEY", "\"$postHogApiKey\"")

val postHogHost: String = p.getProperty("POSTHOG_HOST")
buildConfigField("String", "POSTHOG_HOST", "\"$postHogHost\"")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

releasedebug 빌드 타입에 PostHog API 키와 호스트를 설정하는 코드가 중복됩니다. 이러한 중복은 향후 키를 추가하거나 수정할 때 실수를 유발할 수 있습니다. buildTypes.all을 사용하거나 공통 함수를 만들어 중복을 제거하는 것을 고려해 보세요. 예를 들어, buildTypes 블록 밖에서 프로퍼티를 한 번만 로드하고 공통 설정을 적용할 수 있습니다. 이 리팩토링은 현재 추가된 PostHog 키 뿐만 아니라 기존의 다른 키 설정에도 적용하여 코드베이스를 더 깔끔하게 만들 수 있습니다.

glanceAppwidget = "1.1.1"
glanceAppwidgetPreview = "1.1.1"
glancePreview = "1.1.1"
posthog = "3.+"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

동적 버전(+)을 사용하면 새로운 버전이 출시될 때 예기치 않은 변경사항이나 빌드 오류가 발생할 수 있습니다. 이는 빌드의 재현성을 떨어뜨립니다. 안정적인 개발 환경을 위해 3.1.0과 같이 특정 버전을 명시하는 것을 권장합니다.

Suggested change
posthog = "3.+"
posthog = "3.1.0"

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.

2 participants