fix(task): render task config includes#10225
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR adds template expansion and error propagation for task include patterns. A new trait method ChangesTask Include Template Expansion and Error Propagation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds Tera template rendering and
Confidence Score: 5/5Safe to merge — the change is well-scoped, error paths are correctly handled at every call site, and the new behaviour is covered by an e2e regression test. Template rendering is added only in task_config_includes() and runs against the existing parse_template path already used by all other MiseToml fields. Tilde expansion delegates to the already-tested file::replace_path. The signature change to task_includes_for_dir is mechanical and every call site is updated. No pre-existing infallible code path is silently swallowed. No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "docs(task): remove task include template..." | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
|
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. |
Summary
task_config.includesentries with the config-file Tera context before resolving local task include paths orgit::task sources~/for local task include paths and globs before deciding whether they are absolute or config-root-relative{{ config_root }},{{ env.HOME }}, and~/includesAddresses discussion #10209.
Tilde support
I checked the nearby path-like config behavior before adding this.
~/is already supported for task execution paths such as taskdir, taskfile, and task sandboxallow_read/allow_write, plus env path directives that resolve config paths such asenv._.file,env._.source, andenv._.python.venv.task_config.includesis also a config-provided local path/glob list, so this PR follows the existing local-path convention and expands only leading~/for local includes. Remotegit::includes are still treated as remote source strings after template rendering.Template context
task_config.includesis rendered while task files are being discovered, before any specific task exists. The available context is therefore the config-file context, not the task runtime context.Available values include:
env: the pristine process environment plus plain key/value entries from the same config file's[env]config_root: the root directory for the config file that definestask_config.includescwd: the current working directory captured in the base Tera contextmise_bin,mise_pid,mise_env, and the XDG home pathsTask-only values such as
usage, a concrete task object, task-level vars/env, and resolved tool information are not available here because includes decide which tasks are loaded.Tests
cargo fmt --checkgit diff --checkbash -n e2e/tasks/test_task_config_includes_templatesmise --cd /tmp x shellcheck -- shellcheck -x /home/risu/.worktrunk/risu729/mise/mise.codex-20260604-092743-8567ab/e2e/tasks/test_task_config_includes_templatesNot completed locally:
cargo check --all-targetswas queued behind existing machine-level Cargo jobs for over 20 minutes, so I stopped only my queued check rather than bypassing the Cargo wrapper.mise run test:e2e e2e/tasks/test_task_config_includes_templatesdepends onbuild, so it would have hit the same Cargo queue.Summary by CodeRabbit
New Features
{{ config_root }},~,{{ env.HOME }}).Bug Fixes
Tests