chore!:update config kind from plural to singular#2737
chore!:update config kind from plural to singular#2737Yuan325 wants to merge 1 commit intoremove-deprecationfrom
kind from plural to singular#2737Conversation
kind from plural to singular
Link Resolution NoteLocal links and directory changes work differently on GitHub than on the docsite. You must ensure fixes pass the GitHub check and also work with Summary
Errors per inputErrors in DEVELOPER.md
Errors in docs/en/resources/sources/alloydb-admin.mdErrors in docs/en/resources/sources/bigquery.mdErrors in docs/en/resources/sources/cloud-healthcare.mdErrors in docs/en/resources/sources/cloud-logging-admin.mdErrors in docs/en/resources/sources/cloud-monitoring.mdErrors in docs/en/resources/sources/cloud-sql-mysql.mdErrors in docs/en/resources/sources/cloud-sql-pg.mdErrors in docs/en/resources/sources/dataplex.mdErrors in docs/en/resources/sources/dataproc.mdErrors in docs/en/resources/sources/redis.mdErrors in docs/en/resources/sources/serverless-spark.mdErrors in docs/en/resources/sources/spanner.mdErrors in docs/en/resources/sources/valkey.mdErrors in docs/en/resources/tools/alloydb/alloydb-create-cluster.md
Errors in docs/en/resources/tools/alloydb/alloydb-create-instance.md
Errors in docs/en/resources/tools/alloydb/alloydb-create-user.md
Errors in docs/en/resources/tools/bigquery/bigquery-sql.mdErrors in docs/en/resources/tools/bigtable/bigtable-sql.mdErrors in docs/en/resources/tools/cloudsql/cloudsqlcloneinstance.mdErrors in docs/en/resources/tools/cloudsql/cloudsqlrestorebackup.mdErrors in docs/en/resources/tools/spanner/spanner-sql.mdErrors in docs/en/samples/alloydb/mcp_quickstart.md |
Summary of ChangesHello, 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 refactoring of configuration definitions, moving from plural to singular naming conventions for 'kind' fields. This change enhances consistency and readability across configuration files, internal parsing logic, and user-facing documentation. The update ensures that the system uniformly recognizes and processes configuration types, simplifying future development and maintenance efforts. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a breaking change by updating the configuration kind values from plural to singular across the entire project. The changes are extensive, affecting documentation, tests, and configuration parsing logic. The implementation correctly handles backward compatibility for the v1 configuration format. My main feedback is a suggestion to refactor a block of if statements into a switch statement for improved code clarity and maintainability in cmd/internal/tools_file.go.
| if key == "authSources" { | ||
| key = "authServices" | ||
| } | ||
| if key == "sources" { | ||
| key = "source" | ||
| } | ||
| if key == "authServices" { | ||
| key = "authService" | ||
| } | ||
| if key == "embeddingModels" { | ||
| key = "embeddingModel" | ||
| } | ||
| if key == "tools" { | ||
| key = "tool" | ||
| } | ||
| if key == "toolsets" { | ||
| key = "toolset" | ||
| } | ||
| if key == "prompts" { | ||
| key = "prompt" | ||
| } |
There was a problem hiding this comment.
This series of if statements for converting old configuration keys to new ones could be simplified and made more readable by using a switch statement. This would make the logic clearer, especially the chained conversion of authSources to authService, and improve future maintainability.
switch key {
case "authSources", "authServices":
key = "authService"
case "sources":
key = "source"
case "embeddingModels":
key = "embeddingModel"
case "tools":
key = "tool"
case "toolsets":
key = "toolset"
case "prompts":
key = "prompt"
}
Update all the
kindvalue from plural to singular. This breaking change only affect users that are currently using the config file v2 format.Config file with the v1 format will still be compatible since we manually convert the config file to the right format under the hood.