Repository navigation
fix(task): respect configured directory when editing tasks - #10955
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughTask include resolution now selects file-task creation directories from effective includes, propagates invalid-directory errors, and preserves inline-task handling. End-to-end coverage verifies defaults, explicit includes, ordering, ambiguity, and replacement behavior. ChangesTask include resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant TasksEdit
participant TaskTaskDir
participant Config
participant Filesystem
User->>TasksEdit: edit task with --path
TasksEdit->>TaskTaskDir: resolve task directory
TaskTaskDir->>Config: resolve effective includes
Config-->>TaskTaskDir: include patterns and resolution base
TaskTaskDir->>Filesystem: inspect candidate directories
Filesystem-->>TaskTaskDir: selected directory or error
TaskTaskDir-->>TasksEdit: return path or propagate failure
TasksEdit-->>User: create task file or display failure
Possibly related PRs
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 |
Greptile SummaryThis PR fixes
Confidence Score: 5/5Safe to merge — changes are narrowly scoped to task directory selection with correct error propagation throughout the call chain. The new No files require special attention. Important Files Changed
Reviews (11): Last reviewed commit: "refactor(task): iterate task include dir..." | Re-trigger Greptile |
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
✅ Action performedReview finished.
|
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
✅ Action performedReview finished.
|
Summary
task_config.includeslist when creating a file taskBehavioral decision
Explicit include paths are not auto-created. An entry may represent a task TOML file or a directory, so mise must not infer the type of a path that does not exist. For example, with
includes = ["tasks"]:tasks/exists, a new file task is created there;tasksdoes not exist, the command returns an error and does not create eithertasks/ormise-tasks/;mise tasks editormise tasks add --file.This matches the clarification in Discussion #10954. Built-in default includes are known directory paths, so when none exist mise may still create the first effective default entry.
Root cause
Task::task_dirfell back tomise-taskswhenever no include expanded to an existing directory. That ignored the replacement semantics of an explicittask_config.includesvalue and could create a task outside the configured include paths.Validation
mise run lint-fixcargo check --all-featuresmise run test:e2e e2e/tasks/test_task_edit_nested_namesshellcheck -x e2e/tasks/test_task_edit_nested_namesAddresses #10954