8000 fix(e2e): viper errors with invalid `config` and `genesis` manifest keys (backport #4016) by cason · Pull Request #4313 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(e2e): viper errors with invalid config and genesis manifest keys (backport #4016) #4313

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

Merged
merged 3 commits into from
Oct 20, 2024

Conversation

cason
Copy link
Contributor
@cason cason commented Oct 20, 2024

Addresses comments #3969 (review) and #3967 (review) on previous PRs.

The solution is in fact simple, as it is possible to tell viper to return an error if one of the configured entries (key/value pairs) were not applied to the destination structure, because they don't exist or are invalid.


This is an manual backport of pull request #4016.

PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

cason and others added 2 commits October 20, 2024 11:20
Closes #3961.

Similarly to #3967, introduces a new `genesis` field for manifest files.
The format is `key = value` and multiple entries can be provided. For
example,

```
genesis = [ 
    "consensus_params.evidence.max_bytes = 1000", 
    "chain_id = pr3969" 
]
```

After the genesis document is produced by the `setup` implementation of
the runner, the provided genesis customized configurations are applied
to the generated genesis file. The solution also uses `viper`, as it
allows setting only some specific keys, leaving the pre-produced content
untouched.

Note: this PR is based atop
#3964 for simplicity, but it
does not need to.

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Andy Nogueira <me@andynogueira.dev>
…eys (#4016)

Addresses comments
#3969 (review)
and
#3967 (review)
on previous PRs.

The solution is in fact simple, as it is possible to tell viper to
return an error if one of the configured entries (key/value pairs) were
not applied to the destination structure, because they don't exist or
are invalid.

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Andy Nogueira <me@andynogueira.dev>
@cason cason requested review from a team as code owners October 20, 2024 09:28
Copy link
Contributor Author
@cason cason left a comment

Choose a reason for hiding this comment

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

Diffs match. But I can't approve this manual backport.

Base automatically changed from cason/pr-3969-manual-backport-v1.x-2 to v1.x October 20, 2024 10:57
@cason cason merged commit df25950 into v1.x Oct 20, 2024
19 checks passed
@cason cason deleted the cason/pr-4016-manual-backport-v1.x branch October 20, 2024 20:55
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.

2 participants
0