Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

[result] Result message should be in consistent format #128

Open
esunar opened this issue Oct 24, 2022 · 1 comment
Open

[result] Result message should be in consistent format #128

esunar opened this issue Oct 24, 2022 · 1 comment

Comments

@esunar
Copy link
Contributor

esunar commented Oct 24, 2022

We should standardize the format of the results messages of checks,
as some use different format, what cause output to be little bit
confusing.

A good example are results from checking the nova-compute unit.

$ juju-verify reboot --unit nova-compute/0
Checks:
[OK] check_affected_machines check passed
[OK] check_has_sub_machines check passed
[OK] Unit nova-compute/0 is running 0 VMs.
[OK] Empty Availability Zone check passed.

Overall result: OK (All checks passed)

There are three types of messages:

  1. " check passed"
  2. custom message without mentioning which check it comes
    from (although this is obvious)
  3. " check passed"

I think it should be standardized and mentioned in the contribution.


Imported from Launchpad using lp2gh.

  • date created: 2021-10-21T15:23:45Z

  • owner: rgildein

  • assignee: None

  • the launchpad url

@esunar
Copy link
Contributor Author

esunar commented Oct 24, 2022

(by martin-kalcok)
This is a good point, the output should be consistent.

In my opinion, adding whether the check passed or failed as part of the message body is superfluous, as the message is already pre-faced with [OK], [WARN] or [FAIL].

I also don't think that using underscores in output intended for humans is desired.

I think that good message format should contain:

  • Clear indication of pass/fail
  • Which unit/app/machine is the message related to. (This one is tricky, as not all checks have same scope. Some are per-unit, some are application wide and some are concerned with the machine)
  • Human readable check name
  • Optional additional info. I think that additional info is really only needed in case of failure, checks that pass do not need to burden user with info about why they passed.

What do you think about following format?

[][<unit_or_app_name>] -

Example:
[OK] [Machine 0] Check Affected Machines
[OK] [nova-compute] Availability Zone check
[FAIL] [nova-compute/0] Running VMs check - Unit has 2 running VMs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant