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

Hub crash and system information reports using Bugout #624

Merged
merged 3 commits into from
Mar 5, 2021

Conversation

zomglings
Copy link
Contributor

@zomglings zomglings commented Feb 26, 2021

@mynameisvinn , @davidbuniat , @mikayelh : As we discussed, here is a pull request with the code required to collect crash reports and system information from users who opt into reporting.

Consent

Users can currently consent to reporting by running hub consent --allow. This is an opt in process and by default we do not assume consent.

If users have given consent but would like to revoke it, they can run hub consent --disallow.

If users would like to temporarily turn off consent, they can just set the environment variable HUB_REPORTING_ENABLED=0.

Report types

This code currently sends two types of reports:

  1. System reports: These reports are sent every time Hub is imported and contains the user's Python version, CPU architecture, and operating system.
  2. Error reports: These reports are sent every time the user encounters an exception in Hub. The reports include a short summary of the error as well as a complete stack trace.

Improvements

I plan to make some improvements over the weekend:

  1. Include hub version in reports. (I moved the version into hub/__init__.py to make this easier - it's a good practice because it also makes it easier for you to display it with click.
  2. Include pip freeze information in reports.
  3. Allow users to store reports on disk and send you files as a lump sum instead of one at a time. This would be a command like hub reports send -f <report file>

Let me know if you would like any other improvements.

Installation

You can use this branch by running:

pip install git+https://github.com/zomglings/Hub.git@humbug-reporting#egg=hub

Viewing reports

@mynameisvinn and @davidbuniat : You both have accounts at https://bugout.dev and I added you to a knowledge base called Hub exceptions demo where reports will be pushed.

The knowledge base search makes it easy to filter over reports and do things like filter in/out OS, python version, etc. I will show that to you in our meeting next week.

@github-actions
Copy link

Locust summary

Git references

Initial: 1ac80bb
Terminal: dd83ce1

hub/exceptions.py
Changes:
hub/report.py
Changes:
hub/cli/command.py
Changes:
  • Name: add_commands
    Type: function
    Changed lines: 1
    Total lines: 5

    @zomglings
    Copy link
    Contributor Author

    Just added functionality to support reporting with client IDs and session IDs.

    @mynameisvinn mynameisvinn self-requested a review February 26, 2021 19:36
    @mynameisvinn mynameisvinn added the enhancement New feature or request label Feb 26, 2021
    @mynameisvinn
    Copy link
    Contributor

    mynameisvinn commented Feb 26, 2021

    @zomglings Looks like I'm missing a dependency, can you help?

    Screen Shot 2021-02-26 at 2 45 00 PM

    @zomglings
    Copy link
    Contributor Author

    @mynameisvinn : pip install humbug (added to requirements.txt)

    @zomglings
    Copy link
    Contributor Author

    Fixed the install issue with the non-existent import. It was because I was importing all of hub in setup.py to get the version, that wasn't a good idea.

    @mynameisvinn mynameisvinn added the feature-discussion open discussion on feature request label Mar 1, 2021
    @mynameisvinn
    Copy link
    Contributor

    @zomglings mind submitting a PR when you're ready?

    @zomglings
    Copy link
    Contributor Author

    @zomglings mind submitting a PR when you're ready?

    @mynameisvinn : Do you mean I should open a new PR?

    @zomglings zomglings closed this Mar 3, 2021
    @zomglings zomglings reopened this Mar 3, 2021
    @github-actions
    Copy link

    github-actions bot commented Mar 3, 2021

    Locust summary

    Git references

    Initial: e890baf
    Terminal: b37523b

    hub/exceptions.py
    Changes:
    hub/report.py
    Changes:
    hub/cli/auth.py
    Changes:
    • Name: register
      Type: function
      Changed lines: 16
      Total lines: 33
      • Name: reporting
        Type: function
        Changed lines: 8
        Total lines: 8
        • Name: login_fn
          Type: function
          Changed lines: 3
          Total lines: 32
          hub/cli/command.py
          Changes:
          • Name: add_commands
            Type: function
            Changed lines: 1
            Total lines: 6

            @mynameisvinn
            Copy link
            Contributor

            @imshashank mind taking a look before we merge into master for Monday's release?

            @mynameisvinn mynameisvinn merged commit 9568cc5 into activeloopai:master Mar 5, 2021
            Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
            Labels
            enhancement New feature or request feature-discussion open discussion on feature request
            Projects
            None yet
            Development

            Successfully merging this pull request may close these issues.

            2 participants