Skip to content

feat: add per-function memory parameter#643

Merged
eduardoboucas merged 1 commit into
masterfrom
feat/functions-memory
May 19, 2026
Merged

feat: add per-function memory parameter#643
eduardoboucas merged 1 commit into
masterfrom
feat/functions-memory

Conversation

@eduardoboucas
Copy link
Copy Markdown
Member

No description provided.

@eduardoboucas eduardoboucas requested review from a team as code owners May 18, 2026 17:57
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for open-api ready!

Name Link
🔨 Latest commit a21e94a
🔍 Latest deploy log https://app.netlify.com/projects/open-api/deploys/6a0b5318a4daae000898dda5
😎 Deploy Preview https://deploy-preview-643--open-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

New Features

  • Added memory allocation configuration for functions. Users can now specify memory limits in MB through function manifests, API endpoints, and deployment configurations, enabling improved resource management and granular control over function execution environments.

Walkthrough

This PR introduces support for function memory allocation configuration. The Memory field (representing MB) is added to the FunctionConfig Go model, the internal functionsManifestEntry manifest schema, and the OpenAPI functionConfig schema definition. The deployment logic in bundleFromManifest is updated to read the memory value from the manifest and treat a non-zero memory setting as a configuration signal, populating the resulting function configuration object with the specified memory value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether any description content is related to the changeset. Add a description explaining the purpose of the memory parameter, how it affects function behavior, and any relevant context for reviewers.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add per-function memory parameter' accurately describes the main change: adding a memory configuration parameter to function definitions across the codebase.
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-memory

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

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
swagger.yml (1)

5558-5561: ⚡ Quick win

Consider adding validation constraints for memory allocation.

The memory field has no minimum, maximum, or format constraints. Function memory allocations typically have platform-specific limits and increment requirements. Consider adding validation to prevent invalid values from being accepted by the API.

📋 Suggested validation constraints
       memory:
         type: integer
+        format: int64
+        minimum: 128
+        maximum: 10240
         description: |
           The function's memory allocation in MB.

Note: Adjust the minimum and maximum values based on your platform's actual constraints.

🤖 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 `@swagger.yml` around lines 5558 - 5561, The OpenAPI schema’s memory property
lacks validation; update the memory field in swagger.yml (the memory schema
under the function spec) to include numeric constraints such as minimum (e.g.
128), maximum (e.g. 32768), and an increment rule (use multipleOf for MB
granularity like 64) or an enum of allowed values to enforce platform limits and
increments; ensure the description is updated to mention these constraints so
the API rejects out-of-range or non-granular allocations.
🤖 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.

Nitpick comments:
In `@swagger.yml`:
- Around line 5558-5561: The OpenAPI schema’s memory property lacks validation;
update the memory field in swagger.yml (the memory schema under the function
spec) to include numeric constraints such as minimum (e.g. 128), maximum (e.g.
32768), and an increment rule (use multipleOf for MB granularity like 64) or an
enum of allowed values to enforce platform limits and increments; ensure the
description is updated to mention these constraints so the API rejects
out-of-range or non-granular allocations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6e0eb13b-4690-4ef9-a472-b43d9ae78588

📥 Commits

Reviewing files that changed from the base of the PR and between 7c509b2 and a21e94a.

📒 Files selected for processing (4)
  • go/models/function_config.go
  • go/porcelain/deploy.go
  • go/porcelain/functions_manifest.go
  • swagger.yml

@eduardoboucas eduardoboucas merged commit 1764a43 into master May 19, 2026
15 checks passed
@eduardoboucas eduardoboucas deleted the feat/functions-memory branch May 19, 2026 07:49
eduardoboucas pushed a commit that referenced this pull request May 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.55.0](v2.54.0...v2.55.0)
(2026-05-19)


### Features

* add per-function `memory` parameter
([#643](#643))
([1764a43](1764a43))
* add per-function `vcpu` parameter
([#645](#645))
([e55927e](e55927e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
Co-authored-by: token-generator-app[bot] <token-generator-app[bot]@users.noreply.github.com>
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