Skip to content

docs(storage-resize-images): document FUNCTION_DEFAULT_REGION - #3307

Draft
IzaakGough wants to merge 2 commits into
kitsfrom
docs/kits-resize-images-function-region
Draft

IzaakGough wants to merge 2 commits into
kitsfrom
docs/kits-resize-images-function-region

Conversation

@IzaakGough

Copy link
Copy Markdown
Contributor

Fixes #3274.

The README said FUNCTION_DEFAULT_REGION is never read and that an empty BUCKET_REGION keeps the deployed region. Neither is true in an installed project, so users could not predict where the function would deploy.

This documents FUNCTION_DEFAULT_REGION as the fallback when BUCKET_REGION is empty, and adds it to the configuration table.

Based on the CLI's install and migrate templates and the deploys measured in the issue. Not redeployed for this change.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the README.md for the storage-resize-images kit to document the FUNCTION_DEFAULT_REGION environment variable and clarify its behavior alongside BUCKET_REGION. Feedback suggests correcting the documentation for FUNCTION_DEFAULT_REGION to show it as optional and not prompted, as it is only a fallback and not defined in config.ts.

| Field | Env var | Required | Default | Description |
| ---------------------- | ------------------------ | -------- | ---------------------- | ------------------------------------------------------------------------------------------ |
| `bucketRegion` | `BUCKET_REGION` | yes | (prompted) | Cloud Storage bucket location; also places the function |
| (none) | `FUNCTION_DEFAULT_REGION` | yes | (prompted) | Function region when `BUCKET_REGION` is empty ([details](#bucket_region-decides-where-the-function-runs)) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Marking FUNCTION_DEFAULT_REGION as Required: yes and Default: (prompted) is misleading. Since it is not defined as a parameter in config.ts, the Firebase CLI will not prompt for it during a regular deploy if it is missing from .env. Additionally, it is only used as a fallback when BUCKET_REGION is empty, so it is not strictly required for the kit to function.

Suggested change
| (none) | `FUNCTION_DEFAULT_REGION` | yes | (prompted) | Function region when `BUCKET_REGION` is empty ([details](#bucket_region-decides-where-the-function-runs)) |
| (none) | <code>FUNCTION_DEFAULT_REGION</code> | no | (empty) | Function region when <code>BUCKET_REGION</code> is empty ([details](#bucket_region-decides-where-the-function-runs)) |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant