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

Fix config validate CLI command to correctly output an error when required #2255

Merged
merged 5 commits into from
Jun 2, 2022

Conversation

ljoss17
Copy link
Contributor

@ljoss17 ljoss17 commented Jun 1, 2022

Closes: #2143

Description

This PR fixes the issue where the command config validate would output a success message if the configuration file was empty or did not exist.

Testing

The following cases correctly output an error message:

  • empty config file
  • missing or misspelled file, e.g. configg.toml
  • unreadable file, e.g. running chmod -r config.toml and then hermes config validate
  • adding an unknown field:
[global]
log_level = 'info'
custom_field = 'test'
...

PR author checklist:

  • Added changelog entry, using unclog.
  • [ ] Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@ljoss17 ljoss17 requested a review from adizere June 2, 2022 08:50
Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Let's just fix the URL and in the change log and then we can merge :)

@ljoss17 ljoss17 merged commit 4397e4f into master Jun 2, 2022
@ljoss17 ljoss17 deleted the luca_joss/config_validate_fix branch June 2, 2022 11:55
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
…equired (informalsystems#2255)

* Improved command 'config validate' to catch non existing and empty configuration file errors

* Added changelog entry for the fix of 'config validate' command.

* Improved verification of empty configuration file.

* Removed unnecessary new line in changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hermes config validate reports success when no config
2 participants