Skip to content

fix(schema): align env directive options - #12793

Draft
risu729 wants to merge 1 commit into
jdx:mainfrom
risu729:schema/env-directive-options
Draft

fix(schema): align env directive options#12793
risu729 wants to merge 1 commit into
jdx:mainfrom
risu729:schema/env-directive-options

Conversation

@risu729

@risu729 risu729 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • model the deprecated value and values aliases for environment directives
  • model the deprecated [env.mise] alias using the same contract as [env._]
  • expose the full directive option shape on path and source entries while rejecting their no-op expand = true
  • make Python virtual-environment option objects strict

This is one scope split from #12531. It is independent and based directly on main; #12794 separately covers vars values and directives. The three PRs can merge in any order.

Validation

  • mise run render:schema
  • mise run test:e2e e2e/config/test_schema_tombi

Schema-only change; runtime behavior is unchanged.

AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable.

Summary by CodeRabbit

  • Bug Fixes

    • Improved validation for environment directives, preventing unsupported expand settings on path and source directives.
    • Python and virtual environment configurations now reject unrecognized properties.
  • Compatibility

    • Schema validation now recognizes deprecated value/values aliases for environment paths.
    • Added support for the deprecated env.mise alias.
  • Tests

    • Added coverage for invalid environment directive expansion settings.

@coderabbitai

coderabbitai Bot commented Sep 4, 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: Team

Run ID: 3258a991-7139-4b9f-b614-81fee5ba848e

📥 Commits

Reviewing files that changed from the base of the PR and between e2925ed and 39d72a0.

📒 Files selected for processing (3)
  • e2e/config/test_schema_tombi
  • schema/mise-task.json
  • schema/mise.json

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The environment schemas now support deprecated directive aliases, restrict expand to file directives, reject unknown Python options, and add a deprecated env.mise alias. Tombi tests verify invalid expansion settings for path and source directives.

Changes

Environment schema validation

Layer / File(s) Summary
Directive contracts
schema/mise-task.json, schema/mise.json
Directive schemas add deprecated value and values aliases and define env_directive_no_expand. Descriptions reference _.file.
Directive wiring and option constraints
schema/mise-task.json, schema/mise.json
Path and source directives use the no-expand schema. Python and virtualenv objects reject unknown properties. env.mise aliases env._.
Fixture and validation coverage
e2e/config/test_schema_tombi
The Tombi schema test adds invalid expansion fixtures and checks that expand = true fails for _.path and _.source.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 39d72

Environment directive schemas now recognize deprecated aliases, reject unsupported expansion on path and source entries, and strictly validate Python virtual-environment options. The change is ready to merge.

Suggested reviewers: jdx, jambalaya56562

Poem

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary schema changes to environment directive options.

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.

Entire-Checkpoint: 01M1Q6SJWPRM1YEE0TWJN84W12
@risu729
risu729 force-pushed the schema/env-directive-options branch from 8a46cdf to 39d72a0 Compare September 4, 2026 22:00
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR aligns the environment-directive schemas with runtime behavior.

  • Models deprecated value, values, and env.mise aliases.
  • Shares the full directive option shape across path and source entries while rejecting their ineffective expand = true.
  • Makes Python virtual-environment option objects strict.
  • Adds focused end-to-end coverage for path/source expansion rejection, though the other changed contracts remain uncovered.

Confidence Score: 4/5

The schema changes appear safe to merge, with a non-blocking gap in regression coverage for several newly modeled contracts.

Runtime and schema behavior align for the aliases, path/source expansion handling, and Python option strictness; the remaining concern is that tests cover only the expansion-rejection portion of the change.

Files Needing Attention: e2e/config/test_schema_tombi

Important Files Changed

Filename Overview
schema/mise.json Aligns the main configuration schema with runtime aliases, directive options, no-op expansion handling, and strict Python virtual-environment objects.
schema/mise-task.json Applies the same environment-schema alignment to task configuration.
e2e/config/test_schema_tombi Tests path/source expansion rejection but does not cover the other newly modeled acceptance and strictness contracts.

Reviews (1): Last reviewed commit: "fix(schema): align env directive options" | Re-trigger Greptile

Comment on lines +306 to +316
# `expand` is only read for `_.file`; reject it on path/source directives so
# editors do not suggest that the option has an effect there.
for directive in \
'_.path = { paths = ["./bin"], expand = true }' \
'_.source = { path = "env.sh", expand = true }'; do
cat >"$HOME/workdir/mise-bad-env-directive-expand.toml" <<TOML
[env]
$directive
TOML
assert_fail "$TOMBI_LINT mise-bad-env-directive-expand.toml"
done

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.

P2 Incomplete schema regression coverage

The added tests only check that expand = true is rejected for path and source directives. They do not cover the newly accepted value, values, and env.mise aliases or verify that unknown Python virtual-environment options are rejected. Since the two schemas are maintained separately, adding positive alias cases and negative Python-property cases would help prevent future drift between the schemas and runtime behavior.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

This PR currently has failing checks. If this continues for 7 days, it will be closed automatically.

This is warning day 1 of 7.

Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it.

This comment was generated by an automated workflow.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

This PR currently has failing checks. If this continues for 7 days, it will be closed automatically.

This is warning day 2 of 7.

Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it.

This comment was generated by an automated workflow.

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