firebase / firebase/firebase-functions

onRequest doesn't support setting `Execution Environment`

Open
#1,756 5 comments 0 reactions 0 assignees View on GitHub
feature request needs-attention
Dominant language
TypeScript
Stars
1.1k
Forks
232
Avg merge
20h 46m
Merged PRs (30d)
15

Description

### Related issues
Not that I could find searching for execution environment or deployment args - sorry if I missed something!

### [REQUIRED] Version info

**node:**
v22.17.0

**firebase-functions:**
6.6.0
**firebase-tools:**
14.20.0

**firebase-admin:**
13.5.0
### [REQUIRED] Test case

Cloud Run Functions has this `Execution Environment` setting

Image

https://cloud.google.com/run/docs/about-execution-environments

It's of course possible to [update](https://cloud.google.com/run/docs/configuring/execution-environments#setting) post-deploy, but it would be cleaner if we could co-locate these settings.

### [REQUIRED] Steps to reproduce

N/A (Feature request, not a bug)

### [REQUIRED] Expected behavior

Would be great if there was a setting (so we can keep all the settings together)

```js
onRequest({ executionEnvironment: 'gen2', otherSettings }, theFunction)
```

I could imagine it's not appealing to maintain options for every Cloud Functions setting - Not sure if this is practical either, but since this appears to be a supported argument during function deploy, maybe there could be an escape hatch to allow us to specify deploy args?

```js
onRequest({ deployArgs: { 'executionEnvironment': 'gen2' } }, theFunction)
// which would get translated into the equivalent of the `--execution-environment gen2`
```

### [REQUIRED] Actual behavior

N/A

### Were you able to successfully deploy your functions?

N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.