feat(jdbc): centralize connection properties from BigQueryConnection and DataSource#4116
feat(jdbc): centralize connection properties from BigQueryConnection and DataSource#4116keshavdandeva wants to merge 10 commits intomainfrom
BigQueryConnection and DataSource#4116Conversation
Summary of ChangesHello @keshavdandeva, 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 refactors the way connection properties are handled within the BigQuery JDBC driver. By introducing a dedicated Highlights
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 centralizes connection property handling by introducing DataSource.fromUrl and refactoring BigQueryConnection to use it, aiming to improve maintainability and reduce code duplication. However, it introduces a critical functional regression in endpoint overrides, which could bypass private endpoints and violate security policies. There is also a potential NullPointerException in BigQueryJdbcOAuthUtility during authentication type retrieval, leading to application crashes. Additionally, consider improving consistency in default value handling and refactoring a large constructor for better readability.
...oud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a significant and valuable refactoring that centralizes connection property handling into the DataSource class. This greatly improves code organization and maintainability. My review focuses on ensuring the new implementation is fully equivalent to the old one and points out a few areas where regressions may have been introduced or where the code can be further simplified. I've identified a couple of high-severity issues related to missing default values for some properties and incorrect parsing logic, which could affect specific authentication configurations and property handling. I've also included some medium-severity suggestions for improving code clarity and robustness.
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java
Show resolved
Hide resolved
...cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java
Outdated
Show resolved
Hide resolved
...d-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a well-executed refactoring that centralizes connection property parsing into the DataSource class. This significantly improves the code's structure and maintainability by creating a single source of truth for connection properties. The new DataSource.fromUrl factory method is a clean and effective implementation. My review includes a couple of suggestions to remove minor code redundancies that arose from this refactoring, further improving code clarity.
...oud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java
Outdated
Show resolved
Hide resolved
...oud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request centralizes connection property handling from BigQueryConnection into the DataSource class, which is a significant improvement for code clarity and maintainability. The changes are well-implemented for the most part. My feedback focuses on a few areas where the centralization could be more complete to further improve the design, and one instance of code duplication that could be addressed.
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java
Outdated
Show resolved
Hide resolved
...oud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request effectively centralizes connection property management by introducing and utilizing a DataSource class. This refactoring significantly cleans up the BigQueryConnection constructor and removes redundant parsing logic from various utility classes. The changes are well-executed and improve the overall design. I have one minor suggestion to further simplify the code.
b/484306563