Skip to content

Conversation

@taeold
Copy link
Contributor

@taeold taeold commented Nov 24, 2025

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:

For HTTP targets, the default is 3 minutes. The deadline must be in the interval [15 seconds, 30 minutes].

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).

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 attemptDeadlineSeconds. The change is based on the principle that the attempt deadline for a scheduled job should align closely with the function's overall execution timeout. By automatically deriving attemptDeadlineSeconds from timeoutSeconds, the PR aims to simplify the API, reduce potential configuration inconsistencies, and ensure a more intuitive setup for scheduled cloud functions.

Highlights

  • Removal of explicit attemptDeadlineSeconds control: Users can no longer explicitly set attemptDeadlineSeconds for scheduled functions. This property has been removed from the configuration interfaces and options.
  • Coupling attemptDeadlineSeconds with timeoutSeconds: The system now automatically sets the attemptDeadlineSeconds for scheduled function triggers based on the function's timeoutSeconds. This change reflects the understanding that these two values are deeply coupled and should ideally be the same or very close.
  • Rollback of previous functionality: This pull request effectively rolls back a previous change that introduced explicit control for users to set attemptDeadlineSeconds, simplifying the API by removing redundant configuration.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@taeold taeold changed the title Feat/scheduler attempt deadline timeout feat: merge attemptDeadlineSeconds and timeoutSeconds option for v2 scheduled functions Nov 24, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@taeold taeold changed the title feat: merge attemptDeadlineSeconds and timeoutSeconds option for v2 scheduled functions feat: remove attemptDeadlineSeconds in v2 scheduled functions Nov 25, 2025
@taeold
Copy link
Contributor Author

taeold commented Nov 25, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

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.

2 participants