[go: up one dir, main page]

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

Non-required extension parameters cannot be omitted #3126

Closed
oxc opened this issue Feb 11, 2021 · 0 comments
Closed

Non-required extension parameters cannot be omitted #3126

oxc opened this issue Feb 11, 2021 · 0 comments

Comments

@oxc
Copy link
Contributor
oxc commented Feb 11, 2021

[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
DEFAULT_FROM=test@example.org' > 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.

oxc added a commit to oxc/firebase-tools that referenced this issue Feb 11, 2021
oxc added a commit to oxc/firebase-tools that referenced this issue Feb 11, 2021
oxc added a commit to oxc/firebase-tools that referenced this issue Feb 11, 2021
oxc added a commit to oxc/firebase-tools that referenced this issue Feb 11, 2021
joehan added a commit that referenced this issue Feb 11, 2021
* Allow optional extension params to be omitted (#3126)

* Update CHANGELOG.md

Co-authored-by: joehan <joehanley@google.com>
@joehan joehan closed this as completed Mar 5, 2021
This was referenced Mar 9, 2021
This was referenced Mar 12, 2021
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this issue Dec 14, 2021
…se#3128)

* Allow optional extension params to be omitted (firebase#3126)

* Update CHANGELOG.md

Co-authored-by: joehan <joehanley@google.com>
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

No branches or pull requests

2 participants