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

apimanagement : refactoring to use hashicorp/go-azure-sdk #22783

Merged
merged 7 commits into from
Aug 15, 2023

Conversation

@tombuildsstuff
Copy link
Contributor

@sinbai heads up I'm looking into the base layer issues the tests have picked up here:

Error: creating/updating Api (Subscription: "*******"
        Resource Group Name: "acctestRG-230803055317928116"
        Service Name: "acctestAM-230803055317928116"
        Api: "acctestAMA-230803055317928116"): performing CreateOrUpdate: no applicable pollers were found for the response

@sinbai
Copy link
Contributor Author

sinbai commented Aug 3, 2023

@sinbai heads up I'm looking into the base layer issues the tests have picked up here:

Error: creating/updating Api (Subscription: "*******"
        Resource Group Name: "acctestRG-230803055317928116"
        Service Name: "acctestAM-230803055317928116"
        Api: "acctestAMA-230803055317928116"): performing CreateOrUpdate: no applicable pollers were found for the response

Hi @tombuildsstuff thanks for letting me know about this. After updating this line to the following code,the test case TestAccApiManagementApiSchema_basic passes on my local. Just letting you know, hope it helps.

statusCodesToCheckProvisioningState := response.StatusCode == http.StatusOK || response.StatusCode == http.StatusCreated || (lroIsSelfReference && response.StatusCode == http.StatusAccepted)

tombuildsstuff added a commit to hashicorp/go-azure-sdk that referenced this pull request Aug 3, 2023
Most of API Management returns a 202 with a self reference containing an `asynctoken`, as such if a self-reference
exists then we can use this URI directly.

Fixes:

```
Error: creating/updating Api (Subscription: "*******"
        Resource Group Name: "acctestRG-230803055317928116"
        Service Name: "acctestAM-230803055317928116"
        Api: "acctestAMA-230803055317928116"): performing CreateOrUpdate: no applicable pollers were found for the response
```

From hashicorp/terraform-provider-azurerm#22783
@tombuildsstuff
Copy link
Contributor

@sinbai indeed, that's the same fix I've just pushed a commit to fix :)

tombuildsstuff added a commit to hashicorp/go-azure-sdk that referenced this pull request Aug 3, 2023
Most of API Management returns a 202 with a self reference containing an `asynctoken`, as such if a self-reference
exists then we can use this URI directly.

Fixes:

```
Error: creating/updating Api (Subscription: "*******"
        Resource Group Name: "acctestRG-230803055317928116"
        Service Name: "acctestAM-230803055317928116"
        Api: "acctestAMA-230803055317928116"): performing CreateOrUpdate: no applicable pollers were found for the response
```

From hashicorp/terraform-provider-azurerm#22783
@tombuildsstuff

This comment was marked as outdated.

@tombuildsstuff
Copy link
Contributor

@sinbai since the fix for this has been merged into hashicorp/go-azure-sdk, can you rebase this PR on top of main?

@sinbai
Copy link
Contributor Author

sinbai commented Aug 7, 2023

@sinbai since the fix for this has been merged into hashicorp/go-azure-sdk, can you rebase this PR on top of main?

Certainly, done:).

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @sinbai

Looks like there are quite a few new test failures in TC though
image

@sinbai sinbai force-pushed the APIM/refactor/to/use/go-azure-sdk branch from 84b0ba5 to c393bf8 Compare August 9, 2023 06:56
"strconv"
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement" // nolint: staticcheck
"github.com/Azure/go-autorest/autorest"
Copy link
Contributor

Choose a reason for hiding this comment

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

hashicorp/go-azure-sdk no longer uses Azure/go-autorest for APIManagement - so we can't rely on casting errors using it - can we just check the Status Codes being returned instead?

Copy link
Contributor Author

@sinbai sinbai Aug 11, 2023

Choose a reason for hiding this comment

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

@tombuildsstuff thanks for your feedback:). The code has been updated.

@sinbai
Copy link
Contributor Author

sinbai commented Aug 11, 2023

Thanks @sinbai

Looks like there are quite a few new test failures in TC though image

@stephybun thanks for your feedback. I have fixed some issues and the code has been updated. Also, I started a new test on Teamcity as follows : https://hashicorp.teamcity.com/buildConfiguration/TF_AzureRM_AZURERM_SERVICE_PUBLIC_APIMANAGEMENT/8397?hideProblemsFromDependencies=false&hideTestsFromDependencies=false.

@sinbai
Copy link
Contributor Author

sinbai commented Aug 14, 2023

Thanks @sinbai

Looks like there are quite a few new test failures in TC though image

Hi @stephybun , given the test results in the PR comments, I assume this PR is ready for review, what do you think?

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @sinbai. I have one comment around assigning the response Model and Properties to variables within the read. We do this for readability, so that we remain consistent could you please update those in all the read methods of the resources/data sources that have been migrated? (I've only pointed out two in-line)

@sinbai
Copy link
Contributor Author

sinbai commented Aug 15, 2023

Thanks @sinbai. I have one comment around assigning the response Model and Properties to variables within the read. We do this for readability, so that we remain consistent could you please update those in all the read methods of the resources/data sources that have been migrated? (I've only pointed out two in-line)

@stephybun thanks for your feedback. Code has been updated. Could you please take another look?

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes to bring this in line with the other resources @sinbai. LGTM 🥟

@stephybun stephybun merged commit 44448fe into hashicorp:main Aug 15, 2023
21 checks passed
@github-actions github-actions bot added this to the v3.70.0 milestone Aug 15, 2023
stephybun added a commit that referenced this pull request Aug 15, 2023
@sinbai sinbai deleted the APIM/refactor/to/use/go-azure-sdk branch March 28, 2024 02:48
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 Apr 28, 2024
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.

3 participants