Skip to content

Conversation

@taeold
Copy link
Contributor

@taeold taeold commented Oct 29, 2025

  1. Removed functions.config() Polyfill
    Removed initializeRuntimeConfig() from src/emulator/functionsEmulatorRuntime.ts. This function manually read .runtimeconfig.json and set CLOUD_RUNTIME_CONFIG env var to polyfill the logic for old clients of the Functions SDK. Functions SDK has included this feature for more than 5+ years now.

  2. Removed Callable Auth Monkey Patches
    Removed wrapCallableHandler from src/emulator/functionsEmulatorRuntime.ts. that handled manual auth header swapping logic in src/emulator/functionsEmulator.ts. We now rely on the SDK's built-in skipTokenVerification feature shipped since 3.16.0.

  3. Bumped Minimum SDK Version
    Increased minimum required firebase-functions version from 3.15.1 to 3.16.0 (launched 4+ years ago) in src/emulator/functionsEmulatorRuntime.ts. This ensures users have an SDK that supports skipTokenVerification and likely handles .runtimeconfig.json loading correctly in emulation.

@gemini-code-assist
Copy link
Contributor

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 cleans up the Firebase Functions Emulator by removing code that dealt with the deprecated functions.config() API. The change eliminates the emulator's previous attempts to monkey patch or manage this outdated configuration method, resulting in a more streamlined and modern runtime initialization process.

Highlights

  • Deprecated API Removal: The initializeFunctionsConfigHelper() function, which was responsible for monkey patching the deprecated functions.config() API, has been entirely removed from the emulator runtime.
  • Runtime Simplification: The call to the now-removed initializeFunctionsConfigHelper() has been removed from the initializeRuntime() function, simplifying the emulator's startup process.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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
Contributor

@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 correctly removes the deprecated monkey-patching for functions.config() by deleting the initializeFunctionsConfigHelper function and its usage in src/emulator/functionsEmulatorRuntime.ts. This is a good cleanup of obsolete functionality.

However, a crucial part of this change is missing: the corresponding tests for this feature have not been removed. The test suite in scripts/emulator-tests/functionsEmulatorRuntime.spec.ts still contains a describe block for _InitializeFunctionsConfigHelper(). This is a high-severity issue as it leaves the codebase with obsolete tests, which can cause confusion and potential failures in the future. Please remove these tests to complete this refactoring.

…le auth

- Removed initializeRuntimeConfig() polyfill in functionsEmulatorRuntime.ts.
- Bumped minimum required firebase-functions SDK version to 3.16.0.
- Removed manual auth header swapping for callable functions in functionsEmulator.ts, relying on SDK's skipTokenVerification.
- Removed wrapCallableHandler monkey patch in functionsEmulatorRuntime.ts.
- Removed unused HttpConstants.
- Removed obsolete emulator test for functions.config() missing values.
@taeold taeold changed the title chore: remove deprecated functions.config() monkey patching. chore: clean up monkey patching in functions emulator runtime Oct 29, 2025
@taeold taeold changed the title chore: clean up monkey patching in functions emulator runtime BREAKING: clean up monkey patching in functions emulator runtime Oct 30, 2025
@taeold taeold requested a review from jhuleatt October 30, 2025 17:16
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