Skip to content

Migrate off functions.config() + move functions to Node 24 - #1676

Merged
HugoGresse merged 9 commits into
mainfrom
chore/node24-migrate-functions-config
Jun 14, 2026
Merged

Migrate off functions.config() + move functions to Node 24#1676
HugoGresse merged 9 commits into
mainfrom
chore/node24-migrate-functions-config

Conversation

@HugoGresse

@HugoGresse HugoGresse commented Jun 14, 2026

Copy link
Copy Markdown
Owner

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 from process.env via functions/.env* files — no functions.config() calls remain in source. This PR finishes the migration:

  • e2e CI (test-e2e.yml): stop writing the legacy .runtimeconfig.json; convert the nested config secret into functions/.env.local (the dotenv the emulator loads) with jq. Reuses the existing RUNTIME_CONFIG_TEST secret.
  • Docs (1-install.mdx): functions:config:set / runtimeconfig.env instructions.
  • userInvite trigger: drop the stale functions:config:get comment.

Node 24 (functions runtime)

functions/package.json engines.node24 (the Cloud Functions deploy runtime).

.nvmrc stays on 20: it drives the whole-repo CI/build toolchain, and Node 24's npm 11 rejects the npm-10 lockfiles (npm ci fails on rollup/esbuild optional deps). The build/test toolchain doesn't need Node 24; only the deployed runtime does. No engine-strict, so engines=24 under CI-node-20 is just a warning.

⚠️ Deploy caveat: nodejs24 is GA on Cloud Functions, but firebase-tools ≤ 15.20.0 (current latest) caps deploy validation at nodejs22. Until firebase-tools adds nodejs24, firebase deploy rejects it — deploy via gcloud functions deploy --runtime nodejs24, or bump firebase-tools when it ships support. Say the word and I'll drop to nodejs22 to keep firebase deploy working today.

Verified

Functions build ✓ · tests 47/47 ✓ · lint ✓ · jq dry-run ✓

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>
Copilot AI review requested due to automatic review settings June 14, 2026 16:21
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.json and instead generate functions/.env.local from 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.json engines.node and 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.

Comment thread functions/package.json
Comment thread docs/app/1-install.mdx Outdated
Comment thread docs/app/1-install.mdx Outdated
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

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>
@cypress

cypress Bot commented Jun 14, 2026

Copy link
Copy Markdown

open-feedback    Run #3059

Run Properties:  status check passed Passed #3059  •  git commit 1df467ec6a: Migrate off functions.config() + move functions to Node 24 (#1676)
Project open-feedback
Branch Review main
Run status status check passed Passed #3059
Run duration 02m 24s
Commit git commit 1df467ec6a: Migrate off functions.config() + move functions to Node 24 (#1676)
Committer Hugo Gresse
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 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>
@HugoGresse HugoGresse changed the title Migrate off functions.config() + bump functions to Node 24 Migrate off functions.config() + bump functions to Node 22 Jun 14, 2026
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>
@HugoGresse HugoGresse changed the title Migrate off functions.config() + bump functions to Node 22 Migrate off functions.config() + move functions to Node 24 Jun 14, 2026
@HugoGresse

Copy link
Copy Markdown
Owner Author

Heads-up: the e2e job is expected to be red here

The Cypress job fails at functions-emulator startup with:

FirebaseError: Detected node engine 24 in package.json, which is not a supported version. Valid versions are 20, 22

This is not a regression in the diff. nodejs24 is GA on Cloud Run and is already in firebase-tools master, but the latest published firebase-tools (15.20.0, what npm install pulls) doesn't allow it yet, so the emulator refuses to load the functions and the voting e2e times out.

Build + unit tests are green; npm ci works on Node 24 (lockfiles regenerated for npm 11).

Options to get e2e green:

  • pin firebase-tools to master (has nodejs24) — fragile, revert once a release ships, or
  • temporarily set functions/package.json engines.node back to 22 until firebase-tools releases nodejs24.

HugoGresse and others added 4 commits June 14, 2026 19:09
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>
@HugoGresse
HugoGresse merged commit 1df467e into main Jun 14, 2026
10 checks passed
@HugoGresse
HugoGresse deleted the chore/node24-migrate-functions-config branch June 14, 2026 18:22
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.

Migrate functions config

2 participants