This PR will add a few new VSCode commands from the resource namespace in the IBM Cloud CLI. The following commands will be added:
ibmcloud resource service-binding
ibmcloud resource service-bindings
ibmcloud resource service-alias
ibmcloud resource service-aliases
Callouts
The test for displaying the details of a service-binding is consistently failing. I have spent a lot of time working on it and can't find a solution so for the time being this test case will be disabled.
There is a small UX issue where the user will need to enter the service-alias if the logged in account on the CLI is not targeted to CF when running the commands above.
Could not find a simple way to retrieve a list of cf apps for the user to choose from the CLI so the user will need to type in the name of the CF app when running the service-binding command from the Command Palette\
Errors/warnings displayed in VSCode are in English. We should look into incorporating translations for other languages if possible.
A warning message is printed out when no service-alias exist when running either the service-binding or service-bindings command since these two commands depend on the out from the service-aliases command
Steps to Test
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 service-bindings 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 iam service-bindings
Verify that the command ibmcloud --cf target is printed in the Output Channel
Since service-bindings is a cf command, the extension will try to target the account to cf it is not currently
Verify that an input box is shown to specify the service alias
There is a concurrency when using the terminal to target cf and fetching a list of service-aliases. So an input box is shown
Enter in a valid service-alias
Verify that a list of service-bindings is printed in the Output Channel
Repeat steps 6-10 except...
Verify that step 7-8 does not occur
Verify that a dropdown list is shown in the Command Palette with a list of service-aliases to choose from
Type or select the service-alias from the dropdown list
Test service-binding command
Make sure to follow the steps 1-4 in Test resource service-bindings section
Open the Command Palette
Type and enter the command: ibmcloud resource service-binding
Verify that the dropdown from step 11 is shown
Type or select the service-alias from the dropdown list
Verify that a input box is show to specify the cloud foundry app.
Due to the limitations of the CLI the user will need to enter the name of the app manually
Enter a valid cloud foundry app name bound to the service
Verify that the details of the service-binding is printed in the Output Channel
Test service-aliases command
Make sure to follow the steps 1-4 in Test resource service-bindings section
Open the Command Palette
Type and enter the command: ibmcloud resource service-aliases
Verify that a list of service-aliases are printed in the Output Channel
Test service-alias command
Make sure to follow the steps 1-4 in Test resource service-bindings section
Open the Command Palette
Type and enter the command: ibmcloud resource service-alias
Verify that a dropdown list with a list of service aliases to choose from
Type or select the service alias from the list
Verify that the details of the service alias selected in step 5 is printed in the Output Channel
Test warning message for no service-alias
Open the terminal from VSCode
Change the target of the account to a space or org with no service alias
Open the Command Palette
Enter the command ibmcloud resource service-bindings or ibmcloud resource service-bindings
Verify that the warning message No service alias could be found. Please create a service alias and try again
Videos
resource service-bindings
resource service-binding
resource service-aliases
resource service-alias
Warning popup message when no service aliases (service-binding/service-bindings commands only)
Context
This PR will add a few new VSCode commands from the
resource
namespace in the IBM Cloud CLI. The following commands will be added:ibmcloud resource service-binding
ibmcloud resource service-bindings
ibmcloud resource service-alias
ibmcloud resource service-aliases
Callouts
service-binding
command from the Command Palette\service-binding
orservice-bindings
command since these two commands depend on the out from theservice-aliases
commandSteps to Test
Run integration tests
IBMCLOUD_API_KEY
environment variable to the key generated in step 1npm test
Test service-bindings command
ibmcloud login --sso
in the Command Paletteibmcloud iam service-bindings
ibmcloud --cf target
is printed in the Output ChannelTest service-binding command
ibmcloud resource service-binding
Test service-aliases command
ibmcloud resource service-aliases
Test service-alias command
ibmcloud resource service-alias
Test warning message for no service-alias
ibmcloud resource service-bindings
oribmcloud resource service-bindings
Videos
resource service-bindings
resource service-binding
resource service-aliases
resource service-alias
Warning popup message when no service aliases (service-binding/service-bindings commands only)