Skip to content

feat: add support for new function config properties#8278

Merged
eduardoboucas merged 2 commits into
mainfrom
feat/functions-config-updates
May 29, 2026
Merged

feat: add support for new function config properties#8278
eduardoboucas merged 2 commits into
mainfrom
feat/functions-config-updates

Conversation

@eduardoboucas
Copy link
Copy Markdown
Member

Adds support for the new background, memory, region and vcpu function configuration properties.

@eduardoboucas eduardoboucas requested a review from a team as a code owner May 29, 2026 10:21
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Refactoring

    • Improved function invocation mode detection logic.
  • Chores

    • Enhanced function configuration metadata to include memory, region, and vcpu options.
    • Updated build result structures to track function invocation details.

Walkthrough

This PR propagates invocationMode metadata from ZISI function builds through runtime type contracts and into NetlifyFunction, where it becomes the primary source of truth for the computed isBackground getter. The getter now checks three sources in order: runtime invocation mode from build data, explicit TOML configuration, and function name suffix as fallback. Additionally, the function configuration hashing now includes memory, region, and vcpu fields alongside existing configuration attributes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: adding support for new function config properties including background, memory, region, and vcpu.
Description check ✅ Passed The pull request description directly relates to the changeset, explicitly mentioning the new function configuration properties (background, memory, region, vcpu) being added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/functions-config-updates

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

@github-actions
Copy link
Copy Markdown

📊 Benchmark results

Comparing with c078a98

  • Dependency count: 1,136 (no change)
  • Package size: 379 MB (no change)
  • Number of ts-expect-error directives: 356 ⬆️ 0.28% increase vs. c078a98

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/functions/netlify-function.ts`:
- Around line 67-72: Remove the multi-line explanatory comment above the getter
that determines background functions (the getter that checks ZISI build data /
TOML config / filename suffix — e.g., isBackground or isBackgroundFunction) so
the implementation stands self-explanatory; delete the 3-4 line descriptive
block (the comment describing the three checks) and rely on clear
naming/structure instead, leaving the getter code unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90061488-f833-4e16-98b4-17140f6666b5

📥 Commits

Reviewing files that changed from the base of the PR and between c078a98 and 5e44856.

📒 Files selected for processing (4)
  • src/lib/functions/netlify-function.ts
  • src/lib/functions/runtimes/index.ts
  • src/lib/functions/runtimes/js/builders/zisi.ts
  • src/utils/deploy/hash-fns.ts

Comment on lines +67 to +72
// Determines whether this is a background function. Checks (in order):
// 1. ZISI build data — `invocationMode === 'background'` captures the
// filename suffix AND the in-source `config.background: true`.
// 2. The TOML config — `[functions.<name>] background = true`.
// 3. The filename suffix as a last-resort fallback (used pre-build and for
// non-ZISI runtimes like Go).
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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Remove explanatory behavior comments in this getter.

Line 67 to Line 72 adds descriptive comments about behavior in a TypeScript file; please remove these and keep intent in naming/structure.

Suggested diff
-  // Determines whether this is a background function. Checks (in order):
-  //  1. ZISI build data — `invocationMode === 'background'` captures the
-  //     filename suffix AND the in-source `config.background: true`.
-  //  2. The TOML config — `[functions.<name>] background = true`.
-  //  3. The filename suffix as a last-resort fallback (used pre-build and for
-  //     non-ZISI runtimes like Go).
   get isBackground(): boolean {

As per coding guidelines, **/*.{ts,tsx,js,jsx}: Never write comments on what the code does; make the code clean and self-explanatory instead.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Determines whether this is a background function. Checks (in order):
// 1. ZISI build data — `invocationMode === 'background'` captures the
// filename suffix AND the in-source `config.background: true`.
// 2. The TOML config — `[functions.<name>] background = true`.
// 3. The filename suffix as a last-resort fallback (used pre-build and for
// non-ZISI runtimes like Go).
get isBackground(): boolean {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/functions/netlify-function.ts` around lines 67 - 72, Remove the
multi-line explanatory comment above the getter that determines background
functions (the getter that checks ZISI build data / TOML config / filename
suffix — e.g., isBackground or isBackgroundFunction) so the implementation
stands self-explanatory; delete the 3-4 line descriptive block (the comment
describing the three checks) and rely on clear naming/structure instead, leaving
the getter code unchanged.

@eduardoboucas eduardoboucas merged commit 826fde7 into main May 29, 2026
39 checks passed
@eduardoboucas eduardoboucas deleted the feat/functions-config-updates branch May 29, 2026 10:30
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