Skip to content

feat: new edge function upload - #8326

Merged
pieh merged 6 commits into
mainfrom
feat/new-edge-function-upload
Aug 4, 2026
Merged

feat: new edge function upload#8326
pieh merged 6 commits into
mainfrom
feat/new-edge-function-upload

Conversation

@pieh

@pieh pieh commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Part of https://linear.app/netlify/issue/RUN-2937/implement-end-to-end-env-vars-plumbing-for-functions

Depends netlify/open-api#650 . This was published some time ago in @netlify/open-api@2.57.0 and indirectly was already updated in cli already (so no need to bump in this PR anymore):

> npm info netlify-cli --json | jq '.dependencies["@netlify/api"]'
"^15.1.0"
> npm info @netlify/api@15.1.0 --json | jq '.dependencies["@netlify/open-api"]'
"^2.57.0"

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Edge functions are now included in deployment processing, including bundle identification, upload preparation, and CDN status reporting.
    • Edge-function assets are uploaded using their required deployment metadata.
  • Bug Fixes

    • Improved upload routing and retry handling for static files, serverless functions, and edge functions.
    • Deployments now handle missing edge-function build output safely without failing unnecessarily.
  • Tests

    • Added coverage for edge-function hashing, metadata, uploads, retry behavior, and missing build artifacts.

Walkthrough

The deployment pipeline now hashes edge-function bundles from the edge-bundler manifest. It includes edge-function hashes in deployment requests and builds typed upload metadata. Upload dispatch supports edge functions with codeSha and retry counts. Deployment status and final upload processing include edge functions. Unit tests cover hashing, fallback behavior, uploads, retries, and error handling.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: sarahetter

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding edge function upload support.
Description check ✅ Passed The description is related to the changeset through the stated edge function work and its RUN-2937 dependency.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/new-edge-function-upload

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📊 Benchmark results

Comparing with 3b52aa0

  • Dependency count: 1,165 (no change)
  • Package size: 455 MB ⬇️ 0.00% decrease vs. 3b52aa0
  • Number of ts-expect-error directives: 346 ⬇️ 3.47% decrease vs. 3b52aa0

@pieh
pieh force-pushed the feat/new-edge-function-upload branch from 3732c4d to ef45117 Compare August 4, 2026 08:00
@pieh pieh changed the title [do-not-merge] feat: new edge function upload feat: new edge function upload Aug 4, 2026
@pieh
pieh marked this pull request as ready for review August 4, 2026 16:03
@pieh
pieh requested a review from a team as a code owner August 4, 2026 16:03

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

🧹 Nitpick comments (1)
src/utils/deploy/hash-edge-functions.ts (1)

18-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep implementation comments limited to rationale.

Lines 18-22 restate the manifest, hash, and upload sequence. Lines 27-30 restate the returned field names. Remove behavior narration and retain only non-obvious deployment rationale.

As per coding guidelines, “Do not write comments describing what the code does; make the code self-explanatory instead.”

Also applies to: 27-30

🤖 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/utils/deploy/hash-edge-functions.ts` around lines 18 - 22, In the
edge-function hashing implementation, remove the behavior-narration comments
around the manifest/hash/upload flow and the returned field definitions,
including the comments near the manifest processing and lines 27-30. Retain only
concise comments explaining non-obvious deployment rationale, such as why the
bundler filename is not trusted or why all formats are declared.

Source: Coding guidelines

🤖 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 `@src/utils/deploy/hash-edge-functions.ts`:
- Around line 18-22: In the edge-function hashing implementation, remove the
behavior-narration comments around the manifest/hash/upload flow and the
returned field definitions, including the comments near the manifest processing
and lines 27-30. Retain only concise comments explaining non-obvious deployment
rationale, such as why the bundler filename is not trusted or why all formats
are declared.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5b2fd2b-a1e6-4ac5-9d07-1565d713a835

📥 Commits

Reviewing files that changed from the base of the PR and between a95b365 and 134b7ec.

📒 Files selected for processing (5)
  • src/utils/deploy/deploy-site.ts
  • src/utils/deploy/hash-edge-functions.ts
  • src/utils/deploy/upload-files.ts
  • tests/unit/utils/deploy/hash-edge-functions.test.ts
  • tests/unit/utils/deploy/upload-files.test.ts
🔗 Linked repositories identified

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

  • netlify/blueprints (manual)

@pieh
pieh enabled auto-merge (squash) August 4, 2026 16:45
@pieh
pieh merged commit 3f33c36 into main Aug 4, 2026
35 checks passed
@pieh
pieh deleted the feat/new-edge-function-upload branch August 4, 2026 16:53
pieh pushed a commit that referenced this pull request Aug 5, 2026
🤖 I have created a release *beep* *boop*
---


## [27.1.0](v27.0.3...v27.1.0)
(2026-08-04)


### Features

* new edge function upload
([#8326](#8326))
([3f33c36](3f33c36))


### Bug Fixes

* reconstruct build_data when missing on direct-zip deploys
([#8353](#8353))
([3b52aa0](3b52aa0))

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