Skip to content

Conversation

@efiShtain
Copy link
Contributor

@efiShtain efiShtain commented Feb 27, 2020

Description

This is a feature added to the public api to allow passing maxInstances property when creating or updating a firebase function.
This change requires a matching change on firebase-functions (there is another pull request for that)
firebase/firebase-functions#624

Scenarios Tested

No special testing is needed, as the parameter added is optional.
If you need to test it, create a function using firebase-functions and pass maxInstances parameter to RuntimeOptions.
The function on google console will have the maxInstances parameter set correctly
It Cannot be viewed on the firebase console as far as I know

Sample Commands

import * as functions from 'firebase-functions' functions .runWith({ maxInstances: 1 })
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@efiShtain
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Manual indication that this has passed CLA. and removed cla: no labels Feb 27, 2020
@samtstern
Copy link
Contributor

@efiShtain thanks for sending this! Just a few things to know:

  1. Please fill out the whole Pull Request template when sending a Pull Request so we know exactly what you're trying to do.
  2. Any changes that affect the public API of a Firebase tool/SDK have to go through our internal API review process. If we want to move forward with this change we'll handle that for you, but it will slow things down so just FYI.
  3. I believe this PR would require a change in the firebase-functions library, right?
@samtstern samtstern requested a review from joehan February 27, 2020 23:32
@efiShtain
Copy link
Contributor Author

@samtstern
Hey Sam,
Yeah that's the first time I commit a pull request for a google product

I'll see if I can fill in the rest of the details

There is a matching pull request on the firebase-functions too

Didn't know how to link them together, I also didn't change the package version as I didn't know what's the process regarding that too

@samtstern
Copy link
Contributor

@efiShtain oh thanks! I just saw your other PR:
firebase/firebase-functions#624

So that one will have to be first, I'll get someone to take a look.

@samtstern
Copy link
Contributor

@efiShtain a few scenarios you might want to test:

  1. Try deploying a function without maxInstances and then deploying it again but with maxInstances: 1 ... does that work as expected?
  2. Try deploying a function once with maxInstances: 1 and then again with maxInstances: 2 ... does that work as expected?

Oh and don't worry about the version number, our release script does that automatically.

@efiShtain
Copy link
Contributor Author

@samtstern
I have checked for both cases before submitting the pull request and they work as expected

Copy link
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

The code here is LGTM, we'll just need to wait for this to go through API review. Thanks a ton for contributing!

@joehan
Copy link
Member

joehan commented Mar 16, 2020

Hey @efiShtain, we just added this proposal to our 3/19 API review meeting. Thanks so much for working on this - I'll update here again after the meeting.

@joehan
Copy link
Member

joehan commented Mar 19, 2020

Wooo, this was approved! Thanks agin for working on this!

@joehan joehan merged commit b92de7d into firebase:master Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

4 participants