-
Notifications
You must be signed in to change notification settings - Fork 1k
Add markdown guide for data connect internals #8831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @tammam-g, 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 a foundational markdown document aimed at educating developers on the internal architecture and operational flows of the Firebase Data Connect feature within the firebase-tools
CLI. Its primary goal is to enhance understanding and facilitate contributions to this specific part of the codebase.
Highlights
- New Documentation Added: I've added a new markdown document,
docs/data-connect.md
, to the repository. This document serves as a comprehensive internal guide for the Firebase Data Connect feature. - Detailed Data Connect Internals: The new guide provides an in-depth look at Data Connect, covering its product overview, its place within the
firebase-tools
project structure, and its core components. It details how Data Connect interacts with the CLI's command framework, authentication system, and the Emulator Suite. - Interaction Flows Explained: The document clarifies the interaction flows for Data Connect, specifically differentiating between local emulation scenarios (using
pg-lite
) and the deployment process, including schema migration and service deployment. - Contribution Guide: The guide also includes practical steps and advice for developers looking to contribute to the Firebase CLI, with a particular focus on understanding and modifying the Data Connect feature.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this 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 adds a new internal developer guide for Firebase Data Connect. The guide is well-structured and provides a good overview of the feature's architecture within firebase-tools
. I've added a few suggestions to improve clarity and correct some minor inaccuracies in the documentation.
@@ -0,0 +1,121 @@ | |||
Firebase Data Connect, is a feature that enables developers to build GraphQL-based data APIs backed by existing SQL databases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comma after 'Firebase Data Connect' is grammatically incorrect and slightly hinders readability.
Firebase Data Connect, is a feature that enables developers to build GraphQL-based data APIs backed by existing SQL databases. | |
Firebase Data Connect is a feature that enables developers to build GraphQL-based data APIs backed by existing SQL databases. |
The `firebase-tools` codebase is structured to separate core functionalities, command definitions, and emulator logic. | ||
|
||
``` | ||
firebase-firebase-tools/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
│ ├── dataconnect/ # Data Connect Emulator specific logic. | ||
│ │ └── pgliteServer.ts # Manages the in-memory pglite Postgres instance. | ||
│ ├── storage/ # Storage Emulator implementation. | ||
│ ├── controller.ts # Main controller to start, stop, and manage emulators. | ||
│ ├── downloadableEmulators.ts # Handles downloading of JAR-based emulators. | ||
│ ├── hub.ts # The central discovery service for all emulators. | ||
│ └── registry.ts # A static registry for running emulators to discover each other. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project structure diagram is missing the dataconnectEmulator.ts
file, which is a key component mentioned later in the document. The description for the dataconnect/
directory could be more precise.
│ ├── dataconnect/ # Data Connect Emulator specific logic. | |
│ │ └── pgliteServer.ts # Manages the in-memory pglite Postgres instance. | |
│ ├── storage/ # Storage Emulator implementation. | |
│ ├── controller.ts # Main controller to start, stop, and manage emulators. | |
│ ├── downloadableEmulators.ts # Handles downloading of JAR-based emulators. | |
│ ├── hub.ts # The central discovery service for all emulators. | |
│ └── registry.ts # A static registry for running emulators to discover each other. | |
│ ├── dataconnect/ # Core logic for Data Connect feature. | |
│ │ ├── client.ts # Client for interacting with the Data Connect backend API. | |
│ │ ├── load.ts # Logic for loading and parsing dataconnect.yaml and connector.yaml. | |
│ │ ├── schemaMigration.ts # Handles SQL schema diffing and migration. | |
│ │ └── build.ts # Logic for building schema and connectors from source. | |
│ ├── emulator/ | |
│ ├── auth/ # Auth Emulator implementation. | |
│ ├── dataconnect/ # Data Connect Emulator specific logic. | |
│ │ └── pgliteServer.ts # Manages the in-memory pglite Postgres instance. | |
│ │ └── dataconnectEmulator.ts # The Data Connect emulator. | |
│ ├── storage/ # Storage Emulator implementation. | |
│ ├── controller.ts # Main controller to start, stop, and manage emulators. | |
│ ├── downloadableEmulators.ts # Handles downloading of JAR-based emulators. | |
│ ├── hub.ts # The central discovery service for all emulators. | |
│ └── registry.ts # A static registry for running emulators to discover each other. |
│ ├── controller.ts # Main controller to start, stop, and manage emulators. | ||
│ ├── downloadableEmulators.ts # Handles downloading of JAR-based emulators. | ||
│ ├── hub.ts # The central discovery service for all emulators. | ||
│ └── registry.ts # A static registry for running emulators to discover each other. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would expect those FDC code be there.
- src/deploy/dataconnect
- src/mcp/tools/dataconnect
- template/init/dataconnect
- src/init/dataconnect
How is this created? Generated by AI? Those kind of docs if not co-located with code will get stable and obsolete very quickly. |
Yeah created by AI, wanted to get quick idea on how people feel about adding this. It can become obsolete but I feel like it will still capture 90+% of how things work unless there is a large refactor, in which case updating this file should be part of the PR ideally. Trying to hit a nice medium between being too specific and too general. For context: to generate this prompt I had to use around 850k token context which if I wanted to include all in gemini-cli it will run out of tokens quick. |
How do people feel about adding docs like these to provide quick context for contributing for llm agents (and people)?