Skip to content
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

Skip creating env variables with undefined values #7047

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

Conversation

aalej
Copy link
Contributor

@aalej aalej commented Apr 25, 2024

Description

Fixes #7036. From what I can gather, it is possible that env values can be undefined.

I think we should skip the creation of env if their value is undefined.

Scenarios Tested

  1. Run firebase functions:config:set test.user=test-user
  2. Run firebase functions:config:set some.random.planet=
    • Creates an env with no value
  3. Run `
    • Outputs the ff JSON object, where some.random doesn't have a value
{
  "some": {
    "random": {}
  },
  "test": {
    "user": "test-user"
  }
  1. Run firebase functions:config:export
i  Importing functions configs from projects [PROJECT_ID]
i  Importing configs from projects: [PROJECT_ID]
✔  Wrote functions/.env.default
✔  Wrote functions/.env.local
✔  Wrote functions/.env

The ff files are created:

.env

# Exported firebase functions:config:export command on 4/25/2024# .env file contains environment variables that applies to all projects.

.env.default

# Exported firebase functions:config:export command on 4/25/2024
TEST_USER="test-user" # from test.user

.env.local

# Exported firebase functions:config:export command on 4/25/2024
# .env.local file contains environment variables for the Functions Emulator.

@aalej aalej requested a review from blidd-google April 25, 2024 15:38
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.

Functions config export failing with unexpected error
1 participant