Skip to content

Conversation

rlmestre
Copy link
Contributor

@rlmestre rlmestre commented Aug 12, 2025

Closes neverendingsupport/data-and-integrations#218

@rlmestre rlmestre requested a review from a team as a code owner August 12, 2025 14:46
@rlmestre rlmestre requested a review from Copilot August 12, 2025 14:47
Copy link

@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 adds analytics tracking functionality to the CLI tool to capture usage metrics and scan data. The analytics system uses Amplitude for tracking user sessions, scan operations, and error events while respecting opt-out preferences.

Key changes include:

  • Implementation of comprehensive analytics service with session tracking and device identification
  • Integration of analytics tracking throughout the scan workflow including SBOM generation, EOL scanning, and file operations
  • Enhanced display service to extract ecosystem information from package URLs for analytics

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/service/analytics.svc.ts New analytics service with Amplitude integration, session management, and environment detection
src/hooks/prerun.ts Added analytics initialization and session start tracking
src/hooks/finally.ts Added session end tracking with cleanup spinner
src/commands/scan/eol.ts Integrated analytics tracking throughout scan workflow with performance metrics
src/service/display.svc.ts Enhanced component counting to include ecosystem extraction and totals
src/config/constants.ts Added analytics URL configuration
test/service/display.svc.test.ts Updated tests for enhanced component counting functionality
package.json Added analytics dependencies and finally hook registration
.envrc.example Added analytics URL environment variable example
Comments suppressed due to low confidence (1)

src/hooks/finally.ts:10

  • The promise chain may not properly handle errors, and the spinner.stop() call could execute before the analytics event is fully sent, potentially causing data loss.
  })).promise.then(() => spinner.stop());

@rlmestre rlmestre merged commit 05fe08d into main Aug 15, 2025
23 of 24 checks passed
@rlmestre rlmestre deleted the analytics branch August 15, 2025 15:21
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.

4 participants