-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Metric collection and reporting functionality for Bundler #7298
Conversation
This data was very sensitive. I think it's enabled only |
@hsbt what data would you say is sensitive aside from the data we hash? |
The all of software versions are sensitive for the production system. |
@hsbt any specific ones? some metrics such as If there are some specific metrics you think would hurt users' privacy maybe we can remove them or make them I think we may get very few metrics if we make |
Ah, I see. I have another concern. Why @indirect Should we publish the new privacy policy for user's system metrics and its usage? I have concerns that this feature is flooded in Ruby users. |
This data takes a lot of parsing when its reported by the |
@Akrabut Do not open the new pull-request. We should keep the discussion and track code changes. |
@hsbt Sorry, rebased this instead. |
c20387f
to
a362281
Compare
This is as far as I could get with the tests I think. |
I suggest using The ultimate problem might not be in your changes and lie in RVM, but it seems clear that your changes are at least uncovering it, because the CI on the master branch is consistently green. |
9b5333c
to
3151d38
Compare
The problem is I cant manage to have RVM properly function on either of my systems even if I completely uninstall and delete all remanents of rbenv/chruby. I'll try to reproduce locally on another system that has only RVM installed and I'll report. |
This reverts commit ac282dc. Because the filter is actually used once: https://github.com/bundler/bundler/blob/3ec8165eec0a1af8c45ee258d3e7cb61fba875a2/spec/update/git_spec.rb#L162 My bad.
…ted metrics_spec.rb
…tor bug in another PR
… if a connection has already been made we can use it to avoid creating a new one
…s tests with Travis
…now rescues for it
… metrics as YAML instead of JSON to avoid requiring JSON
ebd201f
to
96ade20
Compare
… its possible and into CLI#run, so that it appears twice instead of six times
…on rvm --version command which fails tests that do not expect errors.
# this results in test failures in tests which don't expect errors. | ||
# the command DOES run successfully! | ||
# begin | ||
# rvm_ver = `rvm --version` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue lied here.
After setting up RVM on a gitpod.io system, running any RVM command ran the command successfully, and also echoed:
Warning! PATH is not properly set up, /workspace/.rvm/bin is not at first place.
Usually this is caused by shell initialization files. Search for PATH=... entries.
You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
To fix it temporarily in this shell session run: rvm use .rvm
To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
This is what caused the tests to fail.
The way I see this, we either:
- Dont collect user RVM version, or:
- We change all the failing tests to accept this warning.
I've commented out the rvm version collecting and the build is finally green!
…ics.yml file if file is larger than 100 MB and fix a failing test
This work has been done as part of Google Summer of Code 2019
This is a metric reporting system for Bundler, the backend API that will collect and instrument some of the metrics in rubygems.org is here
This PR is for the the purpose of getting feedback (and the metrics are still being sent to localhost for testing purposes).
This project has been mentored by @indirect
Added functionality:
Metrics collection:
For all commands- the following are appended into ~/.bundle/metrics.yml:
Command used
Options if specified
Time taken to fully execute for commands that don't kill Bundler
Time taken to start executing for commands that do
Timestamp
For install/outdated/package/update/pristine- record the following system info and send it to the server, along with all the metrics collected so far in metrics.yml, then truncate the file:
The prior, and-
A randomized hex ID
Remote git repository (hashed)
git version
rvm version
rbenv version
chruby version
Host system details
Ruby version
Bundler version
Rubygems version
Ruby engine
CI’s
Extra user agent strings
Gemfile gem count
Actually installed gem count
git gem count
Path gem count
Gem source count
List of gem sources (hashed)
When gems are downloaded- also appends:
Gem download time
When gems are installed- also appends:
Gem installation time
When a gemfile is resolved- also appends:
Gemfile resolve time.
When an installation fails- appends the regular command metrics, and:
Name and version of the gem that failed to install
Opt out and in to metric collection
Opt out:
bundle config set disable_metrics true
allows the user to opt out of metrics collectionDeletes the metrics.yml file and doesn't collect any farther metrics.
Also skips all added metric functionality when running Bundler.
Opt in:
bundle config set disable_metrics false
allows the user to opt back in to metric collection.Default:
When no
disable_metrics
value is found in the global config file (or the file doesn't exist), Bundler behaves as ifdisable_metrics
is false.All added functionality has passed (including the added tests) the tests locally on my system.