Barebones implementation of local builds#10101
Merged
Conversation
…to the local build process
1. Fix for injecting auto-init variables into the build 2. Fixes how we handle dependencies, nodejs paths, modulepaths, etc. This needs closer attention/fixes. 3. Adds env var handling (not secrets) and determines which env vars to pass down to the build
… variants) and include them in the final artifact
…zip_deploy_aryanf
…ctually a local build (instead of assuming true.)
…ore strictly. We also remove some hardcoded values and we generalize the code so that it does not affect source deploys. The goal is to prepare this PR so that we can safely submit it to main (behind the experiment flag.)
…ive. Only run it if it's a local build and the local build experiment flag is enabled.
Contributor
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces barebones support for local builds in App Hosting, allowing the deployment of pre-built artifacts. Key changes include updating dependencies, adding a new createTarArchive utility for packaging local build outputs, and modifying the deployment and release processes to differentiate between source and local build deployments. New test cases have been added to cover the local build functionality and experiment flag enforcement. The documentation for localBuild and the main deployment function has also been improved.
…ools into zip_deploy_barebones
Contributor
Author
|
I manually tested a local build and it was correctly deployed. Of course, env vars didn't work yet but I confirmed that:
|
falahat
commented
Mar 19, 2026
falahat
commented
Mar 19, 2026
…ools into zip_deploy_barebones
Yuangwang
approved these changes
Mar 21, 2026
andrewbrook
pushed a commit
that referenced
this pull request
Mar 25, 2026
* Zip deploy fixes * use staging and specify uploading TAR * Improve docs * Allow reading of simple env vars (not secrets) and passing them down to the local build process * Add some fixes for npm parsing issues * Adding various local fixes/hacks to make local builds work. It includes: 1. Fix for injecting auto-init variables into the build 2. Fixes how we handle dependencies, nodejs paths, modulepaths, etc. This needs closer attention/fixes. 3. Adds env var handling (not secrets) and determines which env vars to pass down to the build * Follow-up fixes for ensuring we have account access for cloud storage buckets * formatting fixes * Get rid of env override * Temporarily add a test app to easily test changes * For local builds, explicitly check for apphosting.yaml files (and all variants) and include them in the final artifact * Add hono to packages * Get rid of test app * Get rid of uniformBucketLevelAccess config which was not required * Fix tarball unit test * Make local builds less hardcoded by checking if the build config is actually a local build (instead of assuming true.) * Add a new experiment flag to control local builds (apphostinglocalbuilds) * Remove references to runtime flag * Clean up the PR so that we gate by apphostinglocalbuilds experiment more strictly. We also remove some hardcoded values and we generalize the code so that it does not affect source deploys. The goal is to prepare this PR so that we can safely submit it to main (behind the experiment flag.) * Make the code for adding service account IAM permission more restrictive. Only run it if it's a local build and the local build experiment flag is enabled. * remove es2020 dependency * feat: barebones local build implementation * Parser fixes * Undo some unintended changes * Undo some unintended changes * Linter fixes * Linter fixes * improve unit tests * update npm shrinkwrap * Update the shrinkwrap correctly using the correct npm versions * Remove env handling which wasn't used yet * Address review comments * Enforce experiment flag * Correct failure string * linter/formatter * fix tests * Fix linter warnings --------- Co-authored-by: Joanna Wang <annajowang@gmail.com> Co-authored-by: annajowang <31288696+annajowang@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds some prototype code for building nextjs apps locally.
Scenarios Tested
I enabled the apphostinglocalbuilds flag and tested a local deployment and it was successful. Env vars did not work (as expected) but I was otherwise able to visit the locally built / zip-deployed site.
I tested a source deploy app
I disabled the apphostinglocalbuilds flag and the CLI correctly failed my deployment with a clear error message.
Sample Commands