feat: add support for new function config properties#8278
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR propagates Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
src/lib/functions/netlify-function.tssrc/lib/functions/runtimes/index.tssrc/lib/functions/runtimes/js/builders/zisi.tssrc/utils/deploy/hash-fns.ts
| // 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). |
There was a problem hiding this comment.
🛠️ 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.
| // 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.
Adds support for the new
background,memory,regionandvcpufunction configuration properties.