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

Syntactic validation of configuration file #1128

Merged
merged 9 commits into from
Jun 28, 2021
Merged

Syntactic validation of configuration file #1128

merged 9 commits into from
Jun 28, 2021

Conversation

adizere
Copy link
Member

@adizere adizere commented Jun 24, 2021

Closes: #600

Description

  • config validation upon startup for any command
  • added new CLI hermes config validate which yield a small diagnostic in case a syntactic error is found in the config file

Validation handled:

  • log_level field
  • error signalled if no chain is specified for command start
  • duplicate chain id specified
  • prevent unknown fields in the configuration

For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@ancazamfir
Copy link
Collaborator

Should we check also that all options included in the config file are supported by the current version? And issue at least a warning? Right now they are ignored.

@adizere adizere requested review from romac and ancazamfir June 28, 2021 14:40
@adizere adizere merged commit 5b87df7 into master Jun 28, 2021
@adizere adizere deleted the adi/600_cfg branch June 28, 2021 16:00
@romac romac mentioned this pull request Jun 28, 2021
9 tasks
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Config validation

* Reorganized a bit; using Result

* Serialization via serde + enum for log levels

* Avoid throwing ZeroChains error except for start command

* Apply suggestions from code review

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Added deny_unknown_fields serde attribute.

* changelog

* Fix comment

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
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.

Config validation
3 participants