Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

sendAnonymousCLIMetrics added #139

Conversation

lazywithclass
Copy link
Contributor

Send metrics to the registry as per #138

@iarna iarna self-assigned this May 23, 2016
@iarna
Copy link
Contributor

iarna commented Nov 16, 2016

Finally, FINALLY, we're ready to take this! =D

Copy link
Contributor

@iarna iarna left a comment

Choose a reason for hiding this comment

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

This isn't providing a comparable interface to the other functions and the arguments it passes down the chain to this.request aren't valid.

For purposes of expediency, I'm going to make the needed changes and land this PR.

var assert = require('assert')
var url = require('url')

function send (uri, params, cb) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function should compose its URL on its own (for example how lib/dist-tags/set.js works).


function nop () {}

var URI = 'https://npm.registry:8043/-/npm/anon-metrics/v1/:metricId'
Copy link
Contributor

Choose a reason for hiding this comment

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

:metricId shouldn't be passed in literally, it's supposed to be replaced with the metricId value from the document we're given.

)

params.method = 'PUT'
this.request(uri, params, cb)
Copy link
Contributor

Choose a reason for hiding this comment

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

Params here can't just be passed through to request. What you're passing in the test isn't valid for this.request. Again, see lib/dist-tags/set.js, they would need to be JSON encoded and put into a body property.

@lazywithclass
Copy link
Contributor Author

hehe ok that's good, I'll have a look at the changes requested. If you're going to be faster, I will just compare the results and see how this should've been done. Thanks nonetheless.

iarna pushed a commit that referenced this pull request Nov 17, 2016
Fixes: #138
Credit: @lazywithclass
Credit: @iarna
Reviewed-By: @iarna
PR-URL: #139
@iarna
Copy link
Contributor

iarna commented Nov 17, 2016

Merged as fc7b81b

@iarna iarna closed this Nov 17, 2016
@iarna iarna removed the review label Nov 17, 2016
iarna pushed a commit that referenced this pull request Nov 17, 2016
Fixes: #138
Credit: @lazywithclass
Credit: @iarna
Reviewed-By: @iarna
PR-URL: #139
iarna pushed a commit that referenced this pull request Nov 17, 2016
Fixes: #138
Credit: @lazywithclass
Credit: @iarna
Reviewed-By: @iarna
PR-URL: #139
iarna added a commit to npm/npm that referenced this pull request Dec 9, 2016
Fix a bug in fetch where errors on the request object that came after the
response object had been emitted could result in duplicate callbacks and
suppressed error conditions.  Ultimately this translates to fixing shasum
mismatches in `npm` when they were associated with an `ECONNRESET` or other
network error.

PR-URL: npm/npm-registry-client#139
Fixes: #14626
Credit: @iarna

Add support for sending anonymous cli metrics.

PR-URL: npm/npm-registry-client#148

Fix support for sending anonymous cli metrics.

Credit: @sisidovski
PR-URL: npm/npm-registry-client#147
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants