pulumi / upgrade-provider

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

Could not determine an upstream version #198

Closed t0yv0 closed 1 year ago

t0yv0 commented 1 year ago

What happened?

AWS: ff40da2f970359b77452b2ea16daf87ea0d0d1bf upgrade-provider: b0aa77c75695980e4d188e1ea9df7a3e6be4d215

upgrade-provider pulumi/pulumi-aws --kind provider --target-version v5.25.0                                                             ~/code/pulumi-aws
---- Setting Up Environment ----
- ✓ GOWORK="off": done
- ✓ PULUMI_MISSING_DOCS_ERROR="true": done
- ✓ PULUMI_CONVERT_EXAMPLES_CACHE_DIR="": done
--- Discover Provider --- 
  - Ensure Upstream Repo
    - Expected Location: /Users/t0yv0/code/pulumi-aws
      - GetCwd: /Users/t0yv0/code/pulumi-aws
    - Repo Exists
      - Stat
    - Validate Repository
      - git: /usr/bin/git status --short
--- done ---
---- Discovering Repository ----
- pull default branch
  - ✓ /usr/bin/git ls-remote --heads origin: done
  - ✓ finding default branch: master
  - ✓ /usr/bin/git fetch: done
  - ✓ /usr/bin/git checkout master: done
  - ✓ /usr/bin/git pull origin: done
- ✓ Repo kind: patched
- X Planning Provider Update: could not determine an upstream version
[1] t0yv0@Antons-MacBook-Pro> upgrade-provider pulumi/pulumi-aws --kind provider --target-version 5.25.0                                                          ~/code/pulumi-aws
---- Setting Up Environment ----
- ✓ GOWORK="off": done
- ✓ PULUMI_MISSING_DOCS_ERROR="true": done
- ✓ PULUMI_CONVERT_EXAMPLES_CACHE_DIR="": done
--- Discover Provider --- 
  - Ensure Upstream Repo
    - Expected Location: /Users/t0yv0/code/pulumi-aws
      - GetCwd: /Users/t0yv0/code/pulumi-aws
    - Repo Exists
      - Stat
    - Validate Repository
      - git: /usr/bin/git status --short
--- done ---
---- Discovering Repository ----
- pull default branch
  - ✓ /usr/bin/git ls-remote --heads origin: done
  - ✓ finding default branch: master
  - ✓ /usr/bin/git fetch: done
  - ✓ /usr/bin/git checkout master: done
  - ✓ /usr/bin/git pull origin: done
- ✓ Repo kind: patched
- X Planning Provider Update: could not determine an upstream version

Example

Not having luck updating pulumi-aws, even specifying the version manually.

Output of pulumi about

N/A

Additional context

N/A

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

t0yv0 commented 1 year ago

I figured out what's the problem here. There's an implicit parameter in '.upgrade-config.yml':

pulumi-infer-version: true

It's not documented in upgrade-provider --help and there's no way to unset it once it gets implicitly set. It took me some interesting bisect debugging to figure this out.

Once this parameter is set, --target-version is ignored in favor of doing a search on the repo.

This is pretty complicated and unexpected for the user. Consider making some changes so that when the user specifies an explicit version that's what the provider gets upgraded to.

For now I can workaround my scenario by editing .upgrade-config.yml

iwahbe commented 1 year ago

Sorry about the problem and thanks for investigating. #202 will fix this. It's just waiting on review now.