Conversation
Emit a new PostHog event when Ask GH requests a repo index via POST /api/experimental/add-github-repo. The event includes: - owner: GitHub repo owner - repo: GitHub repo name - repoName: Combined owner/repo string - isAnonymous: Whether the requester is authenticated - anonymousCreatorId: Anonymous session ID (when anonymous) - repoId: Created repo ID This enables tracking who requested indexing of repos through Ask GH. Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Remove identity properties (isAnonymous, anonymousCreatorId, userId, email) since PostHog's built-in distinct_id from captureEvent already handles requester identification. Keep only repo fields: owner, repo, repoName, repoId. Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new PostHog event (
askgh_repo_index_requested) that fires when Ask GH requests that a repo be indexed through thePOST /api/experimental/add-github-repoendpoint.Problem
On the public app (app.sourcebot.dev), repos can be indexed via Ask GH but there was no PostHog event that attributes who requested the index. We couldn't answer "who requested indexing of torvalds/linux?"
Solution
Emit a PostHog event at the moment an Ask GH index is requested, with properties that identify the requester.
Event Name
askgh_repo_index_requestedProperties
ownerreporepoNameowner/repostring for easy filteringisAnonymousanonymousCreatorIdisAnonymousis true)repoIdQuerying in PostHog
Find all index requests for a specific repo:
Find all anonymous vs signed-in requests:
Find requests by anonymous session:
Where it fires
packages/web/src/features/workerApi/actions.ts- in theaddGithubReposerver action, after the backend successfully processes the repo index request.Testing
captureEventhelper with proper user identity handlinganonymousCreatorId(same session cookie used for anonymous chat ownership)Summary by cubic
Tracks successful Ask GH repo index requests in PostHog so we can attribute who requested indexing.
askgh_repo_index_requestedafter the index request is processed, capturingowner,repo,repoName, andrepoId.captureEvent, so no custom identity properties are tracked.Written for commit a86cf5b. Summary will update on new commits.