-
Notifications
You must be signed in to change notification settings - Fork 219
feat: remove attemptDeadlineSeconds in v2 scheduled functions #1776
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
base: master
Are you sure you want to change the base?
Conversation
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
Summary of ChangesHello @taeold, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the configuration of scheduled functions by removing the direct user control over Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request removes the explicit attemptDeadlineSeconds option for scheduled functions, instead deriving it from the function's timeoutSeconds. This is a good simplification that makes the API easier to use. The implementation is sound, but I've identified one high-severity issue where a function's timeoutSeconds can be outside the valid range for Cloud Scheduler's attemptDeadlineSeconds, which could lead to deployment failures. I have suggested adding validation to prevent this.
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
|
/gemini review |
…hub.com/firebase/firebase-functions into feat/scheduler-attempt-deadline-timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively removes the attemptDeadlineSeconds option for v2 scheduled functions, which simplifies the API for developers. The changes are consistent and correctly applied across all relevant files, including interface definitions, implementation logic, and tests. The removal of attemptDeadlineSeconds and the associated logic, for instance in src/runtime/manifest.ts, leads to cleaner and more maintainable code. The test modifications in spec/v2/providers/scheduler.spec.ts and spec/runtime/manifest.spec.ts accurately reflect these changes. The update to the changelog is also clear and concise. Overall, this is a well-executed refactoring that successfully achieves its stated goal.
Effectively rolls back #1772.
We are removing explicit control for users to set attemptDeadlineSeconds from the SDK. This is because attemptDeadlineSeconds and timeoutSeconds are deeply coupled, and we want to ensure they stay in sync to avoid confusing retry behavior.
Per Cloud Scheduler docs:
The SDK will no longer expose attemptDeadlineSeconds in the manifest. The Firebase CLI will be updated to automatically sync Cloud Scheduler's attemptDeadlineSeconds with the function's timeoutSeconds (capped at 30 minutes).