-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix: Revisions handling #18305
Fix: Revisions handling #18305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Berbe, could you add a test that adds a revision to an existing API so we can ensure this keeps working?
as well there are a couple test failures on this branch that may be related to this change?
------- Stdout: -------
=== RUN TestAccApiManagementApiTagDescription_basic
=== PAUSE TestAccApiManagementApiTagDescription_basic
=== CONT TestAccApiManagementApiTagDescription_basic
testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
Error: deleting Api Tag Descriptions: (Tag Description Name "acctest-Tag-220908183525980486" / Api Name "acctestapi-220908183525980486;rev=1" / Service Name "acctestAM-220908183525980486" / Resource Group "acctestRG-220908183525980486"): apimanagement.APITagDescriptionClient#Delete: Failure responding to request: StatusCode=412 -- Original Error: autorest/azure: Service returned an error. Status=412 Code="PreconditionFailed" Message="Exception of type 'Microsoft.WindowsAzure.ApiManagement.Management.Core.Exceptions.PreconditionFailedException' was thrown."
--- FAIL: TestAccApiManagementApiTagDescription_basic (231.64s)
FAIL
apiId := fmt.Sprintf("%s;rev=%s", id.Name, revision) | ||
apiId := fmt.Sprintf("%s;rev=%s", d.Get("name").(string), revision) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come id.Name doesn't work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not specifying an exact revision as part of the tracked ID will lead to an unstable state, due to the way the ARM API works.
As such, I define apiID
locally and moved the call to parse.NewApiID
afterwards to use this apiID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a Required field, users will always have to specify a Revision, so can you explain the problem?
@Berbe i'm going to close this out as its been a couple months without a reply. please do let us know/reopen then when you are ready to move it forward. |
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. |
Attempt at fixing #12720, #12766