Add P4SA Flow for Zip Deploy / Local Build#10165
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.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the App Hosting deployment preparation by programmatically ensuring that the App Hosting service agent possesses the required IAM permissions for accessing storage resources. This is particularly relevant for scenarios involving local builds, where the service agent needs to interact with project storage. The changes include a new utility function for role assignment, its integration into the deployment workflow under an experimental flag, and comprehensive unit tests to cover these new behaviors and conditions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request introduces a new P4SA (Project-level Service Account) flow for App Hosting local builds, ensuring the service agent has necessary roles for accessing project resources like storage. This is implemented by adding a new ensureAppHostingServiceAgentRoles function in src/apphosting/backend.ts and integrating its call into the prepare function in src/deploy/apphosting/prepare.ts when local builds are enabled. The changes also include comprehensive unit tests in src/deploy/apphosting/prepare.spec.ts to cover both the happy path and error conditions related to this new functionality and experiment flag. The JSDoc for the prepare function has also been updated for better clarity.
The code generally adheres to the repository's best practices, such as using the central logger and handling errors gracefully. The new functionality is well-tested, including edge cases like disabled experiments.
|
Fails with:
I need to confirm the name is correct |
|
Actually I just needed to show "Google Created Roles" in pantheon and I was able to see the correct user. I also verified that the user role (bucket viewer permission) was added when I ran a deployment! |
Description
Scenarios Tested
Test plan:
Sample Commands