Skip to content

Conversation

@taeold
Copy link
Contributor

@taeold taeold commented Nov 14, 2025

This PR adds support for attemptDeadlineSeconds in scheduled functions, allowing users to configure the deadline for job attempts. This mirrors the recent changes in the Functions SDK.

Changes

  • Updated ScheduleTrigger in backend.ts and build.ts.
  • Updated Job interface and jobFromEndpoint in cloudscheduler.ts.
  • Updated v1alpha1.ts to parse attemptDeadlineSeconds from discovery.
  • Added unit tests.

@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 integrates attemptDeadlineSeconds into scheduled functions, providing users with the ability to define a maximum duration for individual job attempts. This enhancement aligns the system with recent updates in the Functions SDK, ensuring consistency and offering more granular control over scheduled task execution.

Highlights

  • New Feature: attemptDeadlineSeconds: Introduced attemptDeadlineSeconds support for scheduled functions, allowing users to specify a maximum duration for individual job attempts. This mirrors recent changes in the Functions SDK.
  • Interface Updates: Updated ScheduleTrigger interfaces in backend.ts and build.ts to include the new attemptDeadlineSeconds field, and the Job interface in cloudscheduler.ts to include attemptDeadline.
  • Discovery and Parsing Logic: Modified v1alpha1.ts to correctly parse attemptDeadlineSeconds from discovery configurations and cloudscheduler.ts to map it to the appropriate attemptDeadline format for Cloud Scheduler jobs.
  • Unit Tests: Added comprehensive unit tests to ensure the correct functionality and parsing of the new attemptDeadlineSeconds feature across various components.
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.

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 adds support for attemptDeadlineSeconds to scheduled functions. The changes are well-structured, touching the necessary parts of the codebase from backend interfaces to the Cloud Scheduler integration, and include corresponding tests. However, I've identified a couple of issues where null values for attemptDeadlineSeconds are not handled correctly, which prevents clearing an existing deadline. My review includes suggestions to address these issues to make the feature more robust.

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.

1 participant