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

mise up does not update tools to latest #1384

Closed
travbale opened this issue Jan 6, 2024 · 5 comments · Fixed by #2667
Closed

mise up does not update tools to latest #1384

travbale opened this issue Jan 6, 2024 · 5 comments · Fixed by #2667
Labels
enhancement New feature or request

Comments

@travbale
Copy link

travbale commented Jan 6, 2024

Describe the bug

When using mise up I am getting mise All tools are up to date when I have what I consider to be out of date tools. For instance I intentional set my .mise.toml to use an older version of yamllint (One minor version behind latest) and attempted to use mise up to bump it to latest as if I had ran mise use --pin yamllint@latest.

To Reproduce

mkdir test
cd test
mise use --pin jq
mise use yamllint@1.32.0
mise up

Expected behavior

I expected yamllint to bump to the latest version (1.33.0) as if I had ran mise use --pin yamllint@latest.

mise doctor output

mise version:
  2024.1.7 macos-arm64 (292e4ac 2024-01-05)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Fri, 5 Jan 2024 19:07:41 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin22.0)

mise data directory:
  /Users/travbale/.local/share/mise

mise environment variables:
  MISE_SHELL=zsh

settings:
  {
    "experimental": false,
    "color": true,
    "always_keep_download": false,
    "always_keep_install": false,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "plugin_autoupdate_last_check_duration": "7d",
    "trusted_config_paths": [],
    "log_level": "info",
    "trace": false,
    "debug": false,
    "verbose": false,
    "quiet": false,
    "asdf_compat": false,
    "jobs": 4,
    "shorthands_file": null,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "raw": false,
    "yes": false,
    "task_output": null,
    "not_found_auto_install": true,
    "ci": false,
    "env_file": null,
    "cd": null
  }

config files:
  /Users/travbale/Development/test/.mise.toml

plugins:
  bun             (core)
  deno            (core)
  go              (core)
  golangci-lint   https://github.com/hypnoglow/asdf-golangci-lint.git#e968b13
  java            (core)
  jq              https://github.com/lsanwick/asdf-jq.git#addae51
  node            (core)
  python          (core)
  ruby            (core)
  yamllint        https://github.com/ericcornelissen/asdf-yamllint.git#4e0a8a0

toolset:
  jq@1.7.1, yamllint@1.32.0

No problems found
@travbale travbale added the bug Something isn't working label Jan 6, 2024
@jdx jdx added enhancement New feature or request and removed bug Something isn't working labels Jan 6, 2024
@jdx
Copy link
Owner

jdx commented Jan 6, 2024

that's not a bug, mise up updates to the latest in the range you've specified. For what you're doing you can just do mise use --pin yamllint@latest

@jdx
Copy link
Owner

jdx commented Jan 6, 2024

that said, there is the downside of that where you don't have --interactive and can't upgrade all of them at once. I also suspect you won't be the only user to attempt this so I'm ok with having more than 1 way to do things.

This probably shouldn't be default behavior though. I'm thinking maybe something like mise up --latest.

@travbale
Copy link
Author

travbale commented Jan 7, 2024

I figured it might be something like that. I was looking for something like pre-commit's command that updates all hooks to the latest version. I think mise up --latest would work nicely. Also great tool by the way I've been enjoying it.

@jdx
Copy link
Owner

jdx commented Jan 18, 2024

I'd be open to a PR for this but I think it will be a bit tricky to write. It will probably need to respect the existing specificity for the previous version, e.g.:

[tools]
node = '20'
python = '3.11.0'

should become:

[tools]
node = '22'
python = '3.12.1'

I don't think existing code does this anywhere so that would need to be written. There are edge cases like how go and erlang use "1.9" but "1.9.1" and probably a lot more where semver isn't followed or uses strange conventions. We could start with basic semver though.

@toupeira
Copy link

I'm currently using this script to update all plugins to their latest version, and also pin the version in the global configuration file:

#!/bin/bash

plugins=$( mise ls -g --no-header | cut -d\  -f1 )

mise plugins update || exit 1

# set plugins to 'latest' so 'mise upgrade' will use newer versions
for plugin in $plugins; do
  mise use -g "$plugin@latest" >/dev/null
done

mise upgrade --interactive || exit 1

# set plugins to their actual versions
for plugin in $plugins; do
  mise use -g --pin "$plugin@latest"
done

mise prune

Maybe mise upgrade --latest could just act as if plugins were already set to latest? That would take care of simple use cases at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants