You can have multiple contexts in the dispatch config file (~/.dispatch/config.json). Each context stores the location of a dispatch endpoint. Currently, to switch context you need to do dispatch manage context --set <context_name>. This is helpful as long as you intend to work in that context for some time.
But it's not possible to temporarily switch to a context and run a single command e.g. I just need to see if the functions are getting invoked in my production dispatch but I don't want to switch context and accidentally delete the resources in it. Hence, it will be nice to add a --context global flag to the CLI and switch the context only for that CLI command.
e.g. dispatch get functions (retrieves functions from my default dispatch context)
dispatch --context prod-dispatch get functions (retrieves functions from my prod dispatch context)
dispatch delete function process-credit-payment (Phew! that was just my dev-cluster)
Context
Possible Implementation
Complexity
[x] Low - Simple enhancement or bug fix, no architectural changes or refactoring
[ ] Medium - Change requires some thought, but is relatively isolated
[ ] High - Significant architectural change or large refactor
Feature Request
Add a --context flag to dispatch CLI.
Detailed Description
You can have multiple contexts in the dispatch config file (~/.dispatch/config.json). Each context stores the location of a dispatch endpoint. Currently, to switch context you need to do
dispatch manage context --set <context_name>
. This is helpful as long as you intend to work in that context for some time.But it's not possible to temporarily switch to a context and run a single command e.g. I just need to see if the functions are getting invoked in my production dispatch but I don't want to switch context and accidentally delete the resources in it. Hence, it will be nice to add a
--context
global flag to the CLI and switch the context only for that CLI command.e.g.
dispatch get functions
(retrieves functions from my default dispatch context)dispatch --context prod-dispatch get functions
(retrieves functions from my prod dispatch context)dispatch delete function process-credit-payment
(Phew! that was just my dev-cluster)Context
Possible Implementation
Complexity