Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR stacks on #16163
The Problem
There should only be one way to load json files to construct a value of type
Runtime_config.t
, we have several:Mina_cli_entrypoint
checks system directories for an installed config file, other places do notMina_cli_entrypoint
logs verbosely where it finds certain values that belong thedaemon
object. This requires special handling to load these values only to gain adebug
log -- we don't do this for any other fields or in any other CLI context, and would require more complicated handling. The fact that the~keyname
arguments for the logger are not derived from the value means they can drift.Mina_cli_entrypoint
will also attempt to write configuration as it is reading it. This addition was made something like 4 years ago. Rather than attempting to modify configuration on a users file system, at this point it seems wiser to just throw a parse exception.The solution
Runtime_config.Json_loader
to handle allRuntime_config
loading logic, use this in all executables.daemon
field values as we do for everything elseupdate_config
function that writes a json as it is loading.