-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(task): load toml tasks in task_config.includes in system/global config and monorepo subdirs
#6545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix(task): load toml tasks in task_config.includes in system/global config and monorepo subdirs
#6545
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
95dde00
test(task): add test for monorepo with task_config.includes
risu729 a12d0af
Merge branch 'main' into task-monorepo-includes
risu729 a15e4b4
test: update relative paths syntax
risu729 2e7c036
fix(task): always load task files in task_config.include
risu729 9bea95a
[autofix.ci] apply automated fixes
autofix-ci[bot] 7272c5c
Merge branch 'main' into task-monorepo-includes
risu729 afedda9
fix(task): ignore non-toml includes files
risu729 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Test monorepo task edge cases: multiple dot extensions | ||
| export MISE_EXPERIMENTAL=1 | ||
|
|
||
| # Create monorepo root config | ||
| cat <<EOF >mise.toml | ||
| experimental_monorepo_root = true | ||
|
|
||
| [tasks.root-task] | ||
| run = 'echo "root task"' | ||
| EOF | ||
|
|
||
| # Create project structure with task_config.includes | ||
| mkdir -p projects/frontend/tasks | ||
| cat <<EOF >projects/frontend/mise.toml | ||
| [task_config] | ||
| includes = ["tasks.toml", "tasks"] | ||
| EOF | ||
|
|
||
| # Create included TOML file with a task | ||
| cat <<EOF >projects/frontend/tasks.toml | ||
| [toml-task] | ||
| run = 'echo "task from toml"' | ||
| EOF | ||
|
|
||
| # Create included script task | ||
| cat <<'EOF' >projects/frontend/tasks/script-task.sh | ||
| #!/usr/bin/env bash | ||
| echo "task from script" | ||
| EOF | ||
| chmod +x projects/frontend/tasks/script-task.sh | ||
|
|
||
| # Create included script task with multiple extensions | ||
| cat <<'EOF' >projects/frontend/tasks/another.long-name.sh | ||
| #!/usr/bin/env bash | ||
| echo "task with long name" | ||
| EOF | ||
| chmod +x projects/frontend/tasks/another.long-name.sh | ||
|
|
||
| # --- Assertions --- | ||
|
|
||
| # Verify all tasks are discovered | ||
| assert_contains "mise tasks ls --debug --all" "//:root-task" | ||
| assert_contains "mise tasks ls --all" "//projects/frontend:toml-task" | ||
| assert_contains "mise tasks ls --all" "//projects/frontend:script-task" | ||
| assert_contains "mise tasks ls --all" "//projects/frontend:another.long-name" | ||
|
|
||
| # Verify running tasks from root | ||
| assert_contains "mise run '//projects/frontend:toml-task'" "task from toml" | ||
| assert_contains "mise run '//projects/frontend:script-task'" "task from script" | ||
| assert_contains "mise run '//projects/frontend:another.long-name'" "task with long name" | ||
| assert_contains "mise run '//projects/frontend:another.long-name.sh'" "task with long name" | ||
|
|
||
| # Verify running from a subdirectory | ||
| cd projects/frontend | ||
| assert_contains "mise run :toml-task" "task from toml" | ||
| assert_contains "mise run :script-task" "task from script" | ||
| assert_contains "mise run :another.long-name" "task with long name" | ||
|
|
||
| # Verify wildcard execution from subdirectory | ||
| output=$(mise run ':*') | ||
| assert_contains "echo '$output'" "task from toml" | ||
| assert_contains "echo '$output'" "task from script" | ||
| assert_contains "echo '$output'" "task with long name" | ||
|
|
||
| cd ../.. | ||
|
|
||
| # Verify wildcard execution from root | ||
| output=$(mise run '//projects/frontend:*') | ||
| assert_contains "echo '$output'" "task from toml" | ||
| assert_contains "echo '$output'" "task from script" | ||
| assert_contains "echo '$output'" "task with long name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.