Skip to content

Commit 5f3f063

Browse files
averikitschYuan325
andauthored
feat(source/alloydb)!: restructure prebuilt toolsets (googleapis#2639)
… tools tests ## Description > Should include a concise description of the changes (bug or feature), it's > impact, along with a summary of the solution ## PR Checklist > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [ ] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here> --------- Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
1 parent 5834ed8 commit 5f3f063

7 files changed

Lines changed: 740 additions & 506 deletions

File tree

.ci/integration.cloudbuild.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ steps:
134134
- "ALLOYDB_POSTGRES_DATABASE=$_DATABASE_NAME"
135135
- "ALLOYDB_POSTGRES_REGION=$_REGION"
136136
- "SERVICE_ACCOUNT_EMAIL=$SERVICE_ACCOUNT_EMAIL"
137-
secretEnv: ["ALLOYDB_POSTGRES_USER", "ALLOYDB_POSTGRES_PASS", "CLIENT_ID", "API_KEY"]
137+
secretEnv: ["ALLOYDB_POSTGRES_USER", "ALLOYDB_POSTGRES_PASSWORD", "CLIENT_ID", "API_KEY"]
138138
volumes:
139139
- name: "go"
140140
path: "/gopath"
@@ -1056,7 +1056,7 @@ availableSecrets:
10561056
- versionName: projects/$PROJECT_ID/secrets/alloydb_pg_user/versions/latest
10571057
env: ALLOYDB_POSTGRES_USER
10581058
- versionName: projects/$PROJECT_ID/secrets/alloydb_pg_pass/versions/latest
1059-
env: ALLOYDB_POSTGRES_PASS
1059+
env: ALLOYDB_POSTGRES_PASSWORD
10601060
- versionName: projects/$PROJECT_ID/secrets/alloydb_ai_nl_user/versions/latest
10611061
env: ALLOYDB_AI_NL_USER
10621062
- versionName: projects/$PROJECT_ID/secrets/alloydb_ai_nl_pass/versions/latest

cmd/internal/tools_file_test.go

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,9 +1626,33 @@ func TestPrebuiltTools(t *testing.T) {
16261626
name: "alloydb omni prebuilt tools",
16271627
in: alloydb_omni_config,
16281628
wantToolset: server.ToolsetConfigs{
1629-
"alloydb_omni_database_tools": tools.ToolsetConfig{
1630-
Name: "alloydb_omni_database_tools",
1631-
ToolNames: []string{"execute_sql", "list_tables", "list_active_queries", "list_available_extensions", "list_installed_extensions", "list_autovacuum_configurations", "list_columnar_configurations", "list_columnar_recommended_columns", "list_memory_configurations", "list_top_bloated_tables", "list_replication_slots", "list_invalid_indexes", "get_query_plan", "list_views", "list_schemas", "database_overview", "list_triggers", "list_indexes", "list_sequences", "long_running_transactions", "list_locks", "replication_stats", "list_query_stats", "get_column_cardinality", "list_publication_tables", "list_tablespaces", "list_pg_settings", "list_database_stats", "list_roles", "list_table_stats", "list_stored_procedure"},
1629+
"data": tools.ToolsetConfig{
1630+
Name: "data",
1631+
ToolNames: []string{"execute_sql", "list_tables", "list_views", "list_schemas", "list_triggers", "list_indexes", "list_sequences", "list_stored_procedure"},
1632+
},
1633+
"performance": tools.ToolsetConfig{
1634+
Name: "performance",
1635+
ToolNames: []string{"execute_sql", "get_query_plan", "list_query_stats", "get_column_cardinality", "list_table_stats", "list_database_stats", "list_active_queries"},
1636+
},
1637+
"monitor": tools.ToolsetConfig{
1638+
Name: "monitor",
1639+
ToolNames: []string{"database_overview", "list_active_queries", "long_running_transactions", "list_locks", "list_database_stats", "list_pg_settings"},
1640+
},
1641+
"optimize": tools.ToolsetConfig{
1642+
Name: "optimize",
1643+
ToolNames: []string{"list_pg_settings", "list_memory_configurations", "list_available_extensions", "list_installed_extensions", "list_autovacuum_configurations", "list_columnar_configurations", "list_columnar_recommended_columns"},
1644+
},
1645+
"health": tools.ToolsetConfig{
1646+
Name: "health",
1647+
ToolNames: []string{"list_top_bloated_tables", "list_invalid_indexes", "list_table_stats", "list_tablespaces", "database_overview", "list_autovacuum_configurations"},
1648+
},
1649+
"replication": tools.ToolsetConfig{
1650+
Name: "replication",
1651+
ToolNames: []string{"replication_stats", "list_replication_slots", "list_publication_tables", "database_overview"},
1652+
},
1653+
"access-control": tools.ToolsetConfig{
1654+
Name: "access-control",
1655+
ToolNames: []string{"list_roles", "list_pg_settings", "database_overview"},
16321656
},
16331657
},
16341658
},
@@ -1676,9 +1700,33 @@ func TestPrebuiltTools(t *testing.T) {
16761700
name: "alloydb prebuilt tools",
16771701
in: alloydb_config,
16781702
wantToolset: server.ToolsetConfigs{
1679-
"alloydb_postgres_database_tools": tools.ToolsetConfig{
1680-
Name: "alloydb_postgres_database_tools",
1681-
ToolNames: []string{"execute_sql", "list_tables", "list_active_queries", "list_available_extensions", "list_installed_extensions", "list_autovacuum_configurations", "list_memory_configurations", "list_top_bloated_tables", "list_replication_slots", "list_invalid_indexes", "get_query_plan", "list_views", "list_schemas", "database_overview", "list_triggers", "list_indexes", "list_sequences", "long_running_transactions", "list_locks", "replication_stats", "list_query_stats", "get_column_cardinality", "list_publication_tables", "list_tablespaces", "list_pg_settings", "list_database_stats", "list_roles", "list_table_stats", "list_stored_procedure"},
1703+
"admin": tools.ToolsetConfig{
1704+
Name: "admin",
1705+
ToolNames: []string{"create_cluster", "get_cluster", "list_clusters", "create_instance", "get_instance", "list_instances", "database_overview", "wait_for_operation"},
1706+
},
1707+
"access-management": tools.ToolsetConfig{
1708+
Name: "access-management",
1709+
ToolNames: []string{"create_user", "list_users", "get_user", "list_roles", "list_pg_settings", "database_overview"},
1710+
},
1711+
"data": tools.ToolsetConfig{
1712+
Name: "data",
1713+
ToolNames: []string{"execute_sql", "list_tables", "list_views", "list_schemas", "list_triggers", "list_indexes", "list_sequences", "list_stored_procedure"},
1714+
},
1715+
"monitor": tools.ToolsetConfig{
1716+
Name: "monitor",
1717+
ToolNames: []string{"list_active_queries", "list_query_stats", "get_query_plan", "get_query_metrics", "get_system_metrics", "long_running_transactions", "list_locks", "list_database_stats"},
1718+
},
1719+
"health": tools.ToolsetConfig{
1720+
Name: "health",
1721+
ToolNames: []string{"list_top_bloated_tables", "list_invalid_indexes", "list_table_stats", "get_column_cardinality", "list_autovacuum_configurations", "list_tablespaces", "database_overview", "get_instance"},
1722+
},
1723+
"optimize": tools.ToolsetConfig{
1724+
Name: "optimize",
1725+
ToolNames: []string{"list_available_extensions", "list_installed_extensions", "list_memory_configurations", "list_pg_settings", "database_overview", "get_cluster"},
1726+
},
1727+
"replication": tools.ToolsetConfig{
1728+
Name: "replication",
1729+
ToolNames: []string{"replication_stats", "list_replication_slots", "list_publication_tables", "list_instances", "get_instance", "database_overview"},
16821730
},
16831731
},
16841732
},

0 commit comments

Comments
 (0)