Conversation
There was a problem hiding this comment.
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());
KLongmuirHD
reviewed
Aug 13, 2025
KLongmuirHD
reviewed
Aug 13, 2025
KLongmuirHD
reviewed
Aug 13, 2025
KLongmuirHD
approved these changes
Aug 14, 2025
sunshastry
approved these changes
Aug 15, 2025
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.
Closes neverendingsupport/data-and-integrations#218