From 0e5effa5b3a7e4519703a93ef3201183d4c1e864 Mon Sep 17 00:00:00 2001 From: Izaak Gough Date: Tue, 8 Sep 2026 11:30:06 +0100 Subject: [PATCH] fix(storage-resize-images): label the IS_ANIMATED true option Yes The kit labelled it `True`; `extension.yaml` labels it `Yes`. Only the deploy-time prompt is affected, the stored values are unchanged. The param audit tests pinned option values but not labels, so add an assertion covering both. --- kits/storage-resize-images/CHANGELOG.md | 1 + kits/storage-resize-images/src/config.ts | 2 +- .../tests/config.test.ts | 22 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/kits/storage-resize-images/CHANGELOG.md b/kits/storage-resize-images/CHANGELOG.md index bddce1dca9..ed0e498d31 100644 --- a/kits/storage-resize-images/CHANGELOG.md +++ b/kits/storage-resize-images/CHANGELOG.md @@ -1,2 +1,3 @@ +- fix: the `IS_ANIMATED` "Yes" option was labelled "True" in the deploy-time prompt. The stored values are unchanged (`true`/`false`), so this is a label-only fix and no `.env` written by an earlier deploy needs editing. - fix: restore the `us-central1` content-filter fallback. `checkImageContent` threw `FUNCTION_REGION is required for Vertex AI filtering.` when no region was available; the extension fell back to `us-central1`. The Vertex AI call now uses the function's region when known and `us-central1` otherwise, matching the extension. Normal CLI deploys were unaffected (the Firebase CLI sets `FUNCTION_REGION` on deployed functions); the throw was reachable for library consumers, emulator runs, and hand-rolled environments. - Initial release of kit, see README for differences between the legacy extension and this kit diff --git a/kits/storage-resize-images/src/config.ts b/kits/storage-resize-images/src/config.ts index 9902641f79..f7e8be4346 100644 --- a/kits/storage-resize-images/src/config.ts +++ b/kits/storage-resize-images/src/config.ts @@ -202,7 +202,7 @@ const params = { description: "Keep animation of GIF and WEBP formats.", default: true, - input: select({ True: true, "No (1st frame only)": false }), + input: select({ Yes: true, "No (1st frame only)": false }), }), memory: defineInt("FUNCTION_MEMORY", { label: "Cloud Function memory", diff --git a/kits/storage-resize-images/tests/config.test.ts b/kits/storage-resize-images/tests/config.test.ts index 7ecaeef67d..80eeef0ee1 100644 --- a/kits/storage-resize-images/tests/config.test.ts +++ b/kits/storage-resize-images/tests/config.test.ts @@ -267,3 +267,25 @@ describe("validatePathListsFromEnv", () => { expect(() => validatePathListsFromEnv()).toThrow(/Invalid excludePathList/); }); }); + +/** + * The kit builds its select options from a label-to-value map, so a label + * typo is invisible to the value-only assertions above and only shows up in + * the CLI's deploy-time prompt. This pins the labels against + * `extension.yaml`'s `IS_ANIMATED` options. + */ +describe("IS_ANIMATED select", () => { + test("declares the same option labels and values as the extension", async () => { + await import("../src/config"); + const { declaredParams } = await import("firebase-functions/params"); + + const param = declaredParams.find((p) => p.name === "IS_ANIMATED") as + | { options: { input?: { select?: { options: unknown[] } } } } + | undefined; + + expect(param?.options.input?.select?.options).toEqual([ + { label: "Yes", value: true }, + { label: "No (1st frame only)", value: false }, + ]); + }); +});