Skip to content

Comments

chore(worker): add PostHog events for repo index sync jobs#878

Merged
brendan-kellam merged 1 commit intomainfrom
brendan-kellam/add-posthog-events-repo-index-sync
Feb 11, 2026
Merged

chore(worker): add PostHog events for repo index sync jobs#878
brendan-kellam merged 1 commit intomainfrom
brendan-kellam/add-posthog-events-repo-index-sync

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Feb 11, 2026

Summary

  • Add new PostHog events to track repo index job success and failure (backend_repo_index_job_completed, backend_repo_index_job_failed)
  • Add code host type field to existing connection sync events (backend_connection_sync_job_completed, backend_connection_sync_job_failed)

Test plan

  • Verify backend builds successfully
  • Test that events are captured when repo index jobs complete/fail
  • Test that events are captured when connection sync jobs complete/fail

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced repository indexing telemetry with new events tracking job completion and failure status, including job type and repository identifiers
    • Improved connection synchronization telemetry to include code host type information
    • Updated telemetry event definitions for more accurate monitoring

@github-actions

This comment has been minimized.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

The PR adds PostHog telemetry events for repository index job completion and failure, and includes code host type information in connection sync job events. It modifies event type definitions, updates connection sync handlers to capture and emit connection type, and adds event emissions to repo index job lifecycle methods.

Changes

Cohort / File(s) Summary
Event Type Definitions
packages/backend/src/posthogEvents.ts
Removed repo_created and repo_deleted events; updated backend_connection_sync_job_failed and backend_connection_sync_job_completed to include type: string; added new events backend_repo_index_job_completed and backend_repo_index_job_failed with repoId, jobType, and type fields.
Connection Sync Telemetry
packages/backend/src/connectionManager.ts
Updated Prisma select statements to include connection object in update results; extracts connection config and includes type field in backend_connection_sync_job_completed and backend_connection_sync_job_failed telemetry events.
Repo Index Telemetry
packages/backend/src/repoIndexManager.ts
Added telemetry event emissions on job completion (backend_repo_index_job_completed) and failure (backend_repo_index_job_failed) with repoId, jobType, and type fields sourced from job data.
Changelog
CHANGELOG.md
Added release note documenting new PostHog events for repo index job success/failure and code host type in connection sync events.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title focuses on 'repo index sync jobs' but the changeset adds events for both repo index jobs AND connection sync jobs, making it incomplete and partially misleading. Update title to reflect both changes: 'chore(worker): add PostHog events for repo index and connection sync jobs' to accurately represent all modifications in the changeset.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 brendan-kellam/add-posthog-events-repo-index-sync

No actionable comments were generated in the recent review. 🎉


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.

Add new PostHog events to track repo index job success and failure:
- backend_repo_index_job_completed
- backend_repo_index_job_failed

Also add code host type to existing connection sync events.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@brendan-kellam brendan-kellam force-pushed the brendan-kellam/add-posthog-events-repo-index-sync branch from e55c7d9 to 95c4568 Compare February 11, 2026 23:07
@brendan-kellam brendan-kellam changed the title feat(backend): add PostHog events for repo index sync jobs chore(worker): add PostHog events for repo index sync jobs Feb 11, 2026
@brendan-kellam brendan-kellam merged commit bea4290 into main Feb 11, 2026
10 checks passed
@brendan-kellam brendan-kellam deleted the brendan-kellam/add-posthog-events-repo-index-sync branch February 11, 2026 23:17
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.

1 participant