You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(cli): make charm execution explicit via required runIt parameter (#1967)
* refactor(cli): make charm execution explicit via required runIt parameter
Previously, CharmManager.get() defaulted to running charms (runIt=true),
causing unnecessary charm execution for read/write operations. This change
makes the default false and requires all callers to explicitly pass the
runIt parameter.
Changes:
- Change default runIt from true to false in CharmManager.get() and CharmsController.get()
- Update CLI lib functions to explicitly pass runIt:
- Pass false for read/write operations (inspect, get, set, apply, getsrc, setsrc)
- Pass true for operations requiring execution (call, render)
- Update shell AppView to pass runIt: true when displaying active charm
Benefits:
- Eliminates unnecessary charm runs for ct charm ls, inspect, get, set, etc.
- Makes code intent explicit at every call site
- Improves performance by avoiding unnecessary work
- Maintains correct behavior for commands that need execution (call, render, step)
Technical notes:
- Preserved all three overload signatures to avoid TypeScript type explosion
- Only changed the default value in the implementation
- All tests pass without type checker OOM
* add step to integration test
* fix script to not exit early without printing an error message when charm is not found
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments