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

Telemetry #247

Closed
wants to merge 6 commits into from
Closed

Telemetry #247

wants to merge 6 commits into from

Conversation

omefire
Copy link
Contributor

@omefire omefire commented May 2, 2016

Here is the related proposal: apache/cordova-discuss#43

@omefire omefire force-pushed the Telemetry branch 4 times, most recently from b3f0bab to 289619c Compare May 8, 2016 21:02
@omefire
Copy link
Contributor Author

omefire commented May 8, 2016

This code relies on the insight package: https://www.npmjs.com/package/insight
However, due to a bug within insight, when the command prompt timeout expires, it won't automatically opt the user out, leading to the prompt being displayed again the next time cordova is run.

I have a patch to fix this issue here:
yeoman/insight#47

Use the patch to test this PR.

@omefire omefire force-pushed the Telemetry branch 2 times, most recently from 2652b45 to 6f0c505 Compare May 9, 2016 18:00
@csantanapr
Copy link
Member

LGTM

@omefire omefire force-pushed the Telemetry branch 3 times, most recently from f24b513 to 0e3c6de Compare May 9, 2016 18:51
@stevengill
Copy link
Contributor

LGTM!!

@omefire omefire force-pushed the Telemetry branch 2 times, most recently from cfb2838 to 5f0f839 Compare May 10, 2016 03:05
cordova-cli telemetry on
cordova-cli telemetry off
cordova-cli build --no-telemetry
Copy link
Contributor

Choose a reason for hiding this comment

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

These examples are not necessarily needed here as they are simple and not common scenarios - it will be nice to keep this output as small as it could be.

@omefire
Copy link
Contributor Author

omefire commented May 10, 2016

Related: apache/cordova-docs#599

@@ -21,7 +23,7 @@ Project Commands
run ................................ Run project
(including prepare && compile)
serve .............................. Run project with a local webserver
(including prepare)
(including prepare)
Copy link
Contributor

Choose a reason for hiding this comment

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

Trailing spaces after (including prepare).

@omefire omefire force-pushed the Telemetry branch 4 times, most recently from 4676c01 to f5133de Compare May 12, 2016 04:51
@omefire
Copy link
Contributor Author

omefire commented May 12, 2016

ping ...

@csantanapr
Copy link
Member

I have one question, maybe I missed it in discussion why is this implemented in CLI and not LIB

I think it make more sense to implement in the top level of API entry points in LIB like create platform plugin etc.

In LIB will be disable by default
CLI will call API with new parameter to enable telemetry
CLI telemetry will
Be enable by default and CLI will offer user a CLI flag and env to disable telemetry

@purplecabbage
Copy link
Contributor

Other CLIs that use lib (as a lib) would not want this code. Off by default is interesting, but I think this is cleaner, and it's done.

On May 12, 2016, at 3:12 AM, Carlos Santana notifications@github.com wrote:

I have one question, maybe I missed it in discussion why is this implemented in CLI and not LIB

I think it make more sense to implement in the top level of API entry points in LIB like create platform plugin etc.

In LIB will be disable by default
CLI will call API with new parameter to enable telemetry
CLI telemetry will
Be enable by default and CLI will offer user a CLI flag and env to disable telemetry


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@@ -5,6 +5,7 @@ Synopsis
Global Commands
create ............................. Create a project
help ............................... Get help for a command
telemetry .......................... Turn telemetry collection on or off
Copy link
Contributor

Choose a reason for hiding this comment

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

The CLI reference docs need an update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I thought it was generated from these files. Anyway, it's been updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

They live in doc/readme.md.

Copy link
Contributor Author

@omefire omefire May 12, 2016

Choose a reason for hiding this comment

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

Yes, I've already updated it and pushed to this PR. thanks.

@omefire
Copy link
Contributor Author

omefire commented May 12, 2016

I have one question, maybe I missed it in discussion why is this implemented in CLI and not LIB

I think it make more sense to implement in the top level of API entry points in LIB like create platform > plugin etc.

In LIB will be disable by default
CLI will call API with new parameter to enable telemetry
CLI telemetry will
Be enable by default and CLI will offer user a CLI flag and env to disable telemetry

I first wanted to go that route, but I then realized doing it in CLI minimizes polluting LIB for a functionality that's not intended to be used by downstream tools. It seems cleaner to handle it here, as mentioned by @purplecabbage

@csantanapr
Copy link
Member

Sounds good to me to proceed then, it was a random idea

@omefire omefire force-pushed the Telemetry branch 2 times, most recently from bb1901e to f4e1298 Compare May 12, 2016 18:12
@nikhilkh
Copy link
Contributor

LGTM

@purplecabbage
Copy link
Contributor

Was there ever a specific Jira issue for adding telemetry? I don't see it.
I think we need to revisit some of the output/prompt formatting, here is what I just saw:

dline2@1.0.1, run-async@0.1.0, lodash@3.10.1)
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
? May Cordova anonymously report usage statistics to improve the tool over time? Yes
(Y/n) Yrdova anonymously report usage
Thanks for opting into telemetry to help us improve cordova.
6.2.1-dev (cordova-lib@6.2.1-dev)
jessem-osx:cordova-cli jessem$

Multiple overlapping lines, could be a bash issue as well.

@nikhilkh
Copy link
Contributor

@omefire Can you please take a look into this?

@omefire
Copy link
Contributor Author

omefire commented May 16, 2016

@purplecabbage, I didn't create a JIRA issue to track the telemetry work, I should have. It was an oversight on my part. My bad.

I've tested this on MAC(El Capitan) and Windows10, but couldn't repro your issue.
What OS are you using ? I suspect this could be an issue with bash. I checked and couldn't find any such issue reported for inquirer, the underlying package that handles this.

@purplecabbage
Copy link
Contributor

I am using windows 10, but I typically use the git-bash shell which may be
why we aren't seeing the same things.

@purplecabbage
risingj.com

On Mon, May 16, 2016 at 10:52 AM, Omar Mefire notifications@github.com
wrote:

@purplecabbage https://github.com/purplecabbage, I didn't create a JIRA
issue to track the telemetry work, I should have. My bad.
I've tested this on MAC(El Capitan) and Windows10, but couldn't repro your
issue.
What OS are you using ? I suspect this could be an issue with bash. I
checked and couldn't find any such issue reported for inquirer, the
underlying package that handles this.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#247 (comment)

@omefire
Copy link
Contributor Author

omefire commented May 16, 2016

@purplecabbage , I can't repro this with git-bash shell on Win10 because I'm running into another issue: nodejs/node#3006

The gist of my issue is that the process is not recognized to be running as TTY, which leads to insight ending the process and opting out:

Furthermore, commenting that code out, leads to yet another error: SBoudrias/Inquirer.js#290

Insight, which we depend on doesn't play well with git-bash/MinGW.

@omefire
Copy link
Contributor Author

omefire commented May 16, 2016

@purplecabbage , could you please file a JIRA issue for what you've encountered ?
I just did the same for the issues I just mentioned: https://issues.apache.org/jira/browse/CB-11276

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.

None yet

5 participants