Skip to content

fix(config): deprecate env.mise directives - #11053

Merged
jdx merged 5 commits into
jdx:mainfrom
risu729:codex-20260717-001719-d6cee2
Jul 16, 2026
Merged

jdx merged 5 commits into
jdx:mainfrom
risu729:codex-20260717-001719-d6cee2

Conversation

@risu729

@risu729 risu729 commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • warn when the legacy env.mise directive namespace is used starting in mise 2026.7.0
  • remove env.mise support in mise 2026.12.0
  • reject the accidental vars.mise directive namespace without a deprecation period, including through nested arrays
  • apply the vars behavior consistently to config vars, task vars, and task-template vars
  • document the canonical env._ replacement

Why

env.mise predates the canonical env._ spelling and has remained as an undocumented compatibility alias. env._ has been supported since January 2024, so this PR intentionally uses a shortened deprecation window from 2026.7.0 to 2026.12.0 rather than the normal 12-month window. The replacement has already been available for more than two years.

vars.mise was only accepted because vars reused the environment directive deserializer; it was never documented or represented in the schema, so it is removed without a deprecation period.

Impact

Existing env.mise.* configurations continue to work through mise 2026.11.x but emit a warning directing users to env._.*. Support is removed starting in mise 2026.12.0. vars.mise configurations now fail parsing; vars._ remains supported. The schema already exposes only _, so no schema change is needed.

Validation

  • mise run format (includes lint-fix, cargo check, schema validation, shellcheck, and formatting checks)
  • mise run test:unit test_vars_mise_is_not_a_directive_namespace
  • mise run test:e2e e2e/env/test_env_file

Summary by CodeRabbit

  • Deprecations

    • Added warnings for the legacy env.mise spelling.
    • Use env._ instead; the legacy spelling is scheduled for removal in mise 2026.12.0.
  • Bug Fixes

    • Configuration entries using vars.mise are now rejected with a clear error message.
    • Deprecation warnings are consistently shown when legacy environment settings are detected.
  • Documentation

    • Updated environment configuration guidance to explain the migration from env.mise to env._.

@coderabbitai

coderabbitai Bot commented Jul 16, 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: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 68a6d6c2-08d4-4c89-9b6b-cf67292fb15a

📥 Commits

Reviewing files that changed from the base of the PR and between 70f47f1 and 53d90dd.

📒 Files selected for processing (5)
  • docs/environments/index.md
  • e2e/env/test_env_file
  • src/config/config_file/mise_toml.rs
  • src/task/mod.rs
  • src/task/task_template.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • e2e/env/test_env_file
  • src/task/mod.rs
  • src/task/task_template.rs
  • docs/environments/index.md
  • src/config/config_file/mise_toml.rs

📝 Walkthrough

Walkthrough

Configuration parsing rejects [vars.mise], warns for legacy [env.mise] usage, applies the rule to tasks and templates, documents the deprecation, and verifies the warning with an end-to-end assertion.

Changes

Configuration namespace validation

Layer / File(s) Summary
Namespace parsing rules
src/config/config_file/mise_toml.rs
A shared deserializer rejects vars.mise, while env.mise produces a deprecation warning directing users to env._; unit coverage verifies the rejection.
Task variable deserialization
src/task/mod.rs, src/task/task_template.rs
Task and task-template vars fields now use the shared custom deserializer.
Documentation and end-to-end validation
docs/environments/index.md, e2e/env/test_env_file
The deprecation is documented and the emitted warning is checked by an end-to-end test.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • jdx/mise#11060: Updates the same configuration deserializer and task/template vars fields for vars.mise rejection and env.mise deprecation.

Poem

A bunny parsed the TOML with care,
And found old mise hiding there.
“Vars must change, env gets a cheer—
A warning now makes guidance clear!”
Hop, hop, cleaner names appear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: deprecating the legacy env.mise directives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR deprecates the env.mise.* directive namespace (warning from 2026.7.0, removed in 2026.12.0) in favour of the canonical env._.* spelling, and hard-rejects vars.mise immediately since it was never intentionally supported.

  • deprecated_at!("2026.7.0", "2026.12.0", ...) is inserted into EnvList's visit_map for the "mise" key, and a new deserialize_vars wrapper rejects vars.mise (flat or nested in arrays) with a parse error before deserialization proceeds.
  • deserialize_vars is applied via #[serde(deserialize_with)] to MiseToml.vars, Task.vars, and TaskTemplate.vars, ensuring consistent enforcement across all three consumers.
  • Documentation and an e2e assertion are updated to reflect the deprecation warning and migration guidance.

Confidence Score: 5/5

Safe to merge — the change adds a deprecation warning and a hard rejection for an undocumented alias; existing valid configurations using env._ are unaffected.

The deprecated_at! macro is used consistently with the established pattern in the codebase. The deserialize_vars two-pass approach (first to toml::Value, check, then to EnvList) is idiomatic serde and correctly handles the flat and nested-array forms confirmed by the unit test. The change is additive and cannot regress users who already use env._.

No files require special attention.

Important Files Changed

Filename Overview
src/config/config_file/mise_toml.rs Adds deprecated_at! for env.mise inside EnvList deserializer; introduces deserialize_vars which pre-checks for a mise key (recursively through arrays) and rejects it immediately, then delegates to EnvList::deserialize. Unit test covers both flat and nested-array forms.
src/task/mod.rs Applies deserialize_vars to Task.vars via serde attribute, matching the same constraint now enforced on MiseToml.vars.
src/task/task_template.rs Applies deserialize_vars to TaskTemplate.vars via serde attribute, completing the consistent enforcement across all vars consumers.
e2e/env/test_env_file Adds an assert_contains check that mise env 2>&1 emits "deprecated [config.env.mise]" when env.mise is present; existing env.mise functional assertions are preserved.
docs/environments/index.md Appends a sentence to the existing deprecation warning block documenting env.mise.* → env._.* migration and the 2026.12.0 removal date.

Reviews (6): Last reviewed commit: "fix(config): restore env.mise removal ti..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/config/config_file/mise_toml.rs`:
- Around line 1856-1875: Update deserialize_vars to detect the mise key
recursively through arbitrarily nested toml::Value::Array structures, while
retaining the existing table check and rejection error. Reuse this recursive
check before EnvList::deserialize so deeply nested vars payloads cannot bypass
validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: a801f206-5458-4a64-aca3-9a37b4081050

📥 Commits

Reviewing files that changed from the base of the PR and between 6a69c2b and 7aad12e.

📒 Files selected for processing (5)
  • docs/environments/index.md
  • e2e/env/test_env_file
  • src/config/config_file/mise_toml.rs
  • src/task/mod.rs
  • src/task/task_template.rs

Comment thread src/config/config_file/mise_toml.rs Resolved
Comment thread src/config/config_file/mise_toml.rs Resolved
Comment thread docs/environments/index.md Resolved
@risu729
risu729 marked this pull request as ready for review July 16, 2026 15:09
@risu729
risu729 force-pushed the codex-20260717-001719-d6cee2 branch from 37efd94 to 8fdcc76 Compare July 16, 2026 19:05
@risu729
risu729 force-pushed the codex-20260717-001719-d6cee2 branch from 8fdcc76 to 53d90dd Compare July 16, 2026 19:05
@jdx
jdx enabled auto-merge (squash) July 16, 2026 19:28
@jdx
jdx merged commit ffbe4bf into jdx:main Jul 16, 2026
34 checks passed
@risu729
risu729 deleted the codex-20260717-001719-d6cee2 branch July 16, 2026 19:35
This was referenced Jul 16, 2026
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