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

Only validate function name #4352

Merged
merged 5 commits into from Mar 22, 2022
Merged

Only validate function name #4352

merged 5 commits into from Mar 22, 2022

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Mar 22, 2022

Description

While testing the extensions emulator, I noticed that this length validation on functionId was blocking some function names that would be valid in prod. In the emulator, functionId = {region}-{functionName}, but in prod, functionId=functionName. Therefore, to match prod behavior, we should only validate functionName.

@joehan joehan requested review from elvisun and taeold March 22, 2022 21:07
CHANGELOG.md Outdated Show resolved Hide resolved
functionIdsAreValid([definition]);
// Note - in the emulator, functionId = {region}-{functionName}, but in prod, functionId=functionName.
// To match prod behavior, only validate functionName
functionIdsAreValid([{ id: definition.name, platform: definition.platform }]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personal pref, but I'd do something like:

functionIdsAreValid([{ ...definition, id: definition.name }]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh, i do like this a bit more - done.

joehan and others added 3 commits March 22, 2022 15:09
@joehan joehan enabled auto-merge (squash) March 22, 2022 22:17
@joehan joehan merged commit 311d1c8 into master Mar 22, 2022
@joehan joehan deleted the jh-cap-fn-length branch March 22, 2022 22:32
tohhsinpei pushed a commit that referenced this pull request Mar 23, 2022
* Only validate function name

* Add changelog entry

* Update CHANGELOG.md

Co-authored-by: Daniel Lee <danielylee@google.com>

* PR fixes

Co-authored-by: Daniel Lee <danielylee@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

Successfully merging this pull request may close these issues.

None yet

2 participants