-
Notifications
You must be signed in to change notification settings - Fork 121
feat: Add JPA Database TaskStore #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @kabir, 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 delivers a significant enhancement by introducing a new module that implements the Highlights
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.
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 a new JPA-based TaskStore implementation, which is a great addition for enabling database persistence of tasks. The implementation is well-structured and includes comprehensive unit and integration tests. I've identified a few areas for improvement, including a bug in an integration test, a potential packaging issue with a CDI configuration file, and some opportunities to simplify the code and improve the entity definition. The documentation is clear, but could benefit from a warning about using automatic schema generation in production environments.
.../src/test/java/io/a2a/extras/taskstore/database/jpa/JpaDatabaseTaskStoreIntegrationTest.java
Outdated
Show resolved
Hide resolved
| quarkus.hibernate-orm.database.generation=update | ||
| ``` | ||
|
|
||
| #### For WildFly/Jakarta EE Servers | ||
|
|
||
| Create or update your `persistence.xml`: | ||
|
|
||
| ```xml | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <persistence xmlns="https://jakarta.ee/xml/ns/persistence" version="3.0"> | ||
| <persistence-unit name="a2a-java" transaction-type="JTA"> | ||
| <jta-data-source>java:jboss/datasources/A2ATasksDS</jta-data-source> | ||
|
|
||
| <class>io.a2a.extras.taskstore.database.jpa.JpaTask</class> | ||
| <exclude-unlisted-classes>true</exclude-unlisted-classes> | ||
|
|
||
| <properties> | ||
| <property name="jakarta.persistence.schema-generation.database.action" value="create"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of quarkus.hibernate-orm.database.generation=update and jakarta.persistence.schema-generation.database.action" value="create" is great for quick starts and development. However, it can be risky in production environments as it can lead to unintended schema modifications or data loss. It would be beneficial to add a note to the documentation recommending a more controlled schema migration strategy (like Flyway or Liquibase) for production use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is fine but added a comment saying to adjust these properties for your environment
...re-database-jpa/src/main/java/io/a2a/extras/taskstore/database/jpa/JpaDatabaseTaskStore.java
Show resolved
Hide resolved
extras/taskstore-database-jpa/src/main/java/io/a2a/extras/taskstore/database/jpa/JpaTask.java
Outdated
Show resolved
Hide resolved
# Description Fixes a2aproject#279 and a2aproject#278
Description
Fixes #279 and #278