pulumi / upgrade-provider

A tool to automate provider upgrades on your local machine
6 stars 1 forks source link

index out of range [1] with length 1 when upgrading meraki provider #264

Closed mikhailshilkov closed 4 months ago

mikhailshilkov commented 5 months ago

What happened?

upgrade-provider pulumi/pulumi-meraki

fails with

Get Repo Kind
    - /Users/mikhailshilkov/go/src/github.com/pulumi/pulumi-meraki/provider/go.mod: 13050 bytes read
\ [Get Repo Kind]panic: runtime error: index out of range [1] with length 1

goroutine 82 [running]:
github.com/pulumi/upgrade-provider/upgrade.glob..func19({0x102731000?, 0x140000b0150?}, {{0x14000320280?, 0x10228ebc4?}, {0x140003223a8?, 0x1027c45c0?}})
    /Users/mikhailshilkov/go/src/github.com/pulumi/upgrade-provider/upgrade/steps.go:1131 +0x88
github.com/pulumi/upgrade-provider/upgrade.init.Func11[...].func11({{0x14000320280?, 0x4?}, {0x140003223a8?, 0x102280798?}})
    /Users/mikhailshilkov/go/src/github.com/pulumi/upgrade-provider/step/v2/calls.go:160 +0x34
reflect.Value.call({0x102791940?, 0x140001202e8?, 0x1499d1e88?}, {0x10264416a, 0x4}, {0x14000426150, 0x2, 0x0?})
    /opt/homebrew/Cellar/go/1.21.6/libexec/src/reflect/value.go:596 +0x994
reflect.Value.Call({0x102791940?, 0x140001202e8?, 0x140000c2d38?}, {0x14000426150?, 0x0?, 0x200000003?})
    /opt/homebrew/Cellar/go/1.21.6/libexec/src/reflect/value.go:380 +0x94
github.com/pulumi/upgrade-provider/step/v2.run.func2()
    /Users/mikhailshilkov/go/src/github.com/pulumi/upgrade-provider/step/v2/step.go:198 +0x774
created by github.com/pulumi/upgrade-provider/step/v2.run in goroutine 37
    /Users/mikhailshilkov/go/src/github.com/pulumi/upgrade-provider/step/v2/step.go:158 +0x1f8

This is because the upstream provider has a unexpected module name of terraform-provider-meraki without the github.com/<org> part. Our parsing does not expect that and fails.

We should probably stop panic'ing and give a user-friendly error.

Relatedly, how do I fix this for this specific provider? Specify upstream-provider-org: cisco-open somewhere in ci-mgmt?

Example

see above

Output of pulumi about

irrelevant

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

iwahbe commented 5 months ago

I agree we should improve the error message here.

I'm not aware of a way to work around this issue at this time, beyond https://github.com/cisco-open/terraform-provider-meraki/pull/41.