oscope-dev / scope

Scoping user machines
https://oscope-dev.github.io/scope/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Product a report from `scope doctor run` #108

Closed noizwaves closed 6 months ago

noizwaves commented 6 months ago

Now that scope doctor run output is dynamic, running the output through scope logs analyze requires some flags. It'd be great if a report could just be created if doctor run fails.

This PR will introduce that behavior:

When scope doctor run fails and a report location is present, a report will be generated and distributed.

The biggest changes here are:

Testing

Tested this manually by using an always failing check and a test GitHub repo report location.

A report location

After running bin/scope doctor run --only always-fail, this output was produced:

❯ bin/scope doctor run --only always-fail
ERROR Check failed, fix ran and failed, group: "always-fail", name: "exit 1"
Summary: 0 groups succeeded, 1 groups failed

> Do you want to upload a bug report? Yes
 INFO Report was uploaded to https://github.com/Gusto/gusto_scope_testing/issues/7.

and this report was created: Screenshot 2024-04-11 at 4 36 37 PM

No report location

❯ bin/scope doctor run --only always-fail
ERROR Check failed, fix ran and failed, group: "always-fail", name: "exit 1"
Summary: 0 groups succeeded, 1 groups failed