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

feat(manager): support mise backends #33113

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

risu729
Copy link
Contributor

@risu729 risu729 commented Dec 14, 2024

Changes

Supports mise backends.
https://mise.jdx.dev/dev-tools/backends/

  • core
  • asdf
  • aqua
  • cargo
  • dotnet
  • gem
  • go
  • npm
  • pipx
  • spm
  • ubi
  • vfox

Questions

Default Registry

Since the default registry now includes several backends, we need to reconsider how to store upgradeable tooling information.

Previously, mise only supported asdf plugins (and core plugins), but it now supports multiple backends. The default registry includes various backends, and some tools have fallbacks.

For example:

act                          aqua:nektos/act ubi:nektos/act asdf:gr1m0h/asdf-act                                 

Currently, Renovate supports these short names if they are manually registered in upgradeable-tooling.ts. However, we could potentially support tools not registered there by reading the registry. This approach would allow us to infer package names for backends such as aqua, ubi, pipx, etc.

Could creating a new datasource solve this issue? I’m not very familiar with how datasources work, but it seems the go datasource functions similarly by supporting multiple backend datasources.

Additionally, tools in the registry can include options like:

ubi:bitwarden/sdk[tag_regex=^bws,exe=bws]

Since the only relevant option for us is tag_regex, and only two tools in the registry use tag_regex, we could ignore it.

Aqua Backend

The aqua backend is based on aqua-registry, a registry for aqua, a CLI version manager. This registry defines how to download GitHub release binaries and specifies which ones to use.

It might be beneficial to set the extractVersion property for GitHub releases/tags using the version_filter from the aqua registry. Currently, we define extractVersion manually in upgradeable-tooling.ts.

While Aqua has its own Renovate config preset, aqua-renovate-config, it also sets extractVersion manually.

v prefix

mise automatically strips v prefix. Even if the version is set to 1.7.5 and the github release is v1.7.5, it can be installed for aqua and ubi backend.
I feel it is redundant that Renovate requires extractVesion="^v(?<version>.+)" in the config for all of these tools.
Are there any solutions for this?

=> Not a clean solution, but trimmed the v prefix from version and set extractVersion for aqua and ubi backend.

Context

Closes #30387.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

I'm going to test in a test repository and update the docs.

@risu729
Copy link
Contributor Author

risu729 commented Dec 14, 2024

I'm currently facing an issue with the tag_regex option of the ubi backend.
https://mise.jdx.dev/dev-tools/backends/ubi.html#ubi-uses-weird-versions

We can specify options in the tool name like below, however toml-eslint-parser, the toml parser used in Renovate, behaves weirdly, or differently with mise.

I need to understand the toml specification more, but it seems the parser cannot parse the toml with escapes correctly.

[tools]
"ubi:cargo-bins/cargo-binstall[tag_regex=^\\d\\.]" = "latest"

It was my bad, I needed to escape twice in the test fixtures as it is first parsed as js file and then parsed as toml file.

@rarkins rarkins marked this pull request as ready for review December 15, 2024 07:03
@rarkins rarkins marked this pull request as draft December 15, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[manager/mise]: add support for additional backends
1 participant