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

Open
wants to merge 36 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

https://github.com/risu729/renovate-mise-backends/blob/main/.mise.toml

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

@risu729

This comment was marked as resolved.

@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
@risu729 risu729 marked this pull request as ready for review February 6, 2025 11:46
const toolConfig = getToolConfig(depName, version);
// Parse the tool options in the tool name
const { name: depName, options: optionsInName } =
// istanbul ignore next: groups is always defined
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directive is not working. Since the regex includes (?<name>.+?), groups should never be undefined.


Note that some tools in the registry are not using the `asdf` backend. We are currently not supporting those tool short names.

TODO: Change the registry lookup.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO


If you are wanting to add support for an existing `asdf-x` plugin to `mise`, you can create a PR to extend Renovate's `asdf` manager, which indirectly helps Renovate's `mise` manager as well.
Renovate's `mise` manager does not support the following tool syntax:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these have issues created, if they are feasible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the following issues could be listed.

  1. Add aqua datasource, which internally has github_releases or other datasources.
  2. Add mise datasource to support mise registry shorthand. For example, resolve act of mise datasource to aqua:nektos/act, and then to nektos/act of aqua datasource.

For other limitations, asdf & vfox plugins, and incompatibility of regex with tag_regex, are not feasible, I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If `mise` adds support for more tools via its own [core plugins](https://mise.jdx.dev/plugins.html#core-plugins), you can create a PR to extend Renovate's `mise` manager to add support for the new tooling.
If `mise` adds support for more tools via its own [core tools](https://mise.jdx.dev/core-tools.html), you can create a PR to extend Renovate's `mise` manager to add support for the new core tools.

If you are wanting to add support for an other tools' short names to `mise`, you can create a PR to extend Renovate's `asdf` manager, which indirectly helps Renovate's `mise` manager as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is accurate advice these days. Only a fraction of mise tools make use of asdf any more, and I don't think any more are accepted. jdx/mise#4054

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment. Yes, it is outdated, but it's the only way to add support for short names for now.
Maybe we need to add a new datasource to support mise registry.

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
3 participants