Conversation
… the project folder hasn't been setup - If the Firebase project hasn't been setup or dataconnect feature hasn't been setup, run the same flow as `firebase init dataconnect` (in src/init/features/dataconnect/index.ts) - If the dataconnect feature is setup, but generated SDK hasn't been setup, run the same flow as `firebase init dataconnect:sdk` (in src/init/features/dataconnect/sdk.ts) Then continue with the remaining steps~
Summary of ChangesHello @fredzqm, 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 significantly improves the developer experience for Firebase Data Connect users by making the Highlights
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 improves the dataconnect:sdk:generate command by automatically running the necessary initialization steps if the project isn't set up for Data Connect or for SDK generation. The changes are logical and enhance the user experience.
I've identified a couple of areas for improvement:
- There's a high-severity bug where the command can hang if SDK setup is aborted by the user.
- There is some duplicated code that could be refactored to improve maintainability.
Details are in the specific comments.
|
|
||
| let serviceInfosWithSDKs = await loadAllWithSDKs(projectId, config); | ||
| if (!serviceInfosWithSDKs.length) { | ||
| if (justRanInit || options.nonInteractive) { |
There was a problem hiding this comment.
I think we should continue to ask SDK questions even if justRanInit. The command being run is firebase dataconnect:sdk:generate -- which means the user is clearly interested in SDKs. Let's give them SDKs.
There was a problem hiding this comment.
The only way they can get here is:
firebase init dataconnect already asked whether they want to an app template, and they said no. Maybe they want to create their own app, but right now we don't support generating SDKs without a linked app.
This is the second screenshot above. If we run init sdk again, it would just fails with a different error.
…ow' into dataconnect-sdk-generate-init-flow
|
Improved the app detection logging message based on feedback |

Improve
dataconnect:sdk:generate's behavior when the project folder hasn't been setupfirebase init dataconnect(in src/init/features/dataconnect/index.ts)firebase init dataconnect:sdk(in src/init/features/dataconnect/sdk.ts)Then continue with the remaining steps~
We can position
firebase dataconnect:sdk:generate --watchas that single command to setup up everything you need to use data connect in an app.In an empty folder
In a folder with firebase.json, but not dataconnect
In a folder with firebase.json & dataconnect, but no gen SDK setup
In a folder with gen SDK setup