This PR will add a few new VSCode commands from the plugin namespace in the IBM Cloud CLI. The following commands will be added:
ibmcloud plugin install
ibmcloud plugin install --all
ibmcloud plugin uninstall
ibmcloud plugin update
Note: All installed plugins will be installed from the official public IBM Cloud repository.
Callouts
If the extension fails to retrieve the plugin list to either uninstall, install or update. The user will still be able to enter the plugin name
This PR will not be a release. Other commands will be added before a release will be made.
I have made restructured folder/file structure to fit inline with what other popular vscode extensions are doing. See vscode-docker as an example.
Steps to Test
Note: Is is recommended that you use a temporary directory to install plugins for testing. This will ensure the current state of your plugins are not inhibited. To do this you will need to export the IBMCLOUD_HOME environment (eg. IBMCLOUD_HOME=/tmp) in the terminal from VSCode before testing.
Run integration tests
Generate API key from IBM Cloud
Set and export the IBMCLOUD_API_KEY environment variable to the key generated in step 1
Login into IBM Cloud using CLI
Change directory to the root of your local ibm-developer-vscode repo
Run the command npm test
Verify that all tests pass
Test plugin install command
Make sure to follow the steps in the Setup section in previous PRs
Open the Command Palette
To enter Command Palette press Ctrl+Shift+P or F1 or navigate to View-> Command Palette
Type and enter in ibmcloud login --sso in the Command Palette
Follow the instructions to login into IBM Cloud
Repeat step 2 (command palette)
Enter the command: ibmcloud plugin install
Verify a dropdown list is shown with a list of plugins that can be installed
Select a plugin to install or type the plugin name in the input box then press Enter.
Verify that plugin is installed successfully by checking the Output Channel
Repeat steps 5-7 and verify that plugin installed from step 8 does not appear in the dropdown list
Test plugin uninstall command
Make sure to follow the steps in Test plugin install command section
Open the Command Palette
Type and enter the command: ibmcloud plugin uninstall
Verify a dropdown list is shown the list of plugins that have been installed.
Verify that installed plugin from step 9 is shown
Select plugin from dropdown
Verify that plugin is successfully uninstalled by checking the Output Channel
Repeat steps 3-4 and verify that plugin that was uninstalled in step 6 does not appear in the dropdown list
Test plugin uninstall command (no plugins installed)
Make sure that no plugins are installed
Follow the steps from 2-3 in Test plugin uninstall command section
Verify that toast message is shown that prints the message No plugin is installed. Please install a plugin before trying again
Test plugin update command
Install an older version of plugin using the CLI
ibmcloud plugin install code-engine 0.6.3
Open the Command Palette
Type and enter the command: ibmcloud plugin update
Verify that the plugin installed in step 1 is shown in the dropdown list
Type or select the plugin from step 1
Verify that the plugin is updated to the latest version by checking the Output Channel
Since there will be multiple features in this release, I think it is best to use a feature branch. When we are ready to release we can merge the release-0.2.1 feature branch to master.
Context
This PR will add a few new VSCode commands from the
plugin
namespace in the IBM Cloud CLI. The following commands will be added:ibmcloud plugin install
ibmcloud plugin install --all
ibmcloud plugin uninstall
ibmcloud plugin update
Note: All installed plugins will be installed from the official public IBM Cloud repository.
Callouts
Steps to Test
Note: Is is recommended that you use a temporary directory to install plugins for testing. This will ensure the current state of your plugins are not inhibited. To do this you will need to export the
IBMCLOUD_HOME
environment (eg.IBMCLOUD_HOME=/tmp
) in the terminal from VSCode before testing.Run integration tests
IBMCLOUD_API_KEY
environment variable to the key generated in step 1npm test
Test plugin install command
ibmcloud login --sso
in the Command Paletteibmcloud plugin install
Test plugin uninstall command
ibmcloud plugin uninstall
Test plugin uninstall command (no plugins installed)
Test plugin update command
ibmcloud plugin update
Videos