topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
2.07k stars 141 forks source link

Deno support #973

Closed nkapolcs closed 3 weeks ago

nkapolcs commented 3 weeks ago

Erroneous Behavior

When running topgrade, it fails with a TOML parse error for an unknown field deno in the configuration file. The specific error is:

ERROR Failed to deserialize /home/username/.config/topgrade.toml: TOML parse error at line 226, column 2
    |
226 | [deno]
    |  ^^^^
unknown field `deno`, expected one of `include`, `misc`, `pre_commands`, `post_commands`, `commands`, `python`, `composer`, `brew`, `linux`, `git`, `containers`, `windows`, `npm`, `yarn`, `vim`, `firmware`, `vagrant`, `flatpak`, `distrobox`, `lensfun`

Expected Behavior

The configuration file should either accept the deno configuration section (since Deno is a supported tool that can be upgraded), or provide a clear error message about how to properly configure Deno updates if they are supported through a different configuration section.

Steps to reproduce

  1. I used the example configuration wget "https://raw.githubusercontent.com/topgrade-rs/topgrade/main/config.example.toml" -O "$config_dir/topgrade.toml"
  2. Run topgrade command
  3. Observe the TOML parse error

Possible Cause

The error suggests that while there is recent support for Deno in the codebase (as evidenced by recent commits mentioning Deno features), the configuration parser doesn't yet recognize the deno configuration section as valid.

Problem persists without calling from topgrade

Did you run topgrade through Remote Execution

Configuration file

[deno]

Additional Details

Verbose Output (topgrade -v)

ERROR Failed to deserialize /home/username/.config/topgrade.toml: TOML parse error at line 226, column 2
    |
226 | [deno]
    |  ^^^^
unknown field `deno`, expected one of `include`, `misc`, `pre_commands`, `post_commands`, `commands`, `python`, `composer`, `brew`, `linux`, `git`, `containers`, `windows`, `npm`, `yarn`, `vim`, `firmware`, `vagrant`, `flatpak`, `distrobox`, `lensfun`
SteveLauC commented 3 weeks ago

This entry was added 40 minutes ago in #970, so released Topgrade v16.0.0 knows nothing about it.

Try this config file: https://github.com/topgrade-rs/topgrade/blame/98ec13f8db555a78c483b86c8950da81683201cb/config.example.toml

SteveLauC commented 3 weeks ago

I just recalled that Topgrade has a cli option that will print the example configuration file out, you can use it, the printed file should be exactly right for the Topgrade binary you use.

nkapolcs commented 3 weeks ago

Thanks for the quick response, so it was just an unfortunate timing from my side. If somebody will have the same problem I can recommend to use this command to generate a default config for topgrade:

topgrade --config-reference > ~/.config/topgrade.toml