Skip to content

ci: stop mise from listing remote versions when tools are cached - #947

Merged
ShaiShmuel merged 1 commit into
mainfrom
ci/mise-install-offline-on-cache-hit
Nov 11, 2026
Merged

ShaiShmuel merged 1 commit into
mainfrom
ci/mise-install-offline-on-cache-hit

Conversation

@ShaiShmuel

@ShaiShmuel ShaiShmuel commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  1. CI restores installed tools from the mise cache. That cache holds mise's data directory, not its cache directory, where remote version lists are kept.
  2. With every tool already restored, mise install python uv github:rhysd/actionlint still asks the GitHub API for the release lists of the named tools, and of every tool in mise.toml that the job did not install.
  3. When the API is slow the step fails after three 20 second timeouts, although nothing needed to be downloaded. CI / Policy then fails CI / Required, and the pull request is removed from the merge queue.

Net effect: a GitHub API slowdown removes pull requests from the merge queue even on a full cache hit.

Change

prefer_offline = true in mise.toml [settings]. Every tool is pinned to an exact version, so mise never needs a remote version list. A tool that is missing is still downloaded at its pinned version.

tools/ci/tests/test_required_ci.py gains a test that the setting stays on and that every tool in mise.toml pins an exact x.y.z version, which is what the setting relies on.

One setting covers every mise install, mise exec and mise run in the workflows, so no workflow file changes.

Evidence

Reproduced locally with the pinned mise 2026.5.5 in throwaway data and cache directories:

Case Before After
Tools installed, cache directory empty, network blocked Failed to install tools: core:python@3.12.12, github:rhysd/actionlint@1.7.7, exit 1 exit 0, no requests
Tools installed, cache directory empty, network on release lists fetched for the named tools and for every uninstalled tool in mise.toml no requests
Nothing installed, network on installs installs the same pinned versions; the GitHub-backed tools go straight to their release tag

Testing

  • pytest tools/ci/tests/test_required_ci.py tools/ci/tests/test_public_tree.py: 140 passed. The new test fails when the setting is off or a pin is loosened.
  • actionlint, check_public_tree.py and ruff on tools/ci: clean.

Not verified

  • Linux. The reproduction ran on macOS arm64 with the same mise version.
  • The first CI run on this pull request is a cache miss for every job, because mise.toml is part of the cache key. That run exercises the cold install path on Linux.

Local effect

A developer's mise install also stops refreshing version lists. mise ls-remote and mise latest still fetch.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Tool setup avoids remote version-list requests when the local cache is empty, which can speed up setup. Missing tools are still downloaded as needed.

The mise cache in CI holds the installed tools but not mise's own cache
directory, where remote version lists live. So `mise install` with
every tool already restored still asked the GitHub API for release
lists, and a slow API failed the job with nothing to download.

Set `prefer_offline` in mise.toml. Every tool is pinned to an exact
version, so no remote list is needed; a missing tool still downloads.
A CI test keeps the setting and the exact pins in place.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

mise.toml now sets prefer_offline = true. A CI test checks this setting and verifies that tool versions use exact major.minor.patch pins.

Changes: mise offline installs

Layer / File(s) Summary
Offline configuration and validation
mise.toml, tools/ci/tests/test_required_ci.py
mise is configured to prefer offline operation. The CI test checks the setting and verifies exact major.minor.patch pins for tool versions, including list entries.

Possibly related PRs

  • superlinked/sie#922: Changes mise.toml tool declarations and CI mise caching. This PR tests the uv list declaration introduced there.

Suggested reviewers: mamayer19

Merge Risk: Minimal · up to 4a96b

This change makes mise prefer cached data so installs avoid unnecessary remote version lookups. Install and task workflows keep working with pinned tool versions. Manual version-check commands such as mise latest may show stale results until the cache is cleared, but the repository does not use them. No merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preventing mise from fetching remote version lists when tools are cached.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 039e1703-d0d9-43bb-8d50-8f6c920b2c0a
Commits

Reviewing files that changed from the base of the PR and between a64c300 and 4a96b56.

Files selected for processing: 2

  • mise.toml
  • tools/ci/tests/test_required_ci.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@ShaiShmuel
ShaiShmuel marked this pull request as ready for review November 11, 2026 14:15
@ShaiShmuel
ShaiShmuel requested a review from a team as a code owner November 11, 2026 14:15
@ShaiShmuel
ShaiShmuel added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 11, 2026
@ShaiShmuel
ShaiShmuel added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 042252f Nov 11, 2026
45 checks passed
@ShaiShmuel
ShaiShmuel deleted the ci/mise-install-offline-on-cache-hit branch November 11, 2026 18:02
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.

1 participant