-
Notifications
You must be signed in to change notification settings - Fork 143
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
If unknown config values are present, configuration is silently not loaded #580
Comments
#581 should resolve this, the root cause of this issue is that our logger will ONLY be initialized after loading the configuration file, so you won't see any error logs until the loading is done, and the error that should be given under the case of this issue is just about the config file loading, so you got nothing Tested on my host: [misc]
ssume_yes = true
$ ./target/debug/topgrade --dry-run --only system
ERROR Failed to deserialize /home/steve/.config/topgrade/topgrade.toml: unknown field `ssume_yes`, expected one of `pre_sudo`, `sudo_command`, `git_repos`, `predefined_git_repos`, `disable`, `ignore_failures`, `remote_topgrades`, `remote_topgrade_path`, `ssh_arguments`, `git_arguments`, `tmux_arguments`, `set_title`, `display_time`, `assume_yes`, `yay_arguments`, `aura_aur_arguments`, `aura_pacman_arguments`, `no_retry`, `run_in_tmux`, `cleanup`, `notify_each_step`, `accept_all_windows_updates`, `skip_notify`, `bashit_branch`, `only`, `no_self_update`, `log_filters` for key `misc` at line 6 column 1
── 11:17:24 - System update ────────────────────────────────────────────────────
Dry running: /usr/bin/sudo /usr/bin/dnf upgrade
── 11:17:24 - Summary ──────────────────────────────────────────────────────────
System update: OK |
I will release a new version of Topgrade recently, but if you don't want to wait for it, you can build the latest git version from the source instead. One thing to note is that we will have a breaking change in this release, your [git]
max_concurrency = 4
# Arguments to pass Git when pulling Repositories
pull_arguments = "--prune" as Topgrade now can push and pull git repos BTW, thanks for this detailed bug report! |
and thanks for addressing this! cheers. |
Erroneous Behavior
Topgrade ignored my configuration, and proceeded to run steps I had disabled.
Using this configuration:
The latest topgrade outputs this:
Expected Behavior
I expected topgrade to error out, saying my configuration was incorrect. I don't want it to be unable to load configuration, and then suddenly run steps I'd explicitly told it not to.
Even if in this case that resulted in an error, it's unsettling behavior.
Steps to reproduce
Add an unknown configuration option to your config. For example, use this configuration:
Make sure to disable a step that would normally run on your system.
Run topgrade. Observe that the disabled step is no longer disabled.
Possible Cause (Optional)
I expect that topgrade is ignoring all errors loading the config, rather than only ignoring errors that occur because the config file isn't present?
Problem persists without calling from topgrade
Did you run topgrade through
Remote Execution
Configuration file (Optional)
Additional Details
Operation System/Version: Ubuntu 22.04
Installation: built from repo
Topgrade version (
topgrade -V
):12.0.2
(git 6b871e7)Verbose Output (
topgrade -v
)The text was updated successfully, but these errors were encountered: