Skip to content

Add deprecation warnings for functions.config() API #8808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Jul 3, 2025

Summary

Add deprecation warnings for functions.config() API ahead of Cloud Runtime Configuration API shutdown on Dec 31, 2025.

Changes

  • Add dangerouslyAllowFunctionsConfig experiment (defaults to true)
  • Show deprecation warning on all functions:config:* commands
  • Show deprecation warning during deploy when runtime config is packaged
  • Warning includes migration deadline and documentation link

taeold added 2 commits July 2, 2025 19:05
### Description
Implement deprecation warnings for the functions.config() API ahead of the Cloud Runtime Configuration API shutdown on December 31, 2025.

### Changes
- Add dangerouslyAllowFunctionsConfig experiment (defaults to true)
- Create centralized deprecation warning module
- Add warnings to all functions:config:* CLI commands
- Add warning during deploy when runtime config is packaged

### Scenarios Tested
- All functions:config:* commands show deprecation warning after execution
- Deploy flow shows warning when .runtimeconfig.json is generated
- Warnings are non-blocking (Phase 1 - awareness only)

### Sample Commands
- firebase functions:config:get
- firebase functions:config:set foo.bar=baz
- firebase deploy --only functions (with existing runtime config)
Update deprecation warning to include comprehensive information about:
- Action required by Dec 31, 2025
- What the deprecation means for users
- Impact on CLI commands and deployments
- Link to migration documentation
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @taeold, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces deprecation warnings for the functions.config() API within the Firebase CLI. The primary goal is to inform users about the upcoming shutdown of the underlying Cloud Runtime Configuration API by December 31, 2025, and guide them towards migration. It also provides a temporary experiment flag to allow continued use during the transition period.

Highlights

  • Deprecation Warning Implementation: Integrated a new deprecation warning message into all functions:config:clone, functions:config:get, functions:config:set, and functions:config:unset CLI commands.
  • Deployment Warning: Added a deprecation warning that triggers during the firebase deploy process if the deployed functions package includes runtime configuration data.
  • New Experiment Flag: Introduced dangerouslyAllowFunctionsConfig as a new experiment flag, defaulting to true, to temporarily allow the use of the deprecated functions.config() API during the migration phase.
  • Centralized Warning Message: Created a new utility file (src/functions/deprecationWarnings.ts) to centralize the detailed deprecation message, including the migration deadline and a link to the official documentation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds deprecation warnings for the functions.config() API. The experiment flag dangerouslyAllowFunctionsConfig should be enforced, and multi-line strings can be improved with template literals.

Comment on lines +60 to +67
dangerouslyAllowFunctionsConfig: {
shortDescription: "Allows the use of deprecated functions.config() API",
fullDescription:
"The functions.config() API is deprecated and will be removed on December 31, 2025. " +
"This experiment allows continued use of the API during the migration period.",
default: true,
public: true,
},

Choose a reason for hiding this comment

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

critical

The dangerouslyAllowFunctionsConfig experiment is defined but not enforced. The functions:config:* commands and deployment logic should be gated by experiments.assertEnabled("dangerouslyAllowFunctionsConfig", "use functions.config() API") to ensure the experiment functions as intended.

Comment on lines 3 to 11
const FUNCTIONS_CONFIG_DEPRECATION_MESSAGE =
"DEPRECATION NOTICE: Action required to deploy after Dec 31, 2025\n" +
" functions.config() API is deprecated.\n" +
" 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.\n" +
" What this means for you:\n" +
" 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.\n" +
" firebase deploy command will fail for functions that use the legacy functions.config() API after December 31, 2025.\n" +
" Existing deployments will continue to work with their current configuration.\n" +
" See your migration options at: https://firebase.google.com/docs/functions/config-env#migrate-to-dotenv";

Choose a reason for hiding this comment

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

medium

Consider using a template literal for this multi-line string to improve readability.

Suggested change
const FUNCTIONS_CONFIG_DEPRECATION_MESSAGE =
"DEPRECATION NOTICE: Action required to deploy after Dec 31, 2025\n" +
" functions.config() API is deprecated.\n" +
" 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.\n" +
" What this means for you:\n" +
" 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.\n" +
" firebase deploy command will fail for functions that use the legacy functions.config() API after December 31, 2025.\n" +
" Existing deployments will continue to work with their current configuration.\n" +
" See your migration options at: https://firebase.google.com/docs/functions/config-env#migrate-to-dotenv";
const FUNCTIONS_CONFIG_DEPRECATION_MESSAGE = `DEPRECATION NOTICE: Action required to deploy after Dec 31, 2025
functions.config() API is deprecated.
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.
What this means for you:
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.
firebase deploy command will fail for functions that use the legacy functions.config() API after December 31, 2025.
Existing deployments will continue to work with their current configuration.
See your migration options at: https://firebase.google.com/docs/functions/config-env#migrate-to-dotenv`;

@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 51.92%. Comparing base (609bb02) to head (838dccd).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
src/deploy/functions/prepareFunctionsUpload.ts 50.00% 1 Missing ⚠️
src/functions/deprecationWarnings.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8808      +/-   ##
==========================================
- Coverage   51.97%   51.92%   -0.05%     
==========================================
  Files         407      409       +2     
  Lines       30315    30401      +86     
  Branches     6276     6287      +11     
==========================================
+ Hits        15755    15786      +31     
- Misses      13143    13199      +56     
+ Partials     1417     1416       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants