Skip to content

Add a warning/confirmation when using BUILD-available secrets for local builds#10337

Merged
falahat merged 18 commits intonextfrom
zip_deploy_secrets_warning
Apr 16, 2026
Merged

Add a warning/confirmation when using BUILD-available secrets for local builds#10337
falahat merged 18 commits intonextfrom
zip_deploy_secrets_warning

Conversation

@falahat
Copy link
Copy Markdown
Contributor

@falahat falahat commented Apr 14, 2026

Description

When a user builds with Local Builds and has BUILD-available secrets, these might be left as artifacts. For example, if they write the value of that secret to one of their statically-compiled pages, that build artifact might be left on their temporary folders. We want to confirm the secret-reading behavior with users for local builds. If using non-interactive mode, it requires a flag to allow reading secrets.

Scenarios Tested

Run a local build without a secret. Shouldn't ask for confirmation.
Run a local build with the secret. It should ask for confirmation.

Do the same but with non-interactive mode and with/without the flag to allow local build secrets.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a security confirmation prompt and a bypass flag (--allow-local-build-secrets) for local App Hosting builds that utilize build-available secrets. This ensures users are aware that sensitive values might be left in local artifacts. I have identified a few issues: a mismatch in an error message within the test suite, a missing property in the Options interface that will cause a TypeScript compilation error, and an opportunity to reduce code nesting in accordance with the repository style guide.

Comment thread src/apphosting/localbuilds.spec.ts Outdated
Comment thread src/deploy/apphosting/prepare.ts Outdated
Comment thread src/apphosting/localbuilds.ts Outdated
@falahat
Copy link
Copy Markdown
Contributor Author

falahat commented Apr 15, 2026

I manually tested this, the CLI warning showed up as expected

? Your build includes secrets that are available to the build environment. Using secrets in local builds may leave sensitive values in local artifacts/temporary files. Do you want to
continue? (y/N)

@falahat
Copy link
Copy Markdown
Contributor Author

falahat commented Apr 15, 2026

I manually tested this both interactively and non-interactively. The deployment was blocked when using build secrets if I did not confirm or use the flag.

@falahat falahat requested review from Yuangwang and annajowang April 15, 2026 20:16
@falahat falahat marked this pull request as ready for review April 15, 2026 20:16
Base automatically changed from zip_deploy_secrets to next April 16, 2026 13:35
@falahat falahat merged commit b5cb204 into next Apr 16, 2026
5 checks passed
@falahat falahat deleted the zip_deploy_secrets_warning branch April 16, 2026 13:39
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.

3 participants