From ffa85f0109e2daa185b75b5bdf3617a18758a212 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sat, 21 Mar 2026 20:41:55 +0000 Subject: [PATCH] fix(ci): reserialize dynamic providers before refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split `make up` into two phases: a plain `pulumi up` first, then `pulumi up --refresh`. Dynamic providers serialize their implementation into state at create/update time. During refresh, the serialized `read()` runs — so any provider-code change (like the Discord 429 retry logic) doesn't take effect until a successful update writes the new `__provider` to state. Running refresh first used the stale serialized code from the last successful deploy, which had no rate-limit handling, failing on parallel Discord member lookups. Also bump discordFetch maxRetries from 5 to 10 for headroom against ~68 parallel refresh reads. --- Makefile | 4 ++++ src/discord.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 324ab1b..0272401 100644 --- a/Makefile +++ b/Makefile @@ -16,4 +16,8 @@ refresh: login ## Refresh state to match reality PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi refresh --yes --stack prod up: login ## Deploy infrastructure (with refresh to detect drift, e.g. expired org invites) + # Dynamic providers serialize their implementation into state. Run a plain + # `up` first so any provider-code changes are captured, then refresh with the + # freshly serialized `read()`. Otherwise refresh runs stale code and fails. + PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi up --yes --stack prod PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi up --refresh --yes --stack prod diff --git a/src/discord.ts b/src/discord.ts index 99896c2..2c50ad3 100644 --- a/src/discord.ts +++ b/src/discord.ts @@ -34,7 +34,7 @@ async function discordFetch( token: string, endpoint: string, options: RequestInit = {}, - maxRetries = 5 + maxRetries = 10 ): Promise { let lastError: Error | undefined;