Add feature flag for new remote command by feluelle · Pull Request #1956 · astronomer/astro-cli
Description
Describe the purpose of this pull request.
This pull request introduces a new feature flag to conditionally enable the Remote command in the CLI. The flag is implemented as a configuration option and is used to control whether the Remote command is included in the available commands at runtime.
Feature flag addition and usage:
- Added a new configuration option
beta.remote_cmd(exposed asRemoteCmdin the config types) to enable or disable the Remote command. [1] [2] - Updated the command registration logic in
cmd/cloud/root.goto append the Remote command only if theRemoteCmdconfig flag is set to true. - Imported the
configpackage incmd/cloud/root.goto access the new configuration flag.
🎟 Issue(s)
Related #XXX
🧪 Functional Testing
List the functional testing steps to confirm this feature or fix.
❯ ./astro config set -g beta.remote_cmd false
Setting beta.remote_cmd to false successfully
❯ ./astro remote
Error: unknown command "remote" for "astro"
Run 'astro --help' for usage.
❯ ./astro config set -g beta.remote_cmd true
Setting beta.remote_cmd to true successfully
❯ ./astro remote
Commands for interacting with remote registries and deploying client images
Current Context: Astro
Usage:
astro remote [command]
Available Commands:
deploy Deploy a client image to the remote registry
Flags:
-h, --help help for remote
Global Flags:
--verbosity string Log level (debug, info, warn, error, fatal, panic (default "warning")
Use "astro remote [command] --help" for more information about a command.
📸 Screenshots
Add screenshots to illustrate the validity of these changes.
📋 Checklist
- Rebased from the main (or release if patching) branch (before testing)
- Ran
make testbefore taking out of draft - Ran
make lintbefore taking out of draft - Added/updated applicable tests
- Tested against Astro-API (if necessary).
- Tested against Houston-API and Astronomer (if necessary).
- Communicated to/tagged owners of respective clients potentially impacted by these changes.
- Updated any related documentation