new IaC export command supporting functions.yaml and first TF steps#10115
new IaC export command supporting functions.yaml and first TF steps#10115
Conversation
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 introduces foundational capabilities for exporting Firebase Cloud Functions as Infrastructure as Code. The primary goal is to enable users to manage and deploy their functions using external IaC tools like Terraform, thereby improving version control, automation, and integration with existing infrastructure workflows. This initial implementation focuses on supporting GCFv1 functions and provides a command-line interface to generate the necessary configuration files. 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. Changelog
Activity
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new functions:export command to generate Infrastructure as Code for Cloud Functions, with initial support for functions.yaml and Terraform. The implementation is a solid first step, adding new commands, experiments, and IaC generation logic. My review focuses on improving type safety by removing any types as per your style guide, fixing a critical bug in Terraform generation for VPC connectors, and addressing a few other issues that could lead to invalid HCL or brittle behavior. Overall, these changes establish a strong foundation for the new export feature.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Will look at minor issues in the morning |
Edit
This is long enough I'm going to convert to a draft and try to make a series of smaller PRs that compose to this.
Broken into
Description
Working to support exporting the IaC of a functions codebase, which allows you to actually do deployment in any other engine.
Scenarios Tested
So far, just had Gemini validate, but I need some eyes on it before the CL gets too big. So far we just handle exporting a v1 function and IAM bindings if it has no params. Variables are hard coded and sometimes faked. Next up are changes to the functions & tools packages to support a halfway export of a build.Build where a Field is a tf.Value instead and we track the usage of built-ins so we don't need to declare them all.
Sample Commands
From the following code:
Created the following TF files: