Skip to content

feat: add built-in functionRegion parameter for region#1928

Open
inlined wants to merge 2 commits into
masterfrom
ultima-rocket-spins-20h39
Open

feat: add built-in functionRegion parameter for region#1928
inlined wants to merge 2 commits into
masterfrom
ultima-rocket-spins-20h39

Conversation

@inlined

@inlined inlined commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

GCF v2 does not include the FUNCTION_REGION environment variable by default, which can break some workflows. In particular, Firebase Extensions may depend on this variable to target callable or task queue functions in the same region. This change adds the functionRegion built-in parameter (and region alias) to the SDK.

Scenarios Tested

  • Unit tests for value extraction and CEL representation.

relnote: Add functionRegion built-in parameter for region

@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 introduces a new built-in parameter functionRegion (and its alias region) to resolve the Cloud region from the FUNCTION_REGION environment variable, along with corresponding unit tests and CEL expression tests. The reviewer suggests wrapping the environment variable cleanup in a try...finally block within the unit tests to prevent potential test pollution if assertions fail.

Comment thread spec/params/params.spec.ts
@inlined
inlined force-pushed the ultima-rocket-spins-20h39 branch from b8c90b3 to d27725f Compare July 16, 2026 04:39
inlined added 2 commits July 16, 2026 09:42
### Description
GCF v2 does not include the FUNCTION_REGION environment variable by default, which can break some workflows. In particular, Firebase Extensions may depend on this variable to target callable or task queue functions in the same region. This change adds the `functionRegion` built-in parameter (and `region` alias) to the SDK.

### Scenarios Tested
- Unit tests for value extraction and CEL representation.

### Sample Commands
- N/A (SDK library)
@inlined
inlined force-pushed the ultima-rocket-spins-20h39 branch from 4ee75da to b94dfb1 Compare July 16, 2026 16:42

@shettyvarun268 shettyvarun268 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.

LGTM

Comment thread src/params/index.ts
* A built-in parameter that resolves to the Cloud region, without prompting
* the deployer. Alias for {@link functionRegion}.
*/
export const region: Param<string> = functionRegion;

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.

For my own learning... why do we need a region alias of this?

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.

4 participants