Skip to content

Conversation

pan93412
Copy link
Member

@pan93412 pan93412 commented Oct 6, 2025

  • feat: send events to PostHog
  • test: update test for new EventService signature
  • fix(server): inject PostHogClient
  • feat(events): send point grant event to PostHog
  • test(events): fix tests

@pan93412 pan93412 self-assigned this Oct 6, 2025
Copy link

linear bot commented Oct 6, 2025

@pan93412 pan93412 requested a review from Copilot October 6, 2025 13:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces PostHog analytics integration to the backend system, enabling event tracking and analytics data collection. The changes add PostHog as a dependency and update the event handling system to send events to PostHog alongside existing database operations.

Key changes:

  • Added PostHog client configuration and initialization
  • Updated EventService and PointsGranter to accept PostHog client
  • Implemented event sending to PostHog for user actions and point grants

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.mod Added posthog-go dependency
internal/config/models.go Added PostHog configuration structure with validation
docs/config.md Added PostHog configuration documentation
cmd/backend/dependencies.go Added PostHog client initialization and lifecycle management
cmd/backend/server.go Registered PostHog client in dependency injection
internal/events/events.go Updated EventService to send events to PostHog
internal/events/points.go Updated PointsGranter to send point grant events to PostHog
Multiple test files Updated test constructors to pass nil PostHog client

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pan93412 pan93412 requested a review from Copilot October 6, 2025 13:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pan93412 pan93412 requested a review from Copilot October 6, 2025 13:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pan93412 pan93412 merged commit d8edd37 into main Oct 6, 2025
1 check passed
@pan93412 pan93412 deleted the pan93412/dbp-91-在後端導入-posthog branch October 6, 2025 13:58
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