diff --git a/kits/storage-resize-images/CHANGELOG.md b/kits/storage-resize-images/CHANGELOG.md index 6729d6545..94e6b7cb7 100644 --- a/kits/storage-resize-images/CHANGELOG.md +++ b/kits/storage-resize-images/CHANGELOG.md @@ -1,3 +1,4 @@ +- 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: the "Off (No filtering)" content-filter option now stores `OFF` instead of `False`, which the resolver rejected, so every storage event threw `Invalid HarmBlockThreshold: False`. A `.env` written by an earlier deploy keeps the stored value on upgrade: if it carries `CONTENT_FILTER_LEVEL=False`, edit it to `OFF` (or re-select the option). - fix: the "original" image-type option now stores `false` instead of `False`. The resize path treated `False` as a target format, so each resized file was uploaded as `_.False` with no content type and reported as a success. A stored `IMAGE_TYPE=["False"]` likewise needs editing to `["false"]`. - 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. diff --git a/kits/storage-resize-images/src/config.ts b/kits/storage-resize-images/src/config.ts index 63c25e0cc..27b86a35a 100644 --- a/kits/storage-resize-images/src/config.ts +++ b/kits/storage-resize-images/src/config.ts @@ -186,7 +186,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 c6ce6998d..5d88f70a7 100644 --- a/kits/storage-resize-images/tests/config.test.ts +++ b/kits/storage-resize-images/tests/config.test.ts @@ -377,3 +377,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 }, + ]); + }); +});