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:
to expose more methods on ReportBuilder, enabling a report to be "built up" progressively
update DefaultDoctorActionRun.run_action to accept a ReportBuilder, which is built up incrementally with each check and fix output
make the report title an explicit argument when the report is created
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.
❯ 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
Now that
scope doctor run
output is dynamic, running the output throughscope logs analyze
requires some flags. It'd be great if a report could just be created ifdoctor run
fails.This PR will introduce that behavior:
The biggest changes here are:
ReportBuilder
, enabling a report to be "built up" progressivelyDefaultDoctorActionRun.run_action
to accept a ReportBuilder, which is built up incrementally with each check and fix outputTesting
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:and this report was created:
No report location