Skip to content

Non-required extension parameters cannot be omitted #3126

Closed
@oxc

Description

@oxc

[REQUIRED] Environment info

firebase-tools: 9.3.0

Platform: Ubuntu (on WSL)

[REQUIRED] Test case

Install firestore-send-email extension with a --params file, which does not specify the (optional) parameter DEFAULT_REPLY_TO.

[REQUIRED] Steps to reproduce

# create params file
echo 'LOCATION=europe-west3
SMTP_CONNECTION_URI=smtps://foo
MAIL_COLLECTION=mail
[email protected]' > send-email.env

# try to install extension
firebase --non-interactive ext:install firestore-send-email --params='send-email.env'

# Answer questions with yes multiple times (--non-interactive does not help here)

[REQUIRED] Expected behavior

The extension installs correctly, with all non-required parameters that have not been specified omitted.

[REQUIRED] Actual behavior

The extension fails to install with:

Error: DEFAULT_REPLY_TO has not been set in the given params file and there is no default available. Please set this variable before installing again.

More details:

The issue arises in the following check:
https://github.com/firebase/firebase-tools/blob/master/src/extensions/extensionsHelper.ts#L144
This should skip parameters that don't have required: true in their specification.

I tried to workaround with setting the optional parameters to empty values, but that does not work either, because the abovementioned check checks for a truthy value, instead of checking for undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions