Skip to content

Commit 4f54e5d

Browse files
authored
fix: only show runtime config deprecation warning for user-defined config (#8963)
* fix: only show runtime config deprecation warning for user-defined config The runtime config deprecation warning was appearing for all v1 function deployments, even when users weren't using functions.config(). This was because the default Firebase config values (projectId, storageBucket) are always included in the runtime config. This fix checks if the runtime config contains any keys beyond the default 'firebase' key before showing the deprecation warning. Users who only have the default Firebase config will no longer see false positive warnings. Fixes #8925 * docs: add CHANGELOG entry for runtime config warning fix * chore: update runtime config deprecation date to March 2026 * refactor: simplify runtime config user check logic Use Object.keys().some() directly for cleaner, more readable code
1 parent 9c878bf commit 4f54e5d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- Updated untime config deprecation warning to no longer shows for v1 functions that only use default Firebase config. (#8963)
12
- Updated Data Connect emulator to v2.11.1, which:
23
- [added] Add an app watch that collects embedded GQL into the connector folder.
34
- [fixed] Handle foreign key constraint error as FailedPrecondition.

src/deploy/functions/prepareFunctionsUpload.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ async function packageSource(
101101
mode: 420 /* 0o644 */,
102102
});
103103

104-
// Log deprecation warning when runtime config is being packaged
105-
logFunctionsConfigDeprecationWarning();
104+
// Only warn about deprecated runtime config if there are user-defined values
105+
// (i.e., keys other than the default 'firebase' key)
106+
if (Object.keys(runtimeConfig).some((k) => k !== "firebase")) {
107+
logFunctionsConfigDeprecationWarning();
108+
}
106109
}
107110
await pipeAsync(archive, fileStream);
108111
} catch (err: any) {

src/functions/deprecationWarnings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { logWarningToStderr } from "../utils";
22

3-
const FUNCTIONS_CONFIG_DEPRECATION_MESSAGE = `DEPRECATION NOTICE: Action required to deploy after Dec 31, 2025
3+
const FUNCTIONS_CONFIG_DEPRECATION_MESSAGE = `DEPRECATION NOTICE: Action required to deploy after March 2026
44
55
functions.config() API is deprecated.
6-
Cloud Runtime Configuration API, the Google Cloud service used to store function configuration data, will be shut down on December 31, 2025. As a result, you must migrate away from using functions.config() to continue deploying your functions after December 31, 2025.
6+
Cloud Runtime Configuration API, the Google Cloud service used to store function configuration data, will be shut down in March 2026. As a result, you must migrate away from using functions.config() to continue deploying your functions after March 2026.
77
88
What this means for you:
99
10-
- The Firebase CLI commands for managing this configuration (functions:config:set, get, unset, clone, and export) are deprecated. These commands no longer work after December 31, 2025.
11-
- firebase deploy command will fail for functions that use the legacy functions.config() API after December 31, 2025.
10+
- The Firebase CLI commands for managing this configuration (functions:config:set, get, unset, clone, and export) are deprecated. These commands will no longer work after March 2026.
11+
- firebase deploy command will fail for functions that use the legacy functions.config() API after March 2026.
1212
1313
Existing deployments will continue to work with their current configuration.
1414

0 commit comments

Comments
 (0)