Skip to content

Fix function extension build path and info output path resolution#7244

Merged
isaacroldan merged 2 commits intomainfrom
04-10-fix_function_extension_build_path_and_info_output_path_resolution
Apr 10, 2026
Merged

Fix function extension build path and info output path resolution#7244
isaacroldan merged 2 commits intomainfrom
04-10-fix_function_extension_build_path_and_info_output_path_resolution

Conversation

@isaacroldan
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan commented Apr 10, 2026

WHY are these changes introduced?

Fixes https://community.shopify.dev/t/cli-3-93-0-regression-vitest-wasm-tests-fail-for-rust-function-extensions-base64-written-to-dist-index-wasm-instead-of-raw-binary/33061

The function info command was printing the wrong wasmPath.
It should be read from the toml config and not default to extension.outputPath

Also, during build we need to make sure to only do the base64 conversion when the bundlePath is really different from the outputPath.

WHAT is this pull request doing?

  • Add support for build.path configuration in function configurations by extending the FunctionConfiguration interface
  • Update the function build logic to avoid unnecessary bundling when the bundle path matches the project output path
  • Modify function info display to use the configured build path instead of the default output path
  • Add logic to determine the correct function output path by checking for a custom build.path or falling back to the default outputRelativePath

How to test your changes?

  1. Create a function with a custom build.path in its configuration
  2. Run the build command and verify the function builds to the correct location
  3. Run the function info command and verify it displays the correct output path
  4. Test with functions that don't specify a custom build path to ensure backward compatibility

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing, so I've added a changelog entry with pnpm changeset add

Co-authored-by: Claude Code <claude-code@anthropic.com>
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@isaacroldan isaacroldan marked this pull request as ready for review April 10, 2026 10:04
@isaacroldan isaacroldan requested a review from a team as a code owner April 10, 2026 10:04
Copilot AI review requested due to automatic review settings April 10, 2026 10:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes function output path resolution by honoring build.path from the function TOML configuration in both function info output and function build/rebundle behavior.

Changes:

  • Extend function info formatting to compute wasmPath from config.build.path (fallback to default outputRelativePath).
  • Update function build logic to avoid base64 rebundling when building locally and the bundle path matches the project’s default output path.
  • Add/adjust tests to validate wasmPath behavior in JSON output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/app/src/cli/services/function/info.ts Compute and display function wasm/output path using build.path (or default).
packages/app/src/cli/services/function/info.test.ts Adds tests for build.path wasmPath behavior; updates helper function signatures.
packages/app/src/cli/services/build/extension.ts Skips base64 rebundling when bundle path equals the project’s default output path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Claude Code <claude-code@anthropic.com>
@isaacroldan isaacroldan force-pushed the 04-10-fix_function_extension_build_path_and_info_output_path_resolution branch from 6e7c17a to 8283c0a Compare April 10, 2026 10:10
@isaacroldan isaacroldan added this pull request to the merge queue Apr 10, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 10, 2026
Copy link
Copy Markdown
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

Tested that it works as expected 👌

@isaacroldan isaacroldan added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 5f8d6a6 Apr 10, 2026
26 checks passed
@isaacroldan isaacroldan deleted the 04-10-fix_function_extension_build_path_and_info_output_path_resolution branch April 10, 2026 11:05
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.

4 participants