Add git sync to import_project analytics event#1327
Add git sync to import_project analytics event#1327chiang-daniel wants to merge 2 commits intomainfrom
import_project analytics event#1327Conversation
📝 WalkthroughWalkthroughUI now emits PostHog analytics during the import workflow: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 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.
Code Review
This pull request introduces PostHog analytics tracking for the project import workflow, specifically for Git Auto Sync and local import methods. It adds logic to identify git hosts and captures metadata such as authentication modes. A critical issue was identified where the analytics event in the wizard completion step may capture incorrect data because the underlying store is cleared in a sub-component before the event is triggered. Additionally, a redundant store-clearing call was noted.
📊 Coverage ReportOverall Coverage: 92% Diff: origin/main...HEADNo lines with coverage information in this diff.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/web_ui/src/lib/components/import/step_complete.svelte (1)
38-42: Optional: consider co-locatinggit_host_labelwith the other URL helpers.Since
isGitHubUrl/isGitLabUrlalready live in$lib/git_sync/api.ts, movinggit_host_label(or an equivalentgitHostLabel) there would keep host-classification logic in one place and make it reusable if other analytics call sites need the same"github" | "gitlab" | "other"label (e.g. future git-sync events). No change in behavior required for this PR.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/web_ui/src/lib/components/import/step_complete.svelte` around lines 38 - 42, Move the git_host_label logic into the shared URL helpers file where isGitHubUrl and isGitLabUrl live (e.g., add a new exported function gitHostLabel or export git_host_label from $lib/git_sync/api.ts) so host-classification is colocated; keep the same behavior returning "github" | "gitlab" | "other", export it, and then replace the local git_host_label in step_complete.svelte with an import of the new exported function (update any call sites to use the exported name).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/web_ui/src/lib/components/import/step_complete.svelte`:
- Around line 38-42: Move the git_host_label logic into the shared URL helpers
file where isGitHubUrl and isGitLabUrl live (e.g., add a new exported function
gitHostLabel or export git_host_label from $lib/git_sync/api.ts) so
host-classification is colocated; keep the same behavior returning "github" |
"gitlab" | "other", export it, and then replace the local git_host_label in
step_complete.svelte with an import of the new exported function (update any
call sites to use the exported name).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e64360d4-5720-4323-9457-10010179e0ea
📒 Files selected for processing (2)
app/web_ui/src/lib/components/import/import_project.svelteapp/web_ui/src/lib/components/import/step_complete.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
- app/web_ui/src/lib/components/import/import_project.svelte
What does this PR do?
Add git sync to
import_projectanalytics event which fires on any successful project import. We added git sync specific properties this time.Added 3 new props
Sample:
Verified by adding temp console logs.
Contributor License Agreement
I, @, confirm that I have read and agree to the Contributors License Agreement.
Checklists
Summary by CodeRabbit