-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: Allow app developers to override default appConfig template #9550
Conversation
oh this is very handy! Thanks @anilcse! We had to fork the config and server in order to add support for the JSON-RPC. lmk if you need additional reviews. cc: @khoslaventures |
Codecov Report
@@ Coverage Diff @@
## master #9550 +/- ##
==========================================
+ Coverage 60.60% 60.61% +0.01%
==========================================
Files 589 589
Lines 37236 37256 +20
==========================================
+ Hits 22567 22583 +16
- Misses 12726 12730 +4
Partials 1943 1943
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try running the server with the custom config? Usually, that's the part that involves the most changes when adding a custom config. See
You meant for adding a new server? This PR only deals with extra config settings (overriding |
This pull request introduces 1 alert when merging 17db7b4 into 6a5a2de - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 9cd2021 into 6a5a2de - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 7a5a3ad into 304d0ff - view on LGTM.com new alerts:
|
…s-sdk into anil/configurable_appconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. Nice work @anilcse 👍
simapp/simd/cmd/root.go
Outdated
@@ -75,6 +79,43 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { | |||
return rootCmd, encodingConfig | |||
} | |||
|
|||
// initConfig helps to override default appConfig template and settings. | |||
// return; if no custom configuration is required for the application. | |||
func initConfig() (string, interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a few short sentences in the docs about this please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sorry, meant the docs/ directory. I see you added in the doc.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find a relavant place to add it actually. There are no docs explaining server configs. May be I will add a new file or a new section under node
docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated rootCmd
section docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. Would be great to add include this in v0.43
@@ -75,6 +78,45 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { | |||
return rootCmd, encodingConfig | |||
} | |||
|
|||
// initAppConfig helps to override default appConfig template and configs. | |||
// return "", nil if no custom configuration is required for the application. | |||
func initAppConfig() (string, interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anilcse do you think this could be reused to override tendermint config.toml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can do that. I will look into it tomorrow and create a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…smos#9550) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: cosmos#5540 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
Description
Closes: #5540
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change