-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add initial support for mise #14500
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
Open
efcasado
wants to merge
2
commits into
dependabot:main
Choose a base branch
from
efcasado:feat-mise-ecosystem
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,858
−1
Open
Add initial support for mise #14500
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,9 @@ julia: | |
| maven: | ||
| - *shared | ||
| - 'maven/**' | ||
| mise: | ||
| - *shared | ||
| - 'mise/**' | ||
| nix: | ||
| - *shared | ||
| - 'nix/**' | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,3 +87,6 @@ | |
|
|
||
| "L: nix": | ||
| - '(nix)' | ||
|
|
||
| "L: mise": | ||
| - '(mise)' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,9 @@ hex: | |
| maven: | ||
| - *common | ||
| - 'maven/**' | ||
| mise: | ||
| - *common | ||
| - 'mise/**' | ||
| nix: | ||
| - *common | ||
| - 'nix/**' | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| BUNDLE_GEMFILE: "../dependabot-updater/Gemfile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /.bundle/* | ||
| !.bundle/config | ||
| /tmp | ||
| /dependabot-*.gem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| inherit_from: ../.rubocop.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # syntax=docker.io/docker/dockerfile:1.20 | ||
| FROM ghcr.io/dependabot/dependabot-updater-core | ||
|
|
||
| ARG MISE_VERSION=v2026.3.9 | ||
| RUN curl -fsSL https://github.com/jdx/mise/releases/download/${MISE_VERSION}/install.sh \ | ||
| | MISE_INSTALL_PATH=/usr/local/bin/mise sh | ||
|
|
||
| USER dependabot | ||
|
|
||
| # required by mise's npm backend | ||
| RUN MISE_YES=1 mise use -g node@lts | ||
|
|
||
|
|
||
| COPY --chown=dependabot:dependabot --parents mise common $DEPENDABOT_HOME/ | ||
| COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ## `dependabot-mise` | ||
|
|
||
| Mise support for [`dependabot-core`][core-repo]. | ||
|
|
||
| ### Running locally | ||
|
|
||
| 1. Start a development shell | ||
|
|
||
| ``` | ||
| $ bin/docker-dev-shell mise | ||
| ``` | ||
|
|
||
| 2. Run tests | ||
| ``` | ||
| [dependabot-core-dev] ~ $ cd mise && rspec | ||
| ``` | ||
|
|
||
| [core-repo]: https://github.com/dependabot/dependabot-core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| Gem::Specification.new do |spec| | ||
| common_gemspec = | ||
| Bundler.load_gemspec_uncached("../common/dependabot-common.gemspec") | ||
|
|
||
| spec.name = "dependabot-mise" | ||
| spec.summary = "Provides Dependabot support for mise" | ||
| spec.description = "Dependabot-mise provides support for bumping mise dependencies via Dependabot. " \ | ||
| "If you want support for multiple package managers, you probably want the meta-gem " \ | ||
| "dependabot-omnibus." | ||
|
|
||
| spec.author = common_gemspec.author | ||
| spec.email = common_gemspec.email | ||
| spec.homepage = common_gemspec.homepage | ||
| spec.license = common_gemspec.license | ||
|
|
||
| spec.metadata = { | ||
| "bug_tracker_uri" => common_gemspec.metadata["bug_tracker_uri"], | ||
| "changelog_uri" => common_gemspec.metadata["changelog_uri"] | ||
| } | ||
|
|
||
| spec.version = common_gemspec.version | ||
| spec.required_ruby_version = common_gemspec.required_ruby_version | ||
| spec.required_rubygems_version = common_gemspec.required_ruby_version | ||
|
|
||
| spec.require_path = "lib" | ||
| spec.files = Dir["lib/**/*"] | ||
|
|
||
| spec.add_dependency "dependabot-common", Dependabot::VERSION | ||
|
|
||
| common_gemspec.development_dependencies.each do |dep| | ||
| spec.add_development_dependency dep.name, *dep.requirement.as_list | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # typed: strong | ||
| # frozen_string_literal: true | ||
|
|
||
| # These all need to be required so the various classes can be registered in a | ||
| # lookup table of package manager names to concrete classes. | ||
| require "dependabot/mise/version" | ||
| require "dependabot/mise/requirement" | ||
| require "dependabot/mise/metadata_finder" | ||
| require "dependabot/mise/file_fetcher" | ||
| require "dependabot/mise/file_parser" | ||
| require "dependabot/mise/update_checker" | ||
| require "dependabot/mise/file_updater" | ||
|
|
||
| # 8B2252 is used as vp-c-brand-1 in mise's official website | ||
| require "dependabot/pull_request_creator/labeler" | ||
| Dependabot::PullRequestCreator::Labeler | ||
| .register_label_details("mise", name: "mise", colour: "8B2252") | ||
|
|
||
| require "dependabot/dependency" | ||
| Dependabot::Dependency.register_production_check("mise", ->(_) { true }) | ||
|
|
||
| Dependabot::Utils.register_version_class("mise", Dependabot::Mise::Version) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # typed: strict | ||
| # frozen_string_literal: true | ||
|
|
||
| require "dependabot/file_fetchers" | ||
| require "dependabot/file_fetchers/base" | ||
|
|
||
| module Dependabot | ||
| module Mise | ||
| class FileFetcher < Dependabot::FileFetchers::Base | ||
| extend T::Sig | ||
|
|
||
| sig { override.returns(String) } | ||
| def self.required_files_message | ||
| "Repo must contain a mise configuration file " \ | ||
| "(mise.toml, .mise.toml, mise.<env>.toml, or .mise.<env>.toml)." | ||
| end | ||
|
|
||
| sig { override.params(filenames: T::Array[String]).returns(T::Boolean) } | ||
| def self.required_files_in?(filenames) | ||
| filenames.any? { |filename| mise_config_file?(filename) } | ||
| end | ||
|
|
||
| sig { params(filename: String).returns(T::Boolean) } | ||
| def self.mise_config_file?(filename) | ||
| filename == "mise.toml" || | ||
| filename == ".mise.toml" || | ||
| filename.match?(/^mise\.[a-zA-Z0-9_-]+\.toml$/) || # mise.<env>.toml | ||
| filename.match?(/^\.mise\.[a-zA-Z0-9_-]+\.toml$/) # .mise.<env>.toml | ||
| end | ||
|
|
||
| sig { override.returns(T::Array[DependencyFile]) } | ||
| def fetch_files | ||
| # Implement beta feature flag check | ||
| unless allow_beta_ecosystems? | ||
| raise Dependabot::DependencyFileNotFound.new( | ||
| nil, | ||
| "Mise support is currently in beta. Set ALLOW_BETA_ECOSYSTEMS=true to enable it." | ||
| ) | ||
| end | ||
|
|
||
| # Fetch all mise config files that exist in the repo | ||
| fetched_files = repo_contents.filter_map do |file| | ||
| # Access properties directly - repo_contents items have name and type | ||
| next unless file.type == "file" | ||
| next unless self.class.mise_config_file?(file.name) | ||
|
|
||
| fetch_file_from_host(file.name) | ||
| end | ||
|
|
||
| return fetched_files unless fetched_files.empty? | ||
|
|
||
| raise Dependabot::DependencyFileNotFound.new( | ||
| "mise.toml", | ||
| "No mise configuration file found" | ||
| ) | ||
| end | ||
|
|
||
| sig { override.returns(T.nilable(T::Hash[Symbol, T.untyped])) } | ||
| def ecosystem_versions | ||
| nil | ||
|
efcasado marked this conversation as resolved.
|
||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| Dependabot::FileFetchers.register("mise", Dependabot::Mise::FileFetcher) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.