firebase-tools
firebase-tools copied to clipboard
fix: propagate process.env to Python runtime serveAdmin environment
Description
fixes https://github.com/firebase/firebase-functions-python/issues/126
The Python runtime's serveAdmin method was not including process.env when spawning the admin server process.
This caused important environment variables like GOOGLE_APPLICATION_CREDENTIALS to be lost, which breaks authentication and configuration in Python functions, especially during code discovery phase.
Proposed Solution
add ...process.env to the environment object in serveAdmin, to ensure all current process environment variables are inherited by the Python admin server process.
Changes
- Added ...process.env spread to envWithAdminPort object in serveAdmin method
- Added: test coverage in src/deploy/functions/runtimes/python/index.spec.ts
Scenarios Tested
- Environment Variable Propagation: Verified that
process.envvariables (includingGOOGLE_APPLICATION_CREDENTIALS) are properly passed to Python admin server - Empty Environment Handling: Tested that when no additional envs are provided,
process.envis still preserved - Environment Override: Verified that provided environment variables correctly override
process.envwhen there are conflicts - CI Environment: Reproduction tested in CI environment with
GOOGLE_APPLICATION_CREDENTIALSauthentication
MRE in CI environment (you can use act to run locally) here
TODO: test compatibility deploying it not in CI