Repository navigation
fix(task): normalize variadic usage env values - #11881
Conversation
📝 WalkthroughWalkthroughThe task usage parser now exposes environment-backed variadic strings and flags as single-element arrays. Parser tests and an end-to-end Tera task test verify array rendering and CLI precedence. ChangesVariadic environment values
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
2454b7d to
3f00f31
Compare
|
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. |
86d8e6b to
eea07c6
Compare
Greptile SummaryThis PR normalizes environment-backed variadic arguments and value-taking flags into one-element arrays at the structured Tera usage-map boundary.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The normalization is restricted to variadic string arguments and value-taking flags, preserves each environment value as one logical element, and is covered across environment and CLI paths. Important Files Changed
Reviews (1): Last reviewed commit: "fix(task): normalize variadic usage env ..." | Re-trigger Greptile |
Summary
usagemapRoot cause
usage-libreturns CLI and default values forvar=#trueasMultiString, but returns anenv=value as a scalarString. mise copied that parser type directly into the Tera context, so filters such asjoinrejected environment-backed variadic values even though the documentedusagemap contract says they are arrays.This change normalizes the value at mise's structured Tera boundary. It intentionally leaves the shell-facing
$usage_*serialization and deprecated template helpers unchanged. A single environment variable remains one logical value, preserving embedded whitespace and matching the existing single-string default behavior.Verification
mise exec -- cargo test --all-features task::task_script_parser::testsmise run test:e2e e2e/tasks/test_task_usage_map_tera e2e/tasks/test_task_usage_env_teramise exec -- cargo check --all-featuresmise exec -- cargo clippy --workspace --all-features --all-targets -- -D warningsmise exec -- cargo fmt --all -- --checkmise exec -- shellcheck e2e/tasks/test_task_usage_map_teramise exec -- shfmt -d e2e/tasks/test_task_usage_map_teramise run formatandmise run lintreach the repository-widehkwrapper, which exits before running checks because this checkout is managed by Sapling andhkrequires a Git worktree. The relevant formatting, shell, Cargo, and Clippy checks above pass when run directly.Addresses #7550
AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.