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

Fix: Revisions handling #18305

Closed
wants to merge 2 commits into from
Closed

Fix: Revisions handling #18305

wants to merge 2 commits into from

Conversation

Berbe
Copy link

@Berbe Berbe commented Sep 8, 2022

Attempt at fixing #12720, #12766

@Berbe Berbe changed the title Fix/revision Fix: Revisions handling Sep 8, 2022
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.

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

Comment on lines -302 to +300
apiId := fmt.Sprintf("%s;rev=%s", id.Name, revision)
apiId := fmt.Sprintf("%s;rev=%s", d.Get("name").(string), revision)
Copy link
Collaborator

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?

Copy link
Author

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

Copy link
Contributor

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?

@katbyte
Copy link
Collaborator

katbyte commented Jan 9, 2023

@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.

@katbyte katbyte closed this Jan 9, 2023
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

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 Feb 9, 2023
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