Skip to content

fix(deploy): only send function schedules for functions that have one - #8632

Open
serhalp wants to merge 1 commit into
mainfrom
serhalp/fix/deploy-function-schedules
Open

serhalp wants to merge 1 commit into
mainfrom
serhalp/fix/deploy-function-schedules

Conversation

@serhalp

@serhalp serhalp commented Oct 16, 2026

Copy link
Copy Markdown
Member

Summary

Teeny, tiny nitpicky follow-up issue caught by the type improvements in #8599.

Schedules were built with schedule && { name, cron } and then filtered for '' and undefined.
Any other falsy value (e.g. null) went to the API as a bare null entry in function_schedules.

Schedules were built with `schedule && { name, cron }` and then filtered for `''` and `undefined`.
Any other falsy value (e.g. `null`) went to the API as a bare `null` entry in `function_schedules`.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 40ea6fed-f503-42ae-97d1-11996acd1d70
📥 Commits

Reviewing files that changed from the base of the PR and between e8953ec and 8347343.

📒 Files selected for processing: 2
  • src/utils/deploy/hash-fns.ts
  • tests/unit/utils/deploy/hash-fns.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 9 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Functions with null, empty, or missing schedules are no longer included in schedule results.

hashFns now includes a function schedule only when its value is truthy. A unit test covers scheduled, null, empty, and missing schedules and checks that only the function with the @daily schedule appears.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: ndhoule

Merge Risk: ⚪ Minimal · up to 83473

The schedule-filtering change appears ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: sending function schedules only when a function has a schedule.
Description check Passed The description directly explains the null-schedule bug and the intended fix. It is related to the changeset.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/netlify-cli@8632

commit: 8347343

@serhalp
serhalp marked this pull request as ready for review October 16, 2026 14:17
@serhalp
serhalp requested a review from a team as a code owner October 16, 2026 14:17
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-16T14:18:02.100322Z 8347343 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@seancdavis seancdavis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One comment from my 🤖

const functionSchedules = functionZips
.map(({ name, schedule }) => schedule && { name, cron: schedule })
.filter((schedule): schedule is { name: string; cron: string } => schedule !== '' && schedule !== undefined)
const functionSchedules = functionZips.flatMap(({ name, schedule }) => (schedule ? [{ name, cron: schedule }] : []))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[consider] I don't think the null ever reached the API. deploySite runs the whole payload through cleanDeep before sending it (deploy-site.ts:223), and that drops null entries from arrays too.

Still worth doing for the type guard. But as a fix: it'll land in the changelog as a bug users hit.

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