Here's a reboot on the project doctor work. This is based on #157 and should be reviewed after that.
With some tweaks to the built-in conditions we could merge this as-is, but there are a few things I'd like to address:
Example
Uncomfortable Things
Extract the two defined conditions into working examples. I found it really difficult to parameterize for container running checks, but if we go with the sync container name in the outrigger.example.yml it will work fine.
Future Enhancements
Add a rig project sync:name command to supply the sync volume and sync container name.
Whether as rig commands or as gotemplate macros, it's really tricky to script good checks for whether container is running. I'd like to facilitate that so projects can add checks that their required services are live.
Integrate with a future rig project sync:doctor command which verifies the health of the sync process. (I'm planning to tackle that to split the current checking rig project sync does as part of setup into a separately callable API method and command.)
Concurrently execution doctor checks. This requires some stuff:
Addressing timeouts
Not outputting the results of the condition execution even in verbose mode as interleaving will be too confusing.
Potentially adding something like rig project doctor --analyze=conditionId to support testing that a condition behaves in isolation.
[ ] Rebase onto changes in the Project Scripts API branch
[ ] See if we can merge more of the Condition struct particulars into the Script object. E.g., generalized forms of Diagnosis, Prescription, and Severity.
This will allow simplifying the code in project_doctor a little and move more handling to project_script.go
Secondarily, it will allow project scripts to be configured to have a success-but-warning mode, and have error and corrective messages for better user communication about next steps.
Third, while the naming conventions are "cute", standardizing naming might be more consistent & learnable.
Doing this will probably require a Condition struct to alias or shadow the Script struct
Here's a reboot on the project doctor work. This is based on #157 and should be reviewed after that.
With some tweaks to the built-in conditions we could merge this as-is, but there are a few things I'd like to address:
Example
Uncomfortable Things
Future Enhancements
rig project sync:name
command to supply the sync volume and sync container name.rig project sync:doctor
command which verifies the health of the sync process. (I'm planning to tackle that to split the current checking rig project sync does as part of setup into a separately callable API method and command.)rig project doctor --analyze=conditionId
to support testing that a condition behaves in isolation.