Skip to content

Conversation

@halms
Copy link
Contributor

@halms halms commented Nov 18, 2025

This makes the file attribute in tasks relative to config_root and templateable, bringing it to feature parity with the dir attribute.

Implements a new async Task::file_path() method and follows the existing implementation pattern from Task::dir() for consistency.
Also adds a Task::file_path_raw() method for display purposes (cannot be async).


Note

Resolve task file paths relative to config_root with templating, and update execution/usage parsing to use the resolved path; add e2e and unit tests.

  • Tasks/Core:
    • Add Task::file_path() (async) to resolve file relative to config_root with templating; add Task::file_path_raw() for display.
    • Use resolved file in parse_usage_spec, parse_usage_spec_for_display, and Display.
    • In task_executor, derive MISE_TASK_FILE/MISE_TASK_DIR and run exec_file using task.file_path(...).
  • Tests:
    • Add e2e e2e/tasks/test_task_file_resolution covering relative, nested, absolute, and templated paths.
    • Add unit tests for file_path and file_path_raw behaviors.

Written by Cursor Bugbot for commit a7148b9. This will update automatically on new commits. Configure here.

@halms halms marked this pull request as ready for review November 18, 2025 16:51
Copilot AI review requested due to automatic review settings November 18, 2025 16:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the file attribute in task definitions by making it relative to config_root and templateable, achieving feature parity with the existing dir attribute.

  • Implements Task::file_path() async method for rendering templated file paths
  • Adds Task::file_path_raw() for non-templated display purposes
  • Updates all call sites to use the new async method properly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/task/mod.rs Implements file_path() and file_path_raw() methods; updates usage spec parsing and Display impl to use new methods
src/task/task_executor.rs Updates task execution to use async file_path() for retrieving templated file paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@halms halms marked this pull request as draft November 18, 2025 17:50
Includes fixes:
- [autofix.ci] apply automated fixes
- copilot suggestions
@halms halms force-pushed the fix/file-relative-to-config branch 2 times, most recently from 1291e54 to 1b5fce1 Compare November 18, 2025 19:23
@halms halms marked this pull request as ready for review November 18, 2025 19:28
@halms halms force-pushed the fix/file-relative-to-config branch from 1b5fce1 to 88c2cbc Compare November 18, 2025 19:33
@jdx
Copy link
Owner

jdx commented Nov 18, 2025

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@jdx jdx enabled auto-merge (squash) November 18, 2025 23:25
@jdx jdx merged commit fcf69ae into jdx:main Nov 18, 2025
29 checks passed
jdx pushed a commit that referenced this pull request Nov 20, 2025
### 📦 Registry

- added nelm by @tony-sol in
[#7020](#7020)

### 🚀 Features

- **(exec)** ensure MISE_ENV is set in spawned shell when specified via
-E flag by @ceelian in [#7007](#7007)

### 🐛 Bug Fixes

- **(go)** Don't allow auto mod=vendor mode by @mariduv in
[#7006](#7006)
- **(nushell)** test `use` not `source`, fix pipeline parse error by
@jokeyrhyme in [#7013](#7013)
- **(tasks)** make file paths relative to config location and
templateable by @halms in [#7005](#7005)

### Chore

- **(deny)** add exclusion for number_prefix by @jdx in
[e955ecb](e955ecb)

### New Contributors

- @mariduv made their first contribution in
[#7006](#7006)
- @ceelian made their first contribution in
[#7007](#7007)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`blender/blender`](https://github.com/blender/blender)
- [`werf/werf`](https://github.com/werf/werf)

#### Updated Packages (1)

- [`mas-cli/mas`](https://github.com/mas-cli/mas)
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