-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Webex Adapter] Add Webex Functional Test and YAML File #3257
Conversation
Pull Request Test Coverage Report for Build 102396
💛 - Coveralls |
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.6.3 |
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll compared against version 4.6.3 |
Description
This pull request adds a YAML file to set up a build pipeline for Webex Functional Test.
Changes made
We added the file
botbuilder-dotnet-ci-webextest.yml
inside thebuild/yaml
folder.Variables Summary
This is a summary of the variables you will need to get before setting up the Azure pipeline
Setting Up
The next steps will guide you through the configuration of a Build pipeline based on the YAML files.
Prerequisites
Create a Bot in Webex
Go to Webex Developer portal, log in with a Webex developer account.
Go to Start Building Apps -> Create a New App -> Create a Bot
Complete the fields and click the Add Bot button.
Once created, it will display the Bot's Access token and Bot ID values.
Get Room ID
With the Bot Username value set in the section before, we will create a Room Id using the Webex Message API documentation.
Go to the Webex Message API documentation, log in with a Webex developer account.
In the Try It section, complete the fields:
toPersonEmail: Bot Username in format @webex.bot
text:
Create Room Id
Click on Run to get the Room Id value from the API JSON response.
Get the Room Id value from the API JSON response.
Create Integration
Go to the Webex Developer portal, log in with a Webex developer account.
Go to Start Building Apps -> Create a New App -> Create an Integration
Complete the following fields:
Default icon
spark:all
Click the Add Integration button to create the Webex Integration App.
Get Refresh Token
With the Integration Client ID and the Integration Client Secret values obtained in the section before, we will get a refresh token. This allows to us setup an authorization token for the functional test that will not expire.
Go to the Webex Developer My Apps portal, log in with a Webex developer account.
Select the Integration App created before.
Open the OAuth Authorization URL using a web browser, It will take you to the URL you set as a RedirectUri(s). In the address bar you will see:
http://[YOUR_REDIRECT_URL]/?code=[CODE].
Make a POST request to https://api.ciscospark.com/v1/access_token with the next values:
x-www-form-urlencoded
authorization_code
)While the access_token will be valid for 90 days, we don't need to wait that long to request a new access token. The functional test will requests a new access token (using the provided refresh_token) every time it runs.
Create a Webhook
To connect the functional test with Webex, we need to create a Webhook.
Go to the Webex Create WebHook API documentation, log in with a Webex developer account.
In the Try It section, complete the following fields:
https://<BotName>.azurewebsites.net/api/messages
messages
created
Click on Run to create the Webex Webhook
Set up a build pipeline
Create a new build pipeline. Then, select the Use classic editor option.
Configure the repository and branch. Then, in the configuration as code, click on Apply for the YAML file option.
In section YAML, write the build name and select the build YAML file inside the folder
build/yaml
in the root of the directory.Setup variables
The following are the variables we need to add to the pipeline. It is a good idea to prefix their names with "Webex" or something to make them more relatable to Webex, since more than one set of functional tests may be running in the same pipeline.
*Set these variables as private.