Migrate off functions.config() + move functions to Node 24 - #1676
Conversation
Closes #1669. functions.config() / Cloud Runtime Config is deprecated (shuts down March 2027). The function code already reads everything from process.env via functions/.env* files, so this finishes the migration in the remaining places that still referenced the legacy config: - e2e CI: stop writing the legacy .runtimeconfig.json; convert the nested config secret into functions/.env.local (the dotenv the emulator loads) with jq. - docs/install: replace `firebase functions:config:set` / `functions:config:get > .runtimeconfig.json` with .env instructions. - userInvite trigger: drop the stale functions:config:get comment. Also bump the functions runtime to Node 24 (engines.node + .nvmrc). Note: nodejs24 is GA on Cloud Functions, but firebase-tools <= 15.20.0 (current latest) still caps deploy validation at nodejs22. Until a firebase-tools release adds nodejs24, deploy the functions with `gcloud functions deploy --runtime nodejs24` (or bump firebase-tools once it supports it); plain `firebase deploy` will reject the runtime. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumping .nvmrc to 24 put all CI (frontend build + e2e) on Node 24 / npm 11, whose stricter `npm ci` rejected the npm-10-generated lockfiles (missing @rollup platform optional deps, esbuild version drift) and broke the e2e job. The function runtime is set by functions/package.json engines.node (24), which Firebase uses for the deploy target; the build/test toolchain doesn't need Node 24. Reverting .nvmrc to 20 unblocks CI while the functions still deploy as nodejs24. No engine-strict is set, so the engines=24 vs CI-node-20 mismatch is only a non-fatal npm warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR completes the migration away from deprecated functions.config()/Runtime Config references by switching remaining CI/docs/testing guidance to dotenv + process.env, and it updates the Functions runtime/dev Node version to 24.
Changes:
- Updated E2E workflow to stop generating
.runtimeconfig.jsonand instead generatefunctions/.env.localfrom the existing nested Runtime Config secret. - Updated installation docs and inline trigger comments to document/use dotenv-based configuration rather than
firebase functions:config:*. - Bumped Node version to 24 via
functions/package.jsonengines.nodeand the repo.nvmrc.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
functions/src/triggers/invites/userInvite.ts |
Updates local testing comment to reflect env/dotenv-based config instead of Runtime Config export. |
functions/package.json |
Bumps Functions Node engine to 24 (runtime/dev alignment). |
docs/app/1-install.mdx |
Replaces functions:config:* setup with dotenv/env-var guidance for Mailgun/OpsGenie/admin contact email. |
.nvmrc |
Updates repo-wide Node version to 24. |
.github/workflows/test-e2e.yml |
Generates functions/.env.local via jq instead of writing .runtimeconfig.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit the preview URL for this PR (updated for commit 399221e): https://open-feedback-42--pr1676-chore-node24-migrate-1klue7hu.web.app (expires Sun, 21 Jun 2026 17:58:57 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 08b588459ed3335bea4061fbe93b8b77635ad43a |
- functions/.gitignore: ignore every `.env*` (incl per-project `.env.<project-id>` used on deploy) except the tracked `.env.default` placeholder, so contributors can't accidentally commit secrets. - docs: drop the incorrect "created automatically on first deploy" claim (functions read process.env directly, no params, so the CLI won't generate the file) and add a gitignore/secrets callout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
open-feedback
|
||||||||||||||||||||||||||||
| Project |
open-feedback
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 02m 24s |
| Commit |
|
| Committer | Hugo Gresse |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
3
|
|
|
0
|
|
|
0
|
|
|
14
|
| View all changes introduced in this branch ↗︎ | |
engines.node=24 breaks firebase-tools at function load time — both the emulator and deploy reject it: FirebaseError: Detected node engine 24 in package.json, which is not a supported version. Valid versions are 20, 22 This surfaced as an e2e failure: the functions emulator refused to load, so vote aggregation never ran and feedback/talk.spec.js timed out. nodejs24 is GA on Cloud Functions, but no released firebase-tools (latest 15.20.0) supports it yet, so 22 is the highest usable runtime. Revisit 24 once firebase-tools ships nodejs24 support. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Per request, target Node 24 everywhere: functions/package.json engines.node=24 and root .nvmrc=24 (frontend/CI toolchain). Regenerated root + functions package-lock.json with npm 11 (Node 24) so `npm ci` stays green under the new toolchain — the previous npm-10 locks were missing @rollup/@esbuild platform optional deps and lagged esbuild 0.25.11 vs 0.25.12, which npm 11 rejects. Known limitation: the latest published firebase-tools (15.20.0) does not yet allow nodejs24 (master does), so the functions emulator/deploy will reject it until a firebase-tools release ships nodejs24 support — the e2e job that loads functions in the emulator will fail until then. nodejs24 itself is GA on Cloud Run. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Heads-up: the e2e job is expected to be red hereThe Cypress job fails at functions-emulator startup with:
This is not a regression in the diff. Build + unit tests are green; Options to get e2e green:
|
The functions emulator under the published firebase-tools (<= 15.20.0)
rejects engines.node=24 ("Valid versions are 20, 22"), so the Cypress
e2e couldn't load the functions. Install a firebase-tools build from
main (which has nodejs24, GA) just for the e2e job via a direct
git+https install (--no-save, no lockfile/ssh involvement), and disable
the Cypress action's own npm ci so the overlay survives.
Scoped to e2e only; the repo dependency stays on the published
firebase-tools. Remove once a firebase-tools release ships nodejs24.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The firebase-tools main build (overlaid for nodejs24 support) requires JDK 21+ to run the Firestore/Auth emulators; the runner's default Java was older, so the emulator never started and wait-on timed out. Add setup-java@v4 (temurin 21) before the emulators start. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The repo was pinned to firebase-tools ^14.23.0, whose emulator rejects the nodejs24 runtime — that was the real e2e failure, not a missing release. The published firebase-tools 15.20.0 already supports nodejs24 (GA), so bump to it and remove the fragile git+https build-from-main overlay and the cypress install:false workaround. Keep setup-java@21: firebase-tools 15.x requires JDK 21+ for the emulators (MIN_SUPPORTED_JAVA_MAJOR_VERSION=21), which 14.x did not. With 15.20.0, `firebase deploy` also accepts nodejs24 — the earlier deploy caveat no longer applies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`npm test` runs the Firestore emulator via firebase-tools, which now requires JDK 21+. Add setup-java@21 to the build job (already added to the e2e job). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Closes #1669 and #1670
functions.config() migration
functions.config()/ Cloud Runtime Config is deprecated (shuts down March 2027). The function code already reads all config fromprocess.envviafunctions/.env*files — nofunctions.config()calls remain in source. This PR finishes the migration:test-e2e.yml): stop writing the legacy.runtimeconfig.json; convert the nested config secret intofunctions/.env.local(the dotenv the emulator loads) withjq. Reuses the existingRUNTIME_CONFIG_TESTsecret.1-install.mdx):functions:config:set/runtimeconfig→.envinstructions.functions:config:getcomment.Node 24 (functions runtime)
functions/package.jsonengines.node→24(the Cloud Functions deploy runtime)..nvmrcstays on 20: it drives the whole-repo CI/build toolchain, and Node 24's npm 11 rejects the npm-10 lockfiles (npm cifails on rollup/esbuild optional deps). The build/test toolchain doesn't need Node 24; only the deployed runtime does. Noengine-strict, so engines=24 under CI-node-20 is just a warning.nodejs24is GA on Cloud Functions, but firebase-tools ≤ 15.20.0 (current latest) caps deploy validation atnodejs22. Until firebase-tools addsnodejs24,firebase deployrejects it — deploy viagcloud functions deploy --runtime nodejs24, or bump firebase-tools when it ships support. Say the word and I'll drop tonodejs22to keepfirebase deployworking today.Verified
Functions build ✓ · tests 47/47 ✓ · lint ✓ · jq dry-run ✓