Skip to content

[fz/fdc-init-gemini] Fix dataconnect tests#8991

Merged
fredzqm merged 1 commit into
fz/fdc-init-geminifrom
fix-dataconnect-tests
Aug 17, 2025
Merged

[fz/fdc-init-gemini] Fix dataconnect tests#8991
fredzqm merged 1 commit into
fz/fdc-init-geminifrom
fix-dataconnect-tests

Conversation

@fredzqm

@fredzqm fredzqm commented Aug 17, 2025

Copy link
Copy Markdown
Contributor

Jules prompt:

https://github.com/firebase/firebase-tools/pull/8988

Help me fix unit tests in this PR. Only modify test code.

I got this test failure from unit test CI/CD

3274 passing (27s) 4 pending 5 failing

init dataconnect actuation empty project should generate template:

AssertionError: expected true to equal false

expected - actual -true +false

at Context.

init dataconnect actuation existing project should use existing directory:

AssertionError: expected true to equal false

expected - actual -true +false

at Context.

init dataconnect actuation should write schema files:

AssertionError: expected true to equal false

expected - actual -true +false

at Context.

The `init dataconnect` actuation tests were failing due to a change
in the provisioning logic. The tests expected Cloud SQL provisioning
to be skipped in some cases, but the new logic always provisions
Cloud SQL when a project has billing enabled.

This change updates the tests to reflect the new behavior by
changing `expectCSQLProvisioning` from `false` to `true` in the
affected test cases.
@fredzqm fredzqm changed the base branch from master to fz/fdc-init-gemini August 17, 2025 23:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @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 refactors the firebase init dataconnect command to streamline the initialization process for Firebase Data Connect services. It introduces deeper integration with Gemini for automated schema and operation generation based on user descriptions, and enhances the Cloud SQL provisioning flow to be more robust and automated. The changes also update existing unit tests to align with the new initialization logic, resolving previous assertion failures related to Cloud SQL provisioning expectations.

Highlights

  • Enhanced Data Connect Initialization: The firebase init dataconnect command has been significantly refactored to provide a more seamless setup experience, including automated Cloud SQL provisioning and intelligent handling of existing services.
  • Gemini Integration for Schema Generation: Users can now provide an app description during initialization, allowing Gemini to automatically generate Data Connect schemas, connectors, and seed data, accelerating development.
  • Improved Cloud SQL Provisioning Logic: The Cloud SQL provisioning process is now more automated, handling instance and database creation with unique ID generation and improved logging, reducing manual intervention.
  • Refactored Data Models and Prompts: Internal data structures (RequiredInfo) and user prompts within the init flow have been updated to support the new features and streamlined process.
  • Test Suite Alignment: Unit tests for the dataconnect init command have been updated to reflect the new Cloud SQL provisioning behavior and data models, resolving previous AssertionError failures.
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 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

  1. 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.

@fredzqm fredzqm merged commit 0050c9c into fz/fdc-init-gemini Aug 17, 2025
16 checks passed
@fredzqm fredzqm deleted the fix-dataconnect-tests branch August 17, 2025 23:10
@fredzqm fredzqm changed the title Fix dataconnect tests [fz/fdc-init-gemini] Fix dataconnect tests Aug 17, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 addresses failing unit tests for the Data Connect feature initialization. The changes correctly update the test expectations for Cloud SQL provisioning. Previously, several tests incorrectly expected that Cloud SQL would not be provisioned, leading to assertion failures. The fix aligns the tests with the current logic in the actuate function, which provisions Cloud SQL for projects with billing enabled. The changes are accurate and resolve the test failures described in the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant