Skip to content

feat(mysql): add MysqlSkillRepository and associated tests for skill …#600

Merged
LearningGp merged 17 commits into
agentscope-ai:mainfrom
jianjun159:skill_mysql
Mar 17, 2026
Merged

feat(mysql): add MysqlSkillRepository and associated tests for skill …#600
LearningGp merged 17 commits into
agentscope-ai:mainfrom
jianjun159:skill_mysql

Conversation

@jianjun159
Copy link
Copy Markdown
Contributor

…management

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.7, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

version: 1.0.7

Description

[Please describe the background, purpose, changes made, and how to test this PR]

feat(mysql): add MysqlSkillRepository and associated tests for skill management #599

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@jianjun159 jianjun159 requested a review from a team January 19, 2026 07:53
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @jianjun159, 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 introduces a significant enhancement to the AgentScope-Java framework by integrating MySQL as a persistent storage solution for agent skills. It provides a robust and secure mechanism for managing skill metadata and associated resources, allowing for scalable and reliable skill management within AgentScope applications. This addition expands the data persistence options available for AgentScope components.

Highlights

  • New Module Introduction: A new Maven module, agentscope-extensions-skill-mysql, has been added to provide MySQL database integration for skill management.
  • MySQL Skill Repository Implementation: The MysqlSkillRepository class implements the AgentSkillRepository interface, enabling AgentSkill objects and their associated resources to be stored, retrieved, updated, and deleted in a MySQL database.
  • Robust Database Operations: The repository supports automatic table creation, full CRUD operations, transaction management for atomic operations, and robust identifier validation to prevent SQL injection vulnerabilities.
  • Flexible Configuration: A builder pattern is provided for flexible configuration of the MysqlSkillRepository, allowing customization of database and table names, and read/write permissions.
  • Comprehensive Unit Testing: Extensive unit tests have been added to cover constructor behavior, CRUD operations, read-only mode, repository information, and critical SQL injection prevention mechanisms.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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
Copy Markdown

@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 a MysqlSkillRepository for persisting agent skills in a MySQL database. The implementation is robust, with good practices like using a builder pattern, transaction management, and validation to prevent SQL injection. The accompanying unit tests are comprehensive and well-structured.

I've identified a few areas for improvement, primarily concerning data integrity, performance, and transactional behavior. My key recommendations are:

  • Enforcing data integrity by adding the documented foreign key constraint to the database schema.
  • Optimizing the getAllSkills method to resolve an N+1 query issue.
  • Revisiting the transaction logic in the save method to handle lists of skills more predictably.
  • A minor performance enhancement in resource insertion and a correction in the corresponding unit test.

Overall, this is a solid contribution. Addressing these points will make the repository more performant and resilient.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 72.92818% with 98 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/skill/repository/mysql/MysqlSkillRepository.java 72.92% 87 Missing and 11 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

@fang-tech PTAL

@fang-tech
Copy link
Copy Markdown
Collaborator

@fang-tech PTAL

👌

Comment thread docs/zh/task/agent-skill.md Outdated
Comment thread docs/zh/task/agent-skill.md Outdated
Comment thread agentscope-extensions/agentscope-extensions-skill-mysql/pom.xml Outdated
Copy link
Copy Markdown
Collaborator

@fang-tech fang-tech left a comment

Choose a reason for hiding this comment

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

LGTM, tks for your contribution!

Comment thread docs/zh/task/agent-skill.md Outdated
Comment thread docs/en/task/agent-skill.md Outdated
Comment thread docs/en/task/agent-skill.md
Comment thread docs/en/task/agent-skill.md Outdated
Comment thread docs/en/task/agent-skill.md
@fang-tech
Copy link
Copy Markdown
Collaborator

Update the unnecessary modifications in the English document

@jianjun159
Copy link
Copy Markdown
Contributor Author

Update the unnecessary modifications in the English document

Ok. Now the content of the Chinese document and the English document is consistent

@fang-tech
Copy link
Copy Markdown
Collaborator

@AlbumenJ help to merge

@LearningGp
Copy link
Copy Markdown
Collaborator

image

# Conflicts:
#	agentscope-distribution/agentscope-all/pom.xml
@jianjun159
Copy link
Copy Markdown
Contributor Author

image

The latest branch code has been merged and this conflict has been resolved

@LearningGp
Copy link
Copy Markdown
Collaborator

Please ensure all review comments are resolved before we proceed. Kindly take another look.

@jianjun159
Copy link
Copy Markdown
Contributor Author

Please ensure all review comments are resolved before we proceed. Kindly take another look.

All the review comments have been resolved. Thank you for your review

Copy link
Copy Markdown
Collaborator

@LearningGp LearningGp left a comment

Choose a reason for hiding this comment

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

LGTM

@fang-tech
Copy link
Copy Markdown
Collaborator

Thx for your contribution! Great job!

@LearningGp LearningGp merged commit bdad871 into agentscope-ai:main Mar 17, 2026
8 of 10 checks passed
liangxingguang pushed a commit to liangxingguang/agentscope-java that referenced this pull request May 21, 2026
agentscope-ai#600)

…management

## AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.7, check
your pom.xml dependency version or run `mvn dependency:tree | grep
agentscope-parent:pom`(only mac/linux)]

version: 1.0.7

## Description

[Please describe the background, purpose, changes made, and how to test
this PR]

feat(mysql): add MysqlSkillRepository and associated tests for skill
management agentscope-ai#599

## Checklist

Please check the following items before code is ready to be reviewed.

- [x]  Code has been formatted with `mvn spotless:apply`
- [x]  All tests are passing (`mvn test`)
- [x]  Javadoc comments are complete and follow project conventions
- [x] Related documentation has been updated (e.g. links, examples,
etc.)
- [x]  Code is ready for review

---------

Co-authored-by: jianjun.xu <jianjun.xu@ly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants