Skip to content

Conversation

dconeybe
Copy link
Contributor

In cl/795582011 the "gradle generate" command of the data connect executable was changed to "sdk generate -platform=kotlin". This PR updates the data connect gradle plugin to detect which of these two "calling conventions" should be used, as uses the right one. This allows the gradle plugin to transparently use data connect executables both before and after this change.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 @dconeybe, 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 adapts the Data Connect Gradle plugin to support both legacy ("gradle generate") and new ("sdk generate -platform=kotlin") command-line conventions for the Data Connect executable. This ensures the plugin remains compatible with different versions of the executable by dynamically detecting and using the correct command structure.

Highlights

  • Enhanced DataConnectExecutableConfig: Added "connectorId" and "platform" fields to support the new "sdk generate" command arguments.
  • Dynamic Command Execution: The "DataConnectGenerateCodeTask" now dynamically selects between "gradle generate" and "sdk generate" subcommands, and adjusts the arguments ("-connectors" vs "-connector_id", and "-platform=kotlin") based on the detected executable convention.
  • Automatic Convention Detection: A new mechanism was introduced to automatically determine the correct calling convention of the Data Connect executable by testing its "help generate" output, ensuring seamless compatibility.
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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 support for the sdk generate command to the Data Connect Gradle plugin, ensuring compatibility with newer versions of the Data Connect executable. The implementation correctly detects which command to use and passes the appropriate arguments. The changes are well-implemented, but I have a couple of suggestions to improve adherence to Gradle best practices and enhance code idiomaticity.

@firebase firebase deleted a comment from google-oss-bot Aug 18, 2025
@firebase firebase deleted a comment from github-actions bot Aug 18, 2025
@dconeybe dconeybe requested a review from Copilot August 18, 2025 19:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Firebase Data Connect Gradle plugin to support both legacy and new command-line interfaces for the Data Connect executable. The change accommodates the August 2025 transition from "gradle generate" to "sdk generate -platform=kotlin" subcommands.

  • Added automatic detection of which calling convention the Data Connect executable supports
  • Updated task configuration to use the appropriate command format based on detected capabilities
  • Extended the executable launcher to handle both parameter naming schemes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
DataConnectGradlePlugin.kt Adds calling convention detection to the code generation task configuration
DataConnectGenerateCodeTask.kt Implements calling convention detection logic and adapts command execution based on detected format
DataConnectExecutableLauncher.kt Extends executable configuration interface to support both legacy and new parameter names

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 introduces support for the sdk generate command in the Data Connect Gradle plugin, ensuring backward compatibility with the older gradle generate command by automatically detecting the correct one to use. The implementation is robust, particularly the logic for detecting the supported calling convention. I have a couple of minor suggestions to enhance code conciseness and readability.

@firebase firebase deleted a comment from google-oss-bot Aug 18, 2025
@firebase firebase deleted a comment from google-oss-bot Aug 18, 2025
@firebase firebase deleted a comment from github-actions bot Aug 18, 2025
@dconeybe dconeybe merged commit e296249 into main Aug 18, 2025
56 of 57 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/SdkGenerate branch August 18, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants