Release 0.3.2 to develop#113
Conversation
track ์ super properties๋ฅผ ํจ๊ป ์ถ๋ ฅํ๊ณ , identify๋ก user_id๋ฅผ ๊ฐฑ์ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
๊ฐ์์ฑ ๋ฒ์ ์ 0.3.2๋ก ์ ๋ฐ์ดํธํ๋ฉด์ ๋ถ์ ์์คํ ์ ๊ฐ์ ํ์ต๋๋ค. DebugAnalytics๊ฐ ์ฑ ๋ฒ์ ์ ๋ฐ์ ์ ์ฅํ๊ณ , ์ฌ์ฉ์ ID๋ฅผ ์ถ์ ํ์ฌ ๋ก๊น ์ ๋ณด๋ฅผ ๊ฐํํฉ๋๋ค. DI ๋ชจ๋์ด ํจํค์ง ์ ๋ณด์์ ๋ฒ์ ์ ๊ณ์ฐํ์ฌ ์ ๋ฌํ๊ณ , ViewModel์ด ์ถ๊ฐ ๋๋ฒ๊ทธ ๋ก๊น ์ ์ํํฉ๋๋ค. ๋ณ๊ฒฝ์ฌํญ๋ถ์ ์ถ์ ๊ฐ์
์์ ๊ฒํ ๋์ด๋๐ฏ 2 (๋จ์) | โฑ๏ธ ~12๋ถ ๊ด๋ จ๋ ๊ฐ๋ฅ์ฑ ์๋ PR
์ ์๋ ๋ ์ด๋ธ
์ ์๋ ๊ฒํ ์
๐ฅ Pre-merge checks | โ 5โ Passed checks (5 passed)
โ๏ธ Tip: You can configure your own custom pre-merge checks in the settings. โจ Finishing Touches๐ Generate docstrings
๐งช Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
๐งน Nitpick comments (1)
core/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/di/AnalyticsModule.kt (1)
24-28: โก Quick win
appVersion์ค๋ณต ์กฐํ์ ๋ณ์ ์๋์์ ์ ๋ฆฌํ๋ฉด ์ ์ง๋ณด์๊ฐ ์ข์์ง๋๋ค.Line 24-28์์ ์ด๋ฏธ ๊ณ์ฐํ ๊ฐ์ Line 38-42์์ ๋ค์ ๊ณ์ฐํ๊ณ ์์ด ์ค๋ณต์ ๋๋ค. ์ธ๋ถ
appVersion์ ์ฌ์ฌ์ฉํด ๋จ์ผ ์์ค๋ก ์ ์งํ๋ ํธ์ด ์์ ํฉ๋๋ค.โป๏ธ ์ ์ ์์ ์
return if (BuildConfig.DEBUG) { DebugAnalytics(appVersion) } else { val mixpanel = MixpanelAPI.getInstance( context, BuildConfig.MIXPANEL_TOKEN, true, ) - val appVersion = - context.packageManager - .getPackageInfo(context.packageName, 0) - .versionName - ?: "unknown" MixpanelAnalytics(mixpanel, appVersion) }Also applies to: 38-43
๐ค Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/di/AnalyticsModule.kt` around lines 24 - 28, The appVersion is being computed twice (once in the top-level val appVersion using context.packageManager.getPackageInfo(...).versionName and again later); remove the duplicate retrieval and reuse the already-computed appVersion variable wherever the second computation occurs (replace the repeated context.packageManager.getPackageInfo(...) call with the existing appVersion variable) so there is a single source of truth and no variable shadowing in AnalyticsModule.kt.
๐ค Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/main/java/com/sseotdabwa/buyornot/ui/BuyOrNotViewModel.kt`:
- Line 3: Remove the direct logging of the user's identifier: delete the Log
usage that prints userId (and remove the android.util.Log import) in
BuyOrNotViewModel.kt, and rely solely on the existing analytics.identify(...)
call to record identity; locate calls referencing userId and the Log class in
the ViewModel (the logger line around the analytics.identify(...) invocation)
and remove that log statement so PII is not written to logs.
In
`@core/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/DebugAnalytics.kt`:
- Around line 11-12: ํ์ฌ DebugAnalytics.kt์์ superProps์ userId๋ฅผ ํ๋ฌธ์ผ๋ก ํฌํจํด
Log.d("Analytics", ...)์ ์ถ๋ ฅํ๊ณ ์์ด ๊ฐ์ธ์ ๋ณด ์ ์ถ ์ํ์ด ์์ต๋๋ค; ์์ ๋ฐฉ๋ฒ์ Log ํธ์ถ์์ userId๋ฅผ ์ ๊ฑฐํ๊ฑฐ๋
์ต์ํ ๋ง์คํน ์ฒ๋ฆฌํ์ฌ ๋
ธ์ถ์ ์ฐจ๋จํ๋ ๊ฒ์ด๋ฉฐ(์: ๊ตฌํ๋ maskUserId(userId: String): String ์ฌ์ฉ ๋๋ ์๋ก
์ถ๊ฐ), superProps ์กฐ๋ฆฝ๋ถ(๋ณ์ superProps)์ ๋ก๊ทธ ํธ์ถ(Log.d)์์ plain userId ๋์
maskUserId(userId) ๋๋ ์์ ์ ๊ฑฐ๋ ๊ฐ์ผ๋ก ๋์ฒดํ๊ณ ํ
์คํธ ๋ก๊ทธ(๋๋ debug-only ๋น๋)์์๋ ๋์ผ ์ฒ๋ฆฌ๊ฐ ์ ์ฉ๋๋๋ก
์์ ํ์ธ์.
---
Nitpick comments:
In
`@core/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/di/AnalyticsModule.kt`:
- Around line 24-28: The appVersion is being computed twice (once in the
top-level val appVersion using
context.packageManager.getPackageInfo(...).versionName and again later); remove
the duplicate retrieval and reuse the already-computed appVersion variable
wherever the second computation occurs (replace the repeated
context.packageManager.getPackageInfo(...) call with the existing appVersion
variable) so there is a single source of truth and no variable shadowing in
AnalyticsModule.kt.
๐ช Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
โน๏ธ Review info
โ๏ธ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 9a65c99c-cee0-4691-bafe-94e7a2ed5794
๐ Files selected for processing (4)
app/build.gradle.ktsapp/src/main/java/com/sseotdabwa/buyornot/ui/BuyOrNotViewModel.ktcore/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/DebugAnalytics.ktcore/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/di/AnalyticsModule.kt
| @@ -1,5 +1,6 @@ | |||
| package com.sseotdabwa.buyornot.ui | |||
|
|
|||
| import android.util.Log | |||
There was a problem hiding this comment.
ViewModel์์ userId ์ง์ ๋ก๊น
์ ์ ๊ฑฐํ๋ ๊ฒ์ด ์์ ํฉ๋๋ค.
Line 36์ ๋ก๊ทธ๋ ๊ฐ์ธ ์๋ณ์๋ฅผ ํ๋ฌธ์ผ๋ก ๋จ๊น๋๋ค. analytics.identify(...) ํธ์ถ๋ง์ผ๋ก ๋ชฉ์ ์ด ๋ฌ์ฑ๋๋ฏ๋ก ์ง์ ๋ก๊ทธ๋ ๋นผ๋ ํธ์ด ์ข์ต๋๋ค.
๐ง ์ ์ ์์ ์
-import android.util.Log
@@
.distinctUntilChanged()
.onEach { userId ->
- Log.d("BuyOrNotViewModel", "userId: $userId")
analytics.identify(if (userId != 0L) userId.toString() else null)
}.launchIn(viewModelScope)Also applies to: 36-36
๐ค Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@app/src/main/java/com/sseotdabwa/buyornot/ui/BuyOrNotViewModel.kt` at line 3,
Remove the direct logging of the user's identifier: delete the Log usage that
prints userId (and remove the android.util.Log import) in BuyOrNotViewModel.kt,
and rely solely on the existing analytics.identify(...) call to record identity;
locate calls referencing userId and the Log class in the ViewModel (the logger
line around the analytics.identify(...) invocation) and remove that log
statement so PII is not written to logs.
| val superProps = "platform=android, app_version=$appVersion, user_id=$userId" | ||
| Log.d("Analytics", "$event [$superProps]") |
There was a problem hiding this comment.
userId ํ๋ฌธ ๋ก๊ทธ๋ ๊ฐ์ธ์ ๋ณด ๋
ธ์ถ ์ํ์ด ์์ต๋๋ค.
Line 11-12, Line 17์์ ์ฌ์ฉ์ ์๋ณ์๊ฐ ๊ทธ๋๋ก Logcat์ ๋จ์ต๋๋ค. ๋๋ฒ๊ทธ ํ๊ฒฝ์ด๋ผ๋ ์ธ๋ถ ๋ฐฐํฌ/๋ก๊ทธ ์์ง ์ ์ ์ถ ๊ฒฝ๋ก๊ฐ ๋ฉ๋๋ค. ์ต์ ๋ง์คํน ๋๋ ๋ก๊ทธ ์ ์ธ๊ฐ ํ์ํฉ๋๋ค.
๐ง ์ ์ ์์ ์
class DebugAnalytics(
private val appVersion: String,
) : Analytics {
private var userId: String? = null
override fun track(event: AnalyticsEvent) {
- val superProps = "platform=android, app_version=$appVersion, user_id=$userId"
+ val maskedUserId = userId?.let { "***${it.takeLast(2)}" }
+ val superProps = "platform=android, app_version=$appVersion, user_id=$maskedUserId"
Log.d("Analytics", "$event [$superProps]")
}
override fun identify(userId: String?) {
this.userId = userId
- Log.d("Analytics", "identify: userId=$userId")
+ Log.d("Analytics", "identify called")
}
}Also applies to: 16-17
๐ค Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@core/analytics/src/main/java/com/sseotdabwa/buyornot/core/analytics/DebugAnalytics.kt`
around lines 11 - 12, ํ์ฌ DebugAnalytics.kt์์ superProps์ userId๋ฅผ ํ๋ฌธ์ผ๋ก ํฌํจํด
Log.d("Analytics", ...)์ ์ถ๋ ฅํ๊ณ ์์ด ๊ฐ์ธ์ ๋ณด ์ ์ถ ์ํ์ด ์์ต๋๋ค; ์์ ๋ฐฉ๋ฒ์ Log ํธ์ถ์์ userId๋ฅผ ์ ๊ฑฐํ๊ฑฐ๋
์ต์ํ ๋ง์คํน ์ฒ๋ฆฌํ์ฌ ๋
ธ์ถ์ ์ฐจ๋จํ๋ ๊ฒ์ด๋ฉฐ(์: ๊ตฌํ๋ maskUserId(userId: String): String ์ฌ์ฉ ๋๋ ์๋ก
์ถ๊ฐ), superProps ์กฐ๋ฆฝ๋ถ(๋ณ์ superProps)์ ๋ก๊ทธ ํธ์ถ(Log.d)์์ plain userId ๋์
maskUserId(userId) ๋๋ ์์ ์ ๊ฑฐ๋ ๊ฐ์ผ๋ก ๋์ฒดํ๊ณ ํ
์คํธ ๋ก๊ทธ(๋๋ debug-only ๋น๋)์์๋ ๋์ผ ์ฒ๋ฆฌ๊ฐ ์ ์ฉ๋๋๋ก
์์ ํ์ธ์.
๐ Related issue
closed #<issue_number>
์ด๋ค ๋ณ๊ฒฝ์ฌํญ์ด ์์๋์?
โ CheckPoint
PR์ด ๋ค์ ์๊ตฌ ์ฌํญ์ ์ถฉ์กฑํ๋์ง ํ์ธํ์ธ์.
โ๏ธ Work Description
๐ Uncompleted Tasks
๐ข To Reviewers
๐ RCA ๋ฃฐ
Summary by CodeRabbit
๋ณ๊ฒฝ ์ฌํญ