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

runWith options are not applied after functions deployment #4418

Closed
xar opened this issue Apr 8, 2022 · 6 comments
Closed

runWith options are not applied after functions deployment #4418

xar opened this issue Apr 8, 2022 · 6 comments
Assignees

Comments

@xar
Copy link

xar commented Apr 8, 2022

[REQUIRED] Environment info

firebase-tools: 10.3.0

Platform: macOs, Ubuntu

[REQUIRED] Test case

After updating runWith options for cloud function probably without modifying function code and running firebase deploy --only functions we don't see updated runtime options in google cloud console. Cloud function which has modified options still shows old configuration of memory: 2GB and minInstaces: 1 even we have changed it to 256mb & 0.

[REQUIRED] Steps to reproduce

  • Create cloud function with runWith({ memory: 2GB, minInstances: 1 })
  • Deploy
  • Verify that it's deployed with those options in console.cloud.google.com
  • Change runtime options to runWith({ memory: 256MB, minInstances: 0 })
  • Check cloud console

[REQUIRED] Expected behavior

  • runWith get propagated correctly

[REQUIRED] Actual behavior

  • runWith options doesn't get propagated
@xar xar added the bug label Apr 8, 2022
@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@joehan
Copy link
Contributor

joehan commented Apr 11, 2022

Hey @xar, could you update to the latest version of firebase-tools and try this again? We recently caught and fixed a bug (#4253) that caused a similar problem to what you are experiencing here.

@yuchenshi yuchenshi added the Needs: Author Feedback Issues awaiting author feedback label Apr 18, 2022
@google-oss-bot
Copy link
Contributor

Hey @xar. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@xar
Copy link
Author

xar commented Apr 21, 2022

Sorry for late update on the issue - I have tried to run with latest version of firebase-tools - 10.7.0 but without success. Specifically I have updated runWith of function to .runWith({ memory: '2GB'. minInstances: 1 }) - this got updated correctly and I can see updated options in gcloud console. But when I change runWith back to .runWith({}) function doesn't get updated...

@joehan
Copy link
Contributor

joehan commented Apr 25, 2022

@inlined Could you take a look at this? IIRC, we intentionally tried to handle this case correctly and it seems like it may have regressed.

@inlined
Copy link
Member

inlined commented Apr 26, 2022

.runWith({}) does nothing. We only reset values that are explicitly set to undefined. For better or worse, this is to preserve changes made out of band in the Google Cloud console. So if you said:

runWith({ memory: "2GB", minInstances: 0 })
```

or 

```
runWith({ memory: "2GB", minInstances: undefined })
```

we'd reset the value, but if you just remove "minInstances" from the object we don't know (when looking only at your current source code) whether you stopped wanting minInstances or whether you configured minInstances using other tools like `gcloud` or the website. We opt for ignoring what might have been out-of-band changes because your case can be fixed once yet having your out-of-band changes overwitten on every deploy can be maddening

@inlined inlined closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants