If a user has authenticated, pass their username along with metrics requests to the back end.
Implementation
The StatsStore is instantiated in the atom metrics package. metrics doesn't know what the GitHub username is, nor should it. The GitHub package is the only package where this info is available. Therefore, the StatsStore needs to have a method exposed to set the gitHubUser. If the GitHub username has been set, that value is then passed along when daily metrics are sent to the internal analytics pipeline. If the gitHubUser has not been set, a null value is passed along instead.
Test plan
[x] did a cURL request against a locally running version of central, to verify that requests containing a gitHubUser with a null value, and a gitHubUser with a string value both work.
[x] unit tests to verify that if the gitHubUser value is set, it is included with the daily stats. If it is not set, a null value is included instead.
Future work
bump telemetry version in metrics package. Expose a method for setting the gitHubUser via service interface. Clarify documentation and user facing copy to indicate that the gitHubUser is being sent with metrics requests now, and link to instructions on how to opt out of metrics reporting if they want.
bump metrics version in Atom core.
make the GitHub package set the gitHubUser, if the user has authenticated. Tweak user facing copy so users know their gitHubUser ID is being sent with metrics requests, and link to instructions for how to opt out of metrics reporting if they want.
Description of the Change
If a user has authenticated, pass their username along with metrics requests to the back end.
Implementation
The
StatsStore
is instantiated in the atommetrics
package.metrics
doesn't know what the GitHub username is, nor should it. The GitHub package is the only package where this info is available. Therefore, theStatsStore
needs to have a method exposed to set the gitHubUser. If the GitHub username has been set, that value is then passed along when daily metrics are sent to the internal analytics pipeline. If the gitHubUser has not been set, a null value is passed along instead.Test plan
central
, to verify that requests containing a gitHubUser with a null value, and a gitHubUser with a string value both work.gitHubUser
value is set, it is included with the daily stats. If it is not set, a null value is included instead.Future work
telemetry
version in metrics package. Expose a method for setting the gitHubUser via service interface. Clarify documentation and user facing copy to indicate that the gitHubUser is being sent with metrics requests now, and link to instructions on how to opt out of metrics reporting if they want.metrics
version in Atom core.