Skip to content

fix(lock): include task-specific tools - #11976

Merged
jdx merged 1 commit into
jdx:mainfrom
Marukome0743:pr11976
Aug 14, 2026
Merged

jdx merged 1 commit into
jdx:mainfrom
Marukome0743:pr11976

Conversation

@Marukome0743

@Marukome0743 Marukome0743 commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • include task-specific tools when mise lock resolves configured tool requests
  • route inline, inherited-template, included-file, environment, local, and monorepo task tools to their owning lockfiles
  • preserve distinct lock entries for the same version when backend or artifact-affecting options differ
  • pre-resolve every lockfile target before writing so resolution failures cannot partially update another target
  • keep task-only entries during stale pruning and remove them after their task declarations are removed

Root cause

mise lock only collected config-level tool requests from the resolved toolset and config files. Task-specific tools were first resolved when a task ran, which meant that the first execution could unexpectedly update mise.lock. Its collection deduplication also used only the short tool name and version, which collapsed requests whose backend or options selected different artifacts.

Verification

  • mise exec -- cargo fmt --all -- --check
  • mise exec -- cargo test --all-features cli::lock::tests (22 passed)
  • mise run test:e2e e2e/lockfile/test_lockfile_task_tools e2e/lockfile/test_lockfile_monorepo e2e/lockfile/test_lockfile_prune_stale_tools
  • mise exec -- cargo check --all-features
  • mise exec -- cargo clippy --workspace --all-features --all-targets -- -D warnings
  • mise run docs:build

mise run lint was also attempted, but the local Sapling-only checkout has no .git directory and hk exits before running checks with failed to find git repository; CI will run it in a Git checkout.

Addresses #4782

AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.

Summary by CodeRabbit

  • New Features

    • mise lock now includes tools declared by tasks, inherited templates, and included task files.
    • Task-specific tools are resolved into the appropriate lockfile without running tasks or installing tools.
    • Locking defaults to all configured and task-specific tools when no tools are specified.
    • Supports dry runs, targeted locking, stale-tool removal, and nested configurations.
  • Documentation

    • Updated CLI help, manuals, and task documentation to describe task tool locking.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d610a68e-d8ba-420e-952a-cc79c945a2da

📥 Commits

Reviewing files that changed from the base of the PR and between 3ffadf8 and f33bd52.

📒 Files selected for processing (1)
  • e2e/lockfile/test_lockfile_task_tools
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e/lockfile/test_lockfile_task_tools

📝 Walkthrough

Walkthrough

mise lock now loads task definitions and includes task-declared tools in lockfile resolution. It supports inherited and included tasks, target-specific lockfiles, option-aware deduplication, dry runs, stale-entry removal, and monorepo configurations.

Changes

Task-aware locking

Layer / File(s) Summary
Lock target preparation
src/cli/lock.rs
The lock command loads task context, prepares all lock targets before writing, and uses owned lockfile paths throughout updates.
Task tool collection and identity deduplication
src/cli/lock.rs
Task tools are mapped to lockfiles, resolved with contextual options, filtered by selectors, and deduplicated by backend, version, and request options. Tests cover tool identity.
Documented and tested behavior
docs/cli/lock.md, docs/dev-tools/mise-lock.md, docs/tasks/task-configuration.md, mise.usage.kdl, man/man1/mise.1, e2e/lockfile/test_lockfile_task_tools
Help text and documentation describe task-tool locking. End-to-end tests cover discovery, dry runs, installation, cleanup, configuration ownership, and lockfile stability.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: ⚪ Minimal · up to f33bd

The change expands lockfile resolution for task-specific tools and preserves distinct tool entries; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant mise_lock
  participant TaskLoadContext
  participant ToolResolver
  participant Lockfile
  User->>mise_lock: run mise lock
  mise_lock->>TaskLoadContext: load task definitions
  TaskLoadContext-->>mise_lock: return task and included-task tools
  mise_lock->>ToolResolver: resolve configured and task-specific tools
  ToolResolver-->>mise_lock: return unique resolved tools
  mise_lock->>Lockfile: update the owning lockfile
  Lockfile-->>User: report lockfile changes
Loading

Possibly related PRs

  • jdx/mise#11145: Both changes modify lock execution and tool resolution in src/cli/lock.rs.
  • jdx/mise#11175: Both changes modify lockfile tool collection and stale-entry handling.

Poem

A rabbit reads each task today,
And locks its tools before they play.
Templates, archives, tasks align,
Each owning lockfile keeps its line.
Dry runs leave the files in place—
Hop, stable tools now share the space.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
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: including task-specific tools in lock operations.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extends mise lock to collect task-specific tools, route them to their owning lockfiles, preserve option-specific entries, and resolve targets before writing.

  • Adds task-tool collection and lockfile ownership mapping.
  • Updates deduplication to account for backend and request options.
  • Adds end-to-end coverage and updates generated and authored documentation.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the available follow-up review record.

No blocking failure remains.

Important Files Changed

Filename Overview
src/cli/lock.rs Adds task-aware lock collection, target pre-resolution, ownership routing, and backend/options-aware deduplication; no eligible blocking follow-up finding was established.
e2e/lockfile/test_lockfile_task_tools Covers task-only, template, included-file, environment, local, monorepo, pruning, dry-run, and option-variant locking behavior.
docs/tasks/task-configuration.md Documents pre-locking task-specific tools; no eligible blocking follow-up finding was established.
docs/dev-tools/mise-lock.md Documents task-tool discovery, non-execution behavior, and owning-lockfile semantics.

Reviews (3): Last reviewed commit: "fix(lock): include task-specific tools" | Re-trigger Greptile

@jdx
jdx merged commit 53f961f into jdx:main Aug 14, 2026
31 checks passed
@Marukome0743
Marukome0743 deleted the pr11976 branch August 14, 2026 00:09
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