feat!: Update TaskState enums#660
Conversation
Use the protobuf names for the TaskState enums and remove their textual representations so that the enum names are consistent with their String name. Rename UNKNOWN to UNRECOGNIZED to be consistent with the Protobuf definitions. TaskState.TASK_STATE_SUBMITTED is a mouthful but we have static imports for a reason :) This impacts the JPA serialization but I think it's worth having the same textual representation for the task state on the wire and the DB. Remove the TaskStateAdapter that is no longer needed for the JSON serialization. This fixes a2aproject#652. Signed-off-by: Jeff Mesnil <jmesnil@ibm.com>
Summary of ChangesHello @jmesnil, 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 standardizes the naming and handling of Highlights
Changelog
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
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring to align the TaskState enums with Protobuf naming conventions. The changes, including renaming enums to TASK_STATE_*, removing the custom TaskStateAdapter, and updating JPA serialization, have been applied consistently across the entire codebase. This improves consistency between the code, on-wire format, and database representation. The code is cleaner and more maintainable as a result. The breaking change is intentional and clearly communicated. Overall, this is an excellent improvement.
There was a problem hiding this comment.
Code Review
This pull request successfully updates the TaskState enums to align with the Protobuf naming conventions. This is a significant and breaking change, as noted in the title, but it has been executed thoroughly and consistently across the entire codebase. The refactoring simplifies the TaskState enum by removing the custom string representation and TaskStateTypeAdapter, leading to a more unified representation of task states across the database, JSON, and gRPC layers. All tests have been updated to reflect these changes, ensuring the new enum names and serialization behavior are correctly handled. The code simplifications in JpaTask.java and RestHandler.java are also welcome improvements. Overall, this is a well-executed refactoring that improves consistency.
Use the protobuf names for the TaskState enums and remove their
textual representations so that the enum names are consistent with their String name.
Rename UNKNOWN to UNRECOGNIZED to be consistent with the Protobuf definitions.
TaskState.TASK_STATE_SUBMITTED is a mouthful but we have static imports for a reason :)
This impacts the JPA serialization but I think it's worth having the same textual representation
for the task state on the wire and the DB.
Remove the TaskStateAdapter that is no longer needed for the JSON serialization.
This fixes #652.