Hi, each month (minimum) I execute the upgrade-pro...
# package-authoring
t
Hi, each month (minimum) I execute the upgrade-provider script in order to do the resync between our TF provider and the pulumi bridge one, and unfortunately during the execution of the
upgrade-provider --major ovh/pulumi-ovh
command, it fails. We need to do an upgrade to a major version (1.6.0 to 2.0.0) and it seems that the
.ci-mgmt.yaml
is missing. What is this file? Do we need it? :) Thanks πŸ™‚
And why does a major upgrade is different to a minor upgrade? In my point of view, for our provider, it’s just a different tag.
CC @adorable-house-61348
a
Hi @thankful-match-46035, sorry you hit this! Major upgrades are manual because they require some additional steps which
upgrade-provider
doesn't handle. Looks like we have a regression in upgrade-provider. It shouldn't require ci-mgmt, which is something we use for managing our providers. Can you please try with an upgrade-provider commit from before the bug, say
773f438d82f96ad12a3f1e132fa8b08ae93366f4
? Does that do the job? Note that you also need to manually update the Go module references as well as the README files:
Copy code
1. Change all version references to the new version in the codebase, e.g in
   `provider/cmd/pulumi-resource-${PROVIDER}/main.go`:

    ```go
    import (
      "<http://github.com/pulumi/pulumi-${PROVIDER}/provider/v${NEXT_VERSION}|github.com/pulumi/pulumi-${PROVIDER}/provider/v${NEXT_VERSION}>"
      "<http://github.com/pulumi/pulumi-${PROVIDER}/provider/v${NEXT_VERSION}/pkg/version|github.com/pulumi/pulumi-${PROVIDER}/provider/v${NEXT_VERSION}/pkg/version>"
    )
    ```
Also opened https://github.com/pulumi/upgrade-provider/issues/309 to track the fix to upgrade-provider
t
With a
go install <http://github.com/pulumi/upgrade-provider@773f438d82f96ad12a3f1e132fa8b08ae93366f4|github.com/pulumi/upgrade-provider@773f438d82f96ad12a3f1e132fa8b08ae93366f4>
command, the script is running now. I’m trying to upgrade to the major version now 🀞
@adorable-house-61348 I have an issue , caused by the terraform-provider-ovh Go module that changed to terraform-provider-ovh/v2 πŸ˜… I changed some fields on resources/go, go.mod also but I have a blocking issue. Branch: https://github.com/ovh/pulumi-ovh/tree/upgrade-terraform-provider-ovh-to-v2.0.0-major
Almost every upgrade provider is a challenge, it's rare when everything is working 😒 In this case the script has a regression. And I have to imagine what can I change when a Terraform provider upgrade it's module version to /v2 Do you have some major upgrade guides? And can you help me on this issue? Thank you
ping 😊
a
Hi, what's the latest status here? How far did you get with the provider upgrade?
t
Hi I'm still blocked since 2.0.0 upgrade.
a
What is blocking you?
the TF provider go module version have been upgraded to v2
a
I see. Did you try upgrading without the
upgrade-provider
tool? It automates a few steps for you but isn't really necessary
t
with upgrade-provider tool
I tried only with the script
a
Can you try without it? You should be able to update the TF provider version you depend on and bump all the
go
dependencies to
/v2
After that re-running
make tfgen build_sdks
should do the right thing for the sdks
t
ok thx, I'll do after my lunch break 😊 🀞
a
Awesome, thanks, let me know how it goes. Note also that there is a
TFProviderModuleVersion
field on the
ProviderInfo
in
resources.go
As well as in the
provider/go.mod
:
module <http://github.com/pulumi/pulumi-${PROVIDER}/provider/v2|github.com/pulumi/pulumi-${PROVIDER}/provider/v2>
Should be update to point to
v2
t
I already added the TFProviderModuleVersion in resources.go
And I already updated go.mod with the v2 version of the TF provider
Oh you recommend to update the module version of the pulumi provider too? or only the dependency?
a
It should probably be a major version in the pulumi provider too
Assuming this upgrade has breaking changes which caused the TF provider to make a major version
t
After eating, I'll try to upgrade the module too of the pulumi provider 🀞
Have you a migrate to vx module in a working example in an existing pulumi terraform bridge provider?
Finally, I (thinks I) succeeded to upgrade to 2.0.0 (the TF provider and the pulumi module version everywhere) sdk built βœ… I upgraded the branch I will try to execute the GH action 🀞 πŸ§™ But FYI, if I execute again the upgrade script, the script is no working (same issue like before)
Finally! After several other problems, the provider is uptodate (for now πŸ˜„ )
a
Awesome, glad to hear!