Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Add optional PostHog analytics client #8020

Merged
merged 21 commits into from
Mar 2, 2024

Conversation

matthiaslehnertum
Copy link
Contributor

@matthiaslehnertum matthiaslehnertum commented Feb 11, 2024

This Pull request adds analytics via PostHog to Artemis.

Checklist

General

  • I tested all changes and their related features with all corresponding user types on a test server.
  • This is a small issue that I tested locally and was confirmed by another developer on a test server.
  • I chose a title conforming to the naming conventions for pull requests.

Client

Motivation and Context

PostHog was added as an anlytics solution to generate more insights into how our users are using the platform and how we can support their workflows even further.

Description

The integration is done via an @Injectible similar to how our sentry error handler is implemented. The injectible is loaded in the

Steps for Testing

  1. Log in to Artemis
  2. Navigate to a few pages
  3. Go to https://analytics.artemis.cit.tum.de and login
  4. Verify that the pages you visited in Artemis are tracked properly

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Summary by CodeRabbit

  • New Features
    • Integrated PostHog analytics to enhance tracking capabilities within the app, utilizing user profile information for personalized analytics setup.

@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. labels Feb 11, 2024
@matthiaslehnertum matthiaslehnertum changed the title Add PostHog analytics setup Development: Add PostHog analytics setup Feb 12, 2024
@matthiaslehnertum matthiaslehnertum changed the title Development: Add PostHog analytics setup Development: Add PostHog client Feb 12, 2024
@matthiaslehnertum matthiaslehnertum marked this pull request as ready for review February 14, 2024 21:59
@matthiaslehnertum matthiaslehnertum requested a review from a team as a code owner February 14, 2024 21:59
Copy link

coderabbitai bot commented Feb 14, 2024

Walkthrough

The updates introduce an AnalyticsService for initializing PostHog analytics with user profile information across the application. This is achieved by creating a new service in Angular for PostHog setup, integrating this service within the main component for analytics handling, and modifying the ProfileService to support PostHog configuration. These changes collectively enhance the application's analytics capabilities by leveraging PostHog for tracking based on user profile data.

Changes

File Path Change Summary
.../core/posthog/analytics.service.ts Introduced AnalyticsService for PostHog analytics setup with user profile information.
.../layouts/main/main.component.ts Integrated AnalyticsService for analytics setup using profileService data.
.../layouts/profiles/profile.service.ts Added support for PostHog configuration in ProfileService by assigning data['post-hog'] to profileInfo.postHog.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Feb 14, 2024
package.json Outdated Show resolved Hide resolved
src/main/resources/config/application.yml Outdated Show resolved Hide resolved
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test6 labels Feb 24, 2024
@matthiaslehnertum matthiaslehnertum added deploy:artemis-staging and removed deployment-error Added by deployment workflows if an error occured labels Feb 24, 2024
Copy link
Contributor

@rstief rstief left a comment

Choose a reason for hiding this comment

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

Code looks good :)

@krusche krusche added this to the 6.9.0 milestone Mar 2, 2024
@krusche krusche merged commit 17a3273 into develop Mar 2, 2024
23 of 30 checks passed
@krusche krusche deleted the feature/posthog-analytics branch March 2, 2024 08:55
@krusche krusche changed the title Development: Add PostHog client Development: Add optional PostHog analytics client Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. cypress Pull requests that update cypress tests. (Added Automatically!) tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants