pulumi / upgrade-provider

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

upgrade-provider fails to update upstream provider with "Patch format detection failed." #273

Closed VenelinMartinov closed 1 month ago

VenelinMartinov commented 1 month ago

What happened?

Multiple provider upgrades have failed with that message:

https://github.com/pulumi/pulumi-http/actions/runs/10191391040/job/28192600408 https://github.com/pulumi/pulumi-archive/actions/runs/10191360974/job/28192527503 https://github.com/pulumi/pulumi-digitalocean/actions/runs/10209465965/job/28247518199

Seems likely to be a result of tooling changes.

Example

.

Output of pulumi about

.

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 1 month ago

This is the result of a tooling change, specifically the move to upstream.sh which uses git am instead of git apply for the common case. The previous setup would allow git diff based patches for make init, but would then fail to apply make upstream.rebase unless a git am compatible patch was used.

While the error message is pretty bad, this forces us to use a richer patch representation and is better for our providers in the long run.

iwahbe commented 1 month ago

I expect that all providers that have encountered this issue have a single patch that originated from a fork. By appending the following to the 0000-fork.patch, we can fix the issue:

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ian Wahbe <ian@wahbe.com>
Date: Mon, 5 Aug 2024 12:21:14 +0200
Subject: [PATCH] fork
iwahbe commented 1 month ago

All Pulumi providers are up to date. I'm closing as "by-design".