Skip to content

Conversation

@brfrn169
Copy link
Collaborator

@brfrn169 brfrn169 commented Aug 11, 2025

Description

This PR removes deprecated API usages. The changes were primarily made using Claude Code.

Related issues and/or PRs

N/A

Changes made

  • Removed deprecated API usages from Attribute.
  • Removed deprecated Key constructors usages.
  • Removed deprecated ConditionalExpression constructors usages.
  • Removed deprecated condition constructors usages.
  • Removed deprecated Scan.Ordering constructor usages.
  • Removed deprecated methods usages of ConditionalExpression.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

N/A

@brfrn169 brfrn169 requested a review from Copilot August 11, 2025 15:29
@brfrn169 brfrn169 self-assigned this Aug 11, 2025
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 @brfrn169, 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 focuses on a large-scale refactoring effort to eliminate deprecated API usages throughout the codebase. The changes involve updating various constructor calls and helper methods to align with modern API design patterns, particularly for key and condition handling. This initiative aims to improve code maintainability, readability, and ensure compatibility with future library versions.

Highlights

  • Modernization of API Constructors: The pull request systematically replaces deprecated constructors for Key, ConditionalExpression, and Scan.Ordering with their modern, recommended static factory methods. This improves code readability and adherence to current API standards.
  • Migration to ConditionBuilder Utilities: Deprecated condition builder constructors like PutIf, DeleteIf, PutIfExists, and PutIfNotExists are updated to use the ConditionBuilder utility class, centralizing condition creation and enhancing type safety.
  • Refactoring of Attribute Class Usage: The Attribute class, which defines transaction-related column names, has been refactored to remove deprecated helper methods that converted raw types to Value objects. Direct column creation or specific withValue methods are now used, simplifying attribute handling.
  • Comprehensive Test Suite Updates: A significant portion of the changes involves updating existing test cases across various storage implementations (Cassandra, Cosmos, Dynamo, JDBC) and transaction components to reflect the new API usages, ensuring continued correctness and 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.

This comment was marked as outdated.

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 does a great job of removing deprecated API usages throughout the codebase, which is an important maintenance task. The changes are largely correct and improve the code's modernity. I've found a few potential issues in the test files, likely introduced by the automated code generation tool, where some method arguments seem to have been changed incorrectly. Please see my detailed comments for specifics.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
@brfrn169 brfrn169 requested a review from Copilot August 11, 2025 23:15
Copy link
Contributor

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 removes deprecated API usages from the codebase, primarily focusing on modernizing Key constructors, ConditionalExpression usage, and Attribute helper methods. The changes improve code maintainability by eliminating legacy APIs and adopting recommended patterns.

  • Replaced deprecated Key constructors with modern static factory methods (Key.ofInt, Key.ofText, Key.of)
  • Updated deprecated Attribute.to*Value() methods to use direct column construction and value assignment
  • Modernized conditional expression construction using ConditionBuilder instead of deprecated constructors

Reviewed Changes

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

Show a summary per file
File Description
TwoPhaseConsensusCommitSpecificIntegrationTestBase.java Updated Key constructors and Attribute methods to non-deprecated equivalents
ConsensusCommitSpecificIntegrationTestBase.java Replaced deprecated Key constructors with static factory methods
TwoPhaseCommitTransactionIntegrationTestBase.java Modernized Key construction patterns
DistributedTransactionIntegrationTestBase.java Updated Key constructors throughout test methods
DistributedTransactionAdminIntegrationTestBase.java Replaced deprecated Key constructor usage
DistributedStoragePermissionIntegrationTestBase.java Updated conditional expression construction using ConditionBuilder
DistributedStorageIntegrationTestBase.java Modernized condition builders and Key constructors
DistributedStorageAdminIntegrationTestBase.java Updated Key constructor usage
JdbcTransactionManagerTest.java Replaced deprecated Key constructors with factory methods
Multiple consensus commit test files Updated Attribute helper methods and Key constructors
Multiple storage test files Modernized Key construction and conditional expressions

@brfrn169
Copy link
Collaborator Author

/gemini review

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 does a great job of removing deprecated API usages throughout the codebase, replacing them with modern, builder-style alternatives. The changes are extensive and well-executed. I've found a few minor issues in the test files where the refactoring might have unintentionally altered the test logic. Please see my detailed comments.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@brfrn169
Copy link
Collaborator Author

/gemini review

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 effectively removes a significant number of deprecated API usages across the codebase. The changes primarily involve replacing deprecated constructors for Key, ConditionalExpression, Scan.Ordering, and various condition classes with their modern static factory methods or builders. The refactoring has been applied consistently and correctly throughout the production and test code. The removal of helper methods from Attribute.java and updating the call sites is also a good cleanup. Overall, these changes improve the code's adherence to the current API and enhance maintainability. The pull request looks good to merge.

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@brfrn169 brfrn169 merged commit a09a04a into master Aug 19, 2025
157 of 160 checks passed
@brfrn169 brfrn169 deleted the remove-deprecated-api-usages1 branch August 19, 2025 08:43
feeblefakie pushed a commit that referenced this pull request Aug 19, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
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.

4 participants