Commit 58b2307
authored
fix: resolve
## Summary
- `vp run` crashed when a task script contained global-only commands like `vp config` because `CLIArgs::try_parse_from` failed on unrecognized subcommands with `ErrorKind::InvalidSubcommand`
- Now `InvalidSubcommand` errors return `HandledCommand::Synthesized` with `UserCacheConfig::disabled()`, letting the global CLI binary handle them as regular subprocesses without caching
- Also disabled cache for `vp exec` and `vp check` in task scripts, since they run arbitrary/composite commands with side effects
## Test plan
- [x] Added unit test `global_subcommands_produce_invalid_subcommand_error` confirming `config`, `create`, `env`, `migrate` produce `InvalidSubcommand`
- [x] Added snap test `command-run-with-vp-config` verifying `vp run foo` with `"foo": "vp config"` no longer crashes
- [x] All existing snap tests passvp run crash when task script contains global CLI subcommands (#766)1 parent 52a4778 commit 58b2307
4 files changed
Lines changed: 71 additions & 4 deletions
File tree
- packages/cli
- binding/src
- snap-tests/command-run-with-vp-config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
675 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
676 | 685 | | |
677 | 686 | | |
678 | 687 | | |
679 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
680 | 691 | | |
681 | 692 | | |
682 | 693 | | |
| |||
685 | 696 | | |
686 | 697 | | |
687 | 698 | | |
688 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
689 | 702 | | |
690 | 703 | | |
691 | 704 | | |
| |||
1660 | 1673 | | |
1661 | 1674 | | |
1662 | 1675 | | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
1663 | 1692 | | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments