Skip to content
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

Upgrade Bot Service API version from 2021-03-01 to 2021-05-01-preview #16665

Merged
merged 16 commits into from
May 26, 2022

Conversation

neil-yechenwei
Copy link
Contributor

@neil-yechenwei neil-yechenwei commented May 6, 2022

To support new property MsaAppType that is only released to latest version 2021-05-01-preview, we have to upgrade Bot Service API version from 2021-03-01 to 2021-05-01-preview.

Note: Service team confirmed that the IsIsolated property has been deprecated and is replaced with new property PublicNetworkAccess. After tested, I found this property IsIsolated doesn't work anymore in 2021-03-01 because API always returns nil even if this property is set as true/false in request body.

--- PASS: TestAccBotChannelsRegistration/basic/basic (238.50s)
--- PASS: TestAccBotChannelsRegistration/bot/basic (245.30s)
--- PASS: TestAccBotChannelsRegistration/bot/completeUpdate (342.69s)
--- PASS: TestAccBotChannelsRegistration/bot/requiresImport (262.84s)
--- PASS: TestAccBotChannelsRegistration/web_app/basic (234.71s)
--- PASS: TestAccBotChannelsRegistration/web_app/update (319.77s)
--- PASS: TestAccBotChannelsRegistration/web_app/complete (203.61s)
--- PASS: TestAccBotChannelsRegistration/channel/webchatUpdate (459.94s)
--- PASS: TestAccBotChannelsRegistration/channel/webchatRequiresImport (387.04s)
--- PASS: TestAccBotChannelsRegistration/channel/msteamsUpdate (459.64s)
--- PASS: TestAccBotChannelsRegistration/channel/directLineSpeechRequiresImport (266.36s)
--- PASS: TestAccBotChannelsRegistration/channel/alexaRequiresImport (876.21s)
--- PASS: TestAccBotChannelsRegistration/channel/msteamsBasic (243.48s)
--- PASS: TestAccBotChannelsRegistration/channel/directlineBasic (244.18s)
--- PASS: TestAccBotChannelsRegistration/channel/directlineComplete (235.78s)
--- PASS: TestAccBotChannelsRegistration/channel/directlineUpdate (389.01s)
--- PASS: TestAccBotChannelsRegistration/channel/directLineSpeechBasic (230.06s)
--- PASS: TestAccBotChannelsRegistration/channel/alexaBasic (545.13s)
--- PASS: TestAccBotChannelsRegistration/channel/alexaUpdate (956.34s)
--- PASS: TestAccBotChannelsRegistration/channel/directLineSpeechComplete (250.00s)
--- PASS: TestAccBotChannelsRegistration/channel/webchatComplete (235.39s)
--- PASS: TestAccBotChannelsRegistration/channel/webchatBasic (242.72s)
--- PASS: TestAccBotChannelsRegistration/channel/slackUpdate (337.74s)
--- PASS: TestAccBotChannelsRegistration/channel/slackBasic (221.37s)
--- PASS: TestAccBotChannelsRegistration/channel/slackComplete (224.19s)
--- PASS: TestAccBotChannelsRegistration/channel/lineBasic (254.12s)
--- PASS: TestAccBotChannelsRegistration/channel/lineComplete (250.41s)
--- PASS: TestAccBotChannelsRegistration/channel/lineUpdate (434.28s)
--- PASS: TestAccBotChannelsRegistration/channel/lineRequiresImport (262.96s)
--- PASS: TestAccBotChannelsRegistration/channel/facebookBasic (244.38s)
--- PASS: TestAccBotChannelsRegistration/channel/facebookRequiresImport (247.97s)
--- PASS: TestAccBotChannelsRegistration/channel/facebookUpdate (350.17s)
--- PASS: TestAccBotChannelsRegistration/basic/update (778.53s)
--- PASS: TestAccBotChannelsRegistration/basic/complete (253.44s)
--- PASS: TestAccBotChannelsRegistration/channel/directLineSpeechUpdate (366.50s)
--- PASS: TestAccBotChannelsRegistration/connection/basic (98.06s)
--- PASS: TestAccBotChannelsRegistration/connection/complete (178.78s)

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we fix up the ascctests?:

------- Stdout: -------
=== RUN   TestAccBotChannelsRegistration
=== RUN   TestAccBotChannelsRegistration/basic
=== RUN   TestAccBotChannelsRegistration/basic/basic
=== RUN   TestAccBotChannelsRegistration/basic/update
    testcase.go:117: Step 9/10 error: Error running apply: exit status 1
        
        Error: cannot purge key "acctestkvkey2-6efho" because vault "Vault: (Name \"acctestkv-6efho\" / Resource Group \"acctestRG-220509202741077289\")" has purge protection enabled
        
        
        Error: cannot purge key "acctestkvkey-6efho" because vault "Vault: (Name \"acctestkv-6efho\" / Resource Group \"acctestRG-220509202741077289\")" has purge protection enabled
        
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: cannot purge key "acctestkvkey2-6efho" because vault "Vault: (Name \"acctestkv-6efho\" / Resource Group \"acctestRG-220509202741077289\")" has purge protection enabled
        
        
        Error: cannot purge key "acctestkvkey-6efho" because vault "Vault: (Name \"acctestkv-6efho\" / Resource Group \"acctestRG-220509202741077289\")" has purge protection enabled
        
=== RUN   TestAccBotChannelsRegistration/basic/complete
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: cannot purge key "acctestkvkey-ps0aa" because vault "Vault: (Name \"acctestkv-ps0aa\" / Resource Group \"acctestRG-220509203702976895\")" has purge protection enabled
        
=== RUN   TestAccBotChannelsRegistration/bot
=== RUN   TestAccBotChannelsRegistration/bot/basic
=== RUN   TestAccBotChannelsRegistration/bot/completeUpdate
=== RUN   TestAccBotChannelsRegistration/bot/requiresImport
=== RUN   TestAccBotChannelsRegistration/connection
=== RUN   TestAccBotChannelsRegistration/connection/basic
    testcase.go:117: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # azurerm_bot_connection.test will be updated in-place
          ~ resource "azurerm_bot_connection" "test" {
                id                    = "/subscriptions/*******/resourceGroups/acctestRG-220509205057637817/providers/Microsoft.BotService/botServices/acctestdf220509205057637817/connections/acctestBc220509205057637817"
                name                  = "acctestBc220509205057637817"
              ~ tags                  = {
                  - "environment" = "production" -> null
                }
                # (6 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== RUN   TestAccBotChannelsRegistration/connection/complete
    testcase.go:117: Step 1/4 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # azurerm_bot_connection.test will be updated in-place
          ~ resource "azurerm_bot_connection" "test" {
                id                    = "/subscriptions/*******/resourceGroups/acctestRG-220509205207261845/providers/Microsoft.BotService/botServices/acctestdf220509205207261845/connections/acctestBc220509205207261845"
                name                  = "acctestBc220509205207261845"
              ~ tags                  = {
                  - "environment" = "production" -> null
                }
                # (8 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== RUN   TestAccBotChannelsRegistration/channel
=== RUN   TestAccBotChannelsRegistration/channel/directLineSpeechComplete
    testcase.go:117: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating Bot Channel: (Channel Name "DirectLineSpeechChannel" / Bot Service Name "acctestdf220509205426666368" / Resource Group "acctestRG-220509205426666368"): botservice.ChannelsClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidChannelData" Message="ChannelConverter Exception: DirectLine Speech Channel failed to acquire Cognitive subscription id from tokenEndpoint."
        
          with azurerm_bot_channel_direct_line_speech.test,
          on terraform_plugin_test.tf line 40, in resource "azurerm_bot_channel_direct_line_speech" "test":
          40: resource "azurerm_bot_channel_direct_line_speech" "test" {
        
=== RUN   TestAccBotChannelsRegistration/channel/directLineSpeechUpdate
    testcase.go:117: Step 3/4 error: Error running apply: exit status 1
        
        Error: updating Bot Channel: (Channel Name "DirectLineSpeechChannel" / Bot Service Name "acctestdf220509205643200039" / Resource Group "acctestRG-220509205643200039"): botservice.ChannelsClient#Update: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidChannelData" Message="ChannelConverter Exception: DirectLine Speech Channel failed to acquire Cognitive subscription id from tokenEndpoint."
        
          with azurerm_bot_channel_direct_line_speech.test,
          on terraform_plugin_test.tf line 53, in resource "azurerm_bot_channel_direct_line_speech" "test":
          53: resource "azurerm_bot_channel_direct_line_speech" "test" {

also are you running the other etests that require provisioned resources?

@neil-yechenwei
Copy link
Contributor Author

neil-yechenwei commented May 14, 2022

@katbyte , I fixed TCs.

For the skipped TCs in Teamcity, I am also running them on my local and they are passed except below TCs due to no test data. For instance, below the test data of bot sms channel are chargeable. The test data of bot email channel requires a dedicated enterprise account not personal account.

--- SKIP: TestAccBotChannelsRegistration/channel/emailUpdate (0.00s)
--- SKIP: TestAccBotChannelsRegistration/channel/emailBasic (0.00s)
--- SKIP: TestAccBotChannelsRegistration/channel/smsBasic (0.00s)
--- SKIP: TestAccBotChannelsRegistration/channel/smsRequiresImport (0.00s)

The few TCs in Teamcity casually failed due to unstable service api but they can pass in another run.

@neil-yechenwei neil-yechenwei requested a review from katbyte May 14, 2022 04:53
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🦀

@katbyte katbyte merged commit 9a5bbd9 into hashicorp:main May 26, 2022
@github-actions github-actions bot added this to the v3.8.0 milestone May 26, 2022
katbyte added a commit that referenced this pull request May 26, 2022
@github-actions
Copy link

This functionality has been released in v3.8.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants