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: add support for mise #757

Merged
merged 1 commit into from
Mar 30, 2024
Merged

Conversation

riffingonsoftware
Copy link
Contributor

Add support for mise-en-place (or mise). Mise is a tool like asdf (already supported). https://mise.jdx.dev/

Standards checklist:

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

Add support for mise-en-place (or mise). Mise is a tool like asdf (already supported). https://mise.jdx.dev/
Copy link

codecov bot commented Mar 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 5.02%. Comparing base (728ea26) to head (10545f5).

Files Patch % Lines
src/steps/os/unix.rs 0.00% 12 Missing ⚠️
src/config.rs 0.00% 1 Missing ⚠️
src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #757      +/-   ##
========================================
- Coverage   5.03%   5.02%   -0.02%     
========================================
  Files         37      37              
  Lines      12085   12114      +29     
========================================
  Hits         609     609              
- Misses     11476   11505      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Thx!

@SteveLauC SteveLauC merged commit ab21600 into topgrade-rs:main Mar 30, 2024
17 of 19 checks passed
InnocentZero pushed a commit to InnocentZero/topgrade that referenced this pull request May 25, 2024
Add support for mise-en-place (or mise). Mise is a tool like asdf (already supported). https://mise.jdx.dev/
@returntrip
Copy link

Thanks for implementing this! Should this work also for mise plugins upgrade?

@riffingonsoftware
Copy link
Contributor Author

Thanks for implementing this! Should this work also for mise plugins upgrade?

It should:

.args(["plugins", "update"])
. Is it not?

@returntrip
Copy link

Does not look like it:

── 21:09:51 - mise ─────────────────────────────────────────────────────────────                                                                       
curl: (22) The requested URL returned error: 404                                                                                                       
mise ERROR ~/.local/share/mise/plugins/bitwarden-secrets-manager/bin/download failed                                                                   
test https://github.com/bitwarden/sdk/releases/download//bws-x86_64-unknown-linux-gnu-https://github.com/bitwarden/sdk/releases/tag/python-v1.0.0.zip  
* Downloading bitwarden-secrets-manager release https://github.com/bitwarden/sdk/releases/tag/python-v1.0.0...                                         
curl: (22) The requested URL returned error: 404                                                                                                       
asdf-bitwarden-secrets-manager: Could not download https://github.com/bitwarden/sdk/releases/download//bws-x86_64-unknown-linux-gnu-https://github.com/
bitwarden/sdk/releases/tag/python-v1.0.0.zip                                                                                                           
mise usage@0.11.1       ✓ installed                                                                                                                    
mise ERROR Failed to install bitwarden-secrets-manager@https://github.com/bitwarden/sdk/releases/tag/python-v1.0.0                                     
mise ERROR ~/.local/share/mise/plugins/bitwarden-secrets-manager/bin/download exited with non-zero status: exit code 1                                 
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information                                                                                   
mise failed:                                                                                                                                           
   0: Command failed: `/home/linuxbrew/.linuxbrew/bin/mise upgrade`                                                                                    
   1: `/home/linuxbrew/.linuxbrew/bin/mise` failed: exit status: 1                                                                                     
                                                                                                                                                       
Location:                                                                                                                                              
   src/steps/os/unix.rs:628                                                                                                                            
Retry? (y)es/(N)o/(s)hell/(q)uit                                                                                                                       
 
 [ ]❯❯ mise plugins upgrade bitwarden-secrets-manager
mise plugin:bitwarden-secrets-manager ✓ https://github.com/asdf-community/asdf-bitwarden-secrets-manager#c773ed0                                       
[ble: EOF]                                                                                                                                             

[ ]❯❯ topgrade --only mise

── 21:12:14 - mise ─────────────────────────────────────────────────────────────
mise Uninstalling usage@0.8.4 ✓ removing ~/.cache/mise/usage/0.8.4         
mise plugin:bitwarden-secrets-manager ✓ https://github.com/asdf-community/asdf-bitwarden-secrets-manager#c773ed0
mise plugin:fzf         ✓ https://github.com/kompiro/asdf-fzf.git#f8fcea1
mise plugin:shfmt       ✓ https://github.com/luizm/asdf-shfmt.git#a42c5ff
mise plugin:shellcheck  ✓ https://github.com/luizm/asdf-shellcheck.git#66200ff
mise plugin:usage       ✓ https://github.com/jdx/mise-usage.git#fe3888a
mise plugin:odo         ✓ https://github.com/rm3l/asdf-odo.git#21f5d8d     
── 21:12:15 - Summary ──────────────────────────────────────────────────────────
mise: OK

[ ]❯❯ mise plugins upgrade           
mise plugin:bitwarden-secrets-manager ✓ https://github.com/asdf-community/asdf-bitwarden-secrets-manager#c773ed0
mise plugin:shfmt       ✓ https://github.com/luizm/asdf-shfmt.git#a42c5ff
mise plugin:shellcheck  ✓ https://github.com/luizm/asdf-shellcheck.git#66200ff
mise plugin:fzf         ✓ https://github.com/kompiro/asdf-fzf.git#f8fcea1
mise plugin:usage       ✓ https://github.com/jdx/mise-usage.git#fe3888a
mise plugin:odo         ✓ https://github.com/rm3l/asdf-odo.git#21f5d8d  

@returntrip
Copy link

I am re reading the error when I first run topgrade. It does look like topgrade is first running mise upgrade, as it is failing since the bitwarden plugin was broken, topgrade does not continue with mise plugins upgrade. Can the mise commands execution be inverted?

@riffingonsoftware
Copy link
Contributor Author

Sure, I could do that. Glancing through the mise docs, I don't see a recommendation as to ordering. I'll get a PR up shortly to see about flipping the ordering. Thanks.

@riffingonsoftware
Copy link
Contributor Author

For anyone following along at home: #968

@SteveLauC
Copy link
Member

Is it possible that mise plugins update could fail, inhibiting the second command from running?

@riffingonsoftware
Copy link
Contributor Author

Yes, it is possible, but that seems to be the norm for the other steps. That is, any steps that execute multiple commands seem to bail when the first fails. So, I was trying to stay consistent.

@SteveLauC
Copy link
Member

I mean, if it is also possible, why do we need to flip the order then 🤔

@riffingonsoftware
Copy link
Contributor Author

I mean, if it is also possible, why do we need to flip the order then 🤔

This is a valid question. I may be misunderstand, but I think @returntrip indicated if the order had been reversed, this upgrade would have succeeded in this instance. @returntrip, did I misunderstand?

@returntrip
Copy link

returntrip commented Oct 26, 2024 via email

@SteveLauC
Copy link
Member

If "mise upgrade plugins" would have run first, then the newer plugin would have been in place and "mise upgrade" would have updated bws successfully

Makes sense to me.

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.

3 participants