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 utilities for generating Terraform HCL configurations, specifically designed to support Infrastructure as Code (IaC) exports for Firebase Functions. The changes provide a structured way to define and serialize Terraform blocks and attributes, enabling programmatic construction of Terraform configurations. This enhancement is crucial for automating the deployment and management of cloud resources through Terraform. 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 set of utilities for generating Terraform configurations for Firebase Functions as Infrastructure as Code. The overall approach is solid, and the new modules are well-tested. I've identified a few areas for improvement, mainly concerning a new utility function's implementation that doesn't handle all edge cases, some type safety issues in the tests that violate the repository's style guide, and a couple of minor refinements in the HCL serialization logic for better consistency and clarity. Addressing these points will enhance the robustness and maintainability of this new feature.
2ee2e3e to
fe941ed
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a set of utilities for generating Terraform HCL, complete with unit tests. A new toLowerSnakeCase utility is also added. The code is generally well-written and tested. My review includes one high-severity suggestion to correct the handling of null values in renameField, which is crucial for generating correct Terraform configurations that can unset or reset attributes.
|
The official Terraform docs don't enforce sorting of field names. Here's what they recommend https://developer.hashicorp.com/terraform/language/style#resource-order
|
|
Thanks. I'll merge this, add a new utility to order so that printing is deterministic, and then rebase the functions PR on that with better testing. |
* feat: add functions:export command with internal format support * PR feedback * Lint * feat: add terraform hcl generation utilities * PR feedback. More comments * Improve tests * PR feedback
Creates terraform utilities for the IaC export tool. Using very loose typing for now.
To consider: should we also sort top level keys by some canonical style? Insert line breaks between for_each and other attributes for e.g.?