chalk loaded a valid config and then on reloading the same config but with an invalid line, the validation will passed without error, but then any further actions with that chalk binary will fail immediately because of the invalid config (including trying to load another config or get back to default)
Impact
we can't reload updated configs since validation is wonky, or if we do try a reload then chalk is broken forever after
Steps to Reproduce
build chalk (from main)
load some valid config, ex one of the standard ones:
liming@system76-pc:~/workspace/chalk$ ./chalk load ./configs/embed_sboms.c4m
info: Invalid chalk mark in autocompletion script. Updating.
info: Installed bash auto-completion file to: /home/liming/.local/share/bash_completion/completions/chalk.bash
info: Attempting to load module from: ./configs/embed_sboms.c4m
Configuring Component: /home/liming/workspace/chalk/configs/embed_sboms
Finished configuration for /home/liming/workspace/chalk/configs/embed_sboms
info: [testing config]: Validating configuration.
info: [testing config]: Configuration successfully validated.
info: Configuration replaced in binary: /home/liming/workspace/chalk/chalk
info: /home/liming/.local/chalk/chalk.log: Open (sink conf='default_out')
info: Full chalk report appended to: ~/.local/chalk/chalk.log
and observe validation passes
add the following invalid line to the above config: log_level = debug
reload the same config and see that validation passes again:
liming@system76-pc:~/workspace/chalk$ ./chalk load ./configs/embed_sboms.c4m
info: Invalid chalk mark in autocompletion script. Updating.
info: Installed bash auto-completion file to: /home/liming/.local/share/bash_completion/completions/chalk.bash
info: Attempting to load module from: ./configs/embed_sboms.c4m
Configuring Component: /home/liming/workspace/chalk/configs/embed_sboms
Finished configuration for /home/liming/workspace/chalk/configs/embed_sboms
info: [testing config]: Validating configuration.
info: [testing config]: Configuration successfully validated.
info: Configuration replaced in binary: /home/liming/workspace/chalk/chalk
info: /home/liming/.local/chalk/chalk.log: Open (sink conf='default_out')
info: Full chalk report appended to: ~/.local/chalk/chalk.log
any further chalk actions result in error:
liming@system76-pc:~/workspace/chalk$ ./chalk insert ls-test
error: chalk: [embedded config]: 10:13:
Variable debug used before definition
log_level = debug
^
error: Could not load configuration files. exiting.
liming@system76-pc:~/workspace/chalk$ ./chalk load default
error: chalk: [embedded config]: 10:13:
Variable debug used before definition
log_level = debug
^
error: Could not load configuration files. exiting.
Description
chalk loaded a valid config and then on reloading the same config but with an invalid line, the validation will passed without error, but then any further actions with that chalk binary will fail immediately because of the invalid config (including trying to load another config or get back to default)
Impact
we can't reload updated configs since validation is wonky, or if we do try a reload then chalk is broken forever after
Steps to Reproduce
load some valid config, ex one of the standard ones:
and observe validation passes
log_level = debug
reload the same config and see that validation passes again:
Other Information