-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
vendor: Downgrade Azure dependencies #22490
Conversation
More information on why this is happening can be found here: https://gist.github.com/appilon/1ba757b22845b400aa9841ff54d0f330 To summarize, it seems when upgrading Terraform go modules tries to satisfy both the old version of TF and the new one. This will lead to an ambiguous import of the problematic dependencies, despite this being incorrect, we only need the transitive dependencies of the new Terraform. You can clear up the temporary problem with |
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.
I approve but would love to see how providers who were affected and wanted the change to begin with feel.
@jhendrixMSFT any chance we we get your input on the best path forward here? To give a little context: Terraform's vendored as a library into it's providers (which can vendor each other, for historical reasons) - so whilst |
cc @tamalsaha |
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.
While this revert is not convenient for me, I recognize that this workflow will be frustrating for the large majority of other providers that may end up running into the same issues that @radeksimko did when trying to update the AWS provider. This number could be quite large, given that there are over 100 official Terraform providers.
Additionally I think we also need to take into account that some providers have tools such as Renovate to automatically update dependencies, and working around this in those workflows might be tougher.
As such, I think in the spirit of a better DX for the majority of our downstream consumers, this is a 👍 for me. From what I understand the provider SDK is also not too far out, which should prevent TF core deps from leaking into providers, effectively making the issue that caused this in the first place moot.
FWIW a downgrade of TF to 0.12.6 in the ACME provider - before these changes were introduced - triggered some Terraform-associated build errors, but the provider built without issue. So the consequences of reversion may not be so bad.
@tamalsaha, Radek has already tagged you but as a note you could probably continue to use the current commit you vendored against a couple of weeks ago without issue, but YMMV and that's not an official recommendation. There is work that should be ready relatively soon to de-couple the provider SDK from the rest of Terraform core, and at that point in time there should be no more dependency conflicts like this. Beyond that, reiterating what was discussed here, we don't make any guarantees of the stability of the packages in Terraform core beyond what is needed to facilitate normal use of providers. Apologies for any inconvenience this may cause!
It might be worth waiting to hear from @jhendrixMSFT . He is actively working on getting the go.mod issues under control. |
Regarding the ambiguous imports problem, this is being discussed in Azure/go-autorest#414, I will get this deployed in |
This is to allow Terraform providers to upgrade to at least one more minor version of the plugin SDK without major UX hiccups. This concludes (unsuccessful) experiments involving upgrades to SDK with Azure/go-autorest#455 Even with that patch all providers still experience broken UX as described in #22490 This downgrade reduces the uncomfort to only a handful of providers from >100s. The affected providers more or less directly depend on Azure SDK(s), which is ~8. Affected providers practically cannot consume Terraform Plugin SDK with this patch (downgraded Azure SDKs) and can just wait for extracted Terraform Plugin SDK which is planned to be released soon. This reverts the following PRs: - #22247 - #22248 - #22524 - #22525 and it is otherwise result of the following commands ``` go get github.com/Azure/azure-sdk-for-go@v21.3.0 go get github.com/hashicorp/go-azure-helpers@166dfd221bb2 go mod tidy ```
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This is effectively reverting #22247 and #22248
I haven't had chance to debug and fully understand why, but here's what the end-user experience of provider developer looks like (this is for a provider which doesn't depend on the Azure SDK at all - AWS):
So the end-user/developer of a provider receives quite a cryptic error message, which is probably solvable by adding
replace
into theirgo.mod
, but:replace
"hacks" sprinkled over all provider codebases, which is far from idealI do not know what the right solution is, but I'm proposing to revert these changes until we find a solution which ideally doesn't break most providers'
go get
UX.