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

Add app/version useragent for tracking clients in runtime #814

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

purplecabbage
Copy link
Member

@purplecabbage purplecabbage commented Oct 8, 2024

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (32fdd10) to head (cff72bc).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #814   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           57        57           
  Lines         3323      3324    +1     
  Branches       641       641           
=========================================
+ Hits          3323      3324    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -42,6 +42,7 @@ class BaseCommand extends Command {
await super.init()
// setup a prompt that outputs to stderr
this.prompt = inquirer.createPromptModule({ output: process.stderr })
process.env.__OW_USER_AGENT = 'aio-cli-plugin-app@' + require('../package.json').version
Copy link
Member

@shazron shazron Oct 9, 2024

Choose a reason for hiding this comment

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

just a reviewer note: even though it's not documented in oclif, the command's init function is always called before a run is called: https://github.com/oclif/core/blob/68110ee2a4839f0b3ab299ae775d3af1f0c107bc/src/command.ts#L359

If we want to add more details (behave similar like a browser user agent), we can get it from .config.versionDetails() (but this is not documented): https://github.com/oclif/core/blob/68110ee2a4839f0b3ab299ae775d3af1f0c107bc/src/config/config.ts#L187

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.

2 participants