Skip to content

Conversation

@toshimaru
Copy link
Member

@toshimaru toshimaru commented Apr 22, 2025

Configuration

  - type: mise_use
    name: go
    version: '1.23'
  - type: mise_use
    name: ruby

Apply

$ bundle exec serverkit apply serverkit.yml --log-level=DEBUG
...
Running mise ls --current go | grep '1.23' on localhost
go  1.23.8  ~/.config/mise/config.toml  1.23
Finished with 0 on localhost
[SKIP] mise_use go on localhost
Running mise ls --current ruby | grep 'latest' on localhost
ruby  3.4.3  ~/.config/mise/config.toml  latest
Finished with 0 on localhost
[SKIP] mise_use ruby on localhost

Result

mise ls
Tool  Version  Source                      Requested
go    1.23.8   ~/.config/mise/config.toml  1.23
go    1.24.2
ruby  3.3.8
ruby  3.4.3    ~/.config/mise/config.toml  latest

Related PR

@toshimaru toshimaru marked this pull request as ready for review April 23, 2025 07:15
Copilot AI review requested due to automatic review settings April 23, 2025 07:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements the new resource type "mise_use" for managing tool usage via the mise CLI. Key changes include:

  • Adding the MiseUse resource with an apply and check method reflecting the global flag.
  • Updating documentation in the README for the new resource.
  • Adjusting test configuration in the GitHub workflow.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/serverkit/resources/mise_use.rb New resource implementation for mise_use.
lib/serverkit/resources/mise_install.rb Updated example comments to reflect current usage.
lib/serverkit/mise.rb Added require for the new mise_use resource.
README.md Documentation updates for the new mise_use resource.
.github/workflows/test.yml Updated Ruby versions to include 3.4.


# @note Override
def apply
run_command("mise use --global #{name_with_version}")
Copy link

Copilot AI Apr 23, 2025

Choose a reason for hiding this comment

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

The apply method always appends the '--global' flag irrespective of the 'global' attribute. Consider modifying the command to conditionally include '--global' based on the 'global' attribute's value, to ensure consistent behavior with the check method.

Suggested change
run_command("mise use --global #{name_with_version}")
run_command("mise use #{global_option}#{name_with_version}")

Copilot uses AI. Check for mistakes.
@toshimaru toshimaru merged commit c87db67 into main Apr 23, 2025
8 checks passed
@toshimaru toshimaru deleted the mise_use branch April 23, 2025 07:17
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.

2 participants