Repository navigation
Description
[REQUIRED] Environment info
firebase-tools: 15.37.0
Platform: macOS
[REQUIRED] Test case
firebase.json:
{
"functions": [
{ "source": "functions", "codebase": "default", "runtime": "nodejs22" }
]
}functions/index.js (firebase-functions 7.4.0):
const { onRequest } = require("firebase-functions/v2/https");
exports.hello = onRequest((req, res) => res.send(process.version));[REQUIRED] Steps to reproduce
- Run
firebase deploy --only functions. The function is created on Node.js 22. - In
firebase.json, change only"runtime"to"nodejs24". Do not touch anything infunctions/. - Run
firebase deploy --only functionsagain. - Call the function, or run
gcloud functions describe hello --region us-central1 --format='value(buildConfig.runtime)'.
[REQUIRED] Expected behavior
The function is updated to Node.js 24, the same as when the function is targeted directly (--only functions:hello).
[REQUIRED] Actual behavior
The deploy skips the function and reports success. The function stays on Node.js 22. Output from my run, where the function was REPRO_scan_rt in codebase repro-scan-rt:
i functions: Skipping the deploy of unchanged functions.
✔ functions[repro-scan-rt:REPRO_scan_rt(us-central1)] Skipped (No changes detected)
✔ Deploy complete!
Afterwards the function responds with v22.23.4, and gcloud functions describe shows buildConfig.runtime as nodejs22. Running firebase deploy --only functions:repro-scan-rt then does update it (v24.22.1, nodejs24).
Python behaves the same way. With "runtime": "python311" deployed, changing it to "python313" in firebase.json and recreating the venv with Python 3.13 gives:
i functions: Skipping the deploy of unchanged functions.
✔ functions[repro-scan-py:REPRO_scan_py(us-central1)] Skipped (No changes detected)
The function still runs Python 3.11.18 (buildConfig.runtime is python311). Targeting it with --only updates it to 3.13.15. For Python, firebase.json is the only documented way to set the runtime, so there is no package.json alternative.
The docs present firebase.json as a supported way to set the runtime ("you can set the runtime for the Firebase SDK for Cloud Functions in firebase.json instead", and "The CLI uses the value set in firebase.json in preference to any value or range that you set separately in package.json"), and do not mention that changing it can be skipped.
Cause: A function is skipped when its hash matches the deployed one, and the hash covers only the source archive, the env vars and the secret versions (src/deploy/functions/cache/hash.ts):
export function getEndpointHash(sourceHash?: string, envHash?: string, secretsHash?: string): string {
const combined = [sourceHash, envHash, secretsHash].filter((hash) => !!hash).join("");
return createHash(combined);
}runtime comes from firebase.json, which is not part of the source archive, so changing it does not change the hash. For Node.js, changing engines.node in package.json as well changes the hash and the function is updated.
Workaround: Target the functions explicitly (firebase deploy --only functions:<name>). For Node.js, changing engines.node in package.json together with firebase.json also works.
Activity
Ultranmus commentedon Nov 26, 2026
Hi @IzaakGough, thanks for the thorough report and for pointing at
getEndpointHash.I opened #11599. Instead of adding the runtime to the hash, which would change every function's hash and redeploy everything once after upgrading, the skip check now also compares the local runtime with the deployed one (
buildConfig.runtime/runtime). If they differ, the function is deployed and the source is uploaded. If the deployed runtime is unknown, the existing behavior is kept. This covers both the Node.js and Python cases.