Skip to content
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

Deno support #973

Closed
2 tasks done
nkapolcs opened this issue Oct 29, 2024 · 3 comments
Closed
2 tasks done

Deno support #973

nkapolcs opened this issue Oct 29, 2024 · 3 comments
Labels
C-bug Something isn't working

Comments

@nkapolcs
Copy link

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

  • No

Did you run topgrade through Remote Execution

  • No

Configuration file

[deno]

Additional Details

  • Operation System/Version
    • Linux
  • Installation
    • cargo install topgrade
  • Topgrade version (topgrade -V)
    • topgrade v16.0.1

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`
@nkapolcs nkapolcs added the C-bug Something isn't working label Oct 29, 2024
@SteveLauC
Copy link
Member

SteveLauC commented Oct 29, 2024

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
Copy link
Member

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants