Skip to content

Commit 88b8601

Browse files
drstrangelookerAjmeraParth132
authored andcommitted
feat!(tools/looker): Factor Looker LookML development tools into their own prebuilt config (googleapis#2559)
## Description In order to reduce the bloat of tools, users who do not need LookML development tools can use `--prebuilt looker`, while users that need the full suite of tools can use `--prebuilt looker,looker-dev` ## 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: - [x] 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 - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - [x] Make sure to add `!` if this involve a breaking change
1 parent 423d2da commit 88b8601

5 files changed

Lines changed: 445 additions & 386 deletions

File tree

cmd/internal/tools_file_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ func TestPrebuiltTools(t *testing.T) {
14781478
mysql_config, _ := prebuiltconfigs.Get("mysql")
14791479
mssql_config, _ := prebuiltconfigs.Get("mssql")
14801480
looker_config, _ := prebuiltconfigs.Get("looker")
1481+
looker_dev_config, _ := prebuiltconfigs.Get("looker-dev")
14811482
lookerca_config, _ := prebuiltconfigs.Get("looker-conversational-analytics")
14821483
postgresconfig, _ := prebuiltconfigs.Get("postgres")
14831484
spanner_config, _ := prebuiltconfigs.Get("spanner")
@@ -1792,7 +1793,17 @@ func TestPrebuiltTools(t *testing.T) {
17921793
wantToolset: server.ToolsetConfigs{
17931794
"looker_tools": tools.ToolsetConfig{
17941795
Name: "looker_tools",
1795-
ToolNames: []string{"get_models", "get_explores", "get_dimensions", "get_measures", "get_filters", "get_parameters", "query", "query_sql", "query_url", "get_looks", "run_look", "make_look", "get_dashboards", "run_dashboard", "make_dashboard", "add_dashboard_element", "add_dashboard_filter", "generate_embed_url", "health_pulse", "health_analyze", "health_vacuum", "dev_mode", "get_projects", "get_project_files", "get_project_file", "create_project_file", "update_project_file", "delete_project_file", "get_project_directories", "create_project_directory", "delete_project_directory", "validate_project", "get_connections", "get_connection_schemas", "get_connection_databases", "get_connection_tables", "get_connection_table_columns", "get_lookml_tests", "run_lookml_tests", "create_view_from_table"},
1796+
ToolNames: []string{"get_models", "get_explores", "get_dimensions", "get_measures", "get_filters", "get_parameters", "query", "query_sql", "query_url", "get_looks", "run_look", "make_look", "get_dashboards", "run_dashboard", "make_dashboard", "add_dashboard_element", "add_dashboard_filter", "generate_embed_url"},
1797+
},
1798+
},
1799+
},
1800+
{
1801+
name: "looker dev prebuilt tools",
1802+
in: looker_dev_config,
1803+
wantToolset: server.ToolsetConfigs{
1804+
"looker_dev_tools": tools.ToolsetConfig{
1805+
Name: "looker_dev_tools",
1806+
ToolNames: []string{"health_pulse", "health_analyze", "health_vacuum", "dev_mode", "get_projects", "get_project_files", "get_project_file", "create_project_file", "update_project_file", "delete_project_file", "get_project_directories", "create_project_directory", "delete_project_directory", "validate_project", "get_connections", "get_connection_schemas", "get_connection_databases", "get_connection_tables", "get_connection_table_columns", "get_lookml_tests", "run_lookml_tests", "create_view_from_table"},
17961807
},
17971808
},
17981809
},

docs/en/reference/prebuilt-tools.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,23 @@ See [Usage Examples](../reference/cli.md#examples).
547547
* `add_dashboard_element`: Adds a tile to a dashboard.
548548
* `add_dashboard_filter`: Adds a filter to a dashboard.
549549
* `generate_embed_url`: Generate an embed url for content.
550+
551+
## Looker Dev
552+
553+
* `--prebuilt` value: `looker-dev`
554+
* **Environment Variables:**
555+
* `LOOKER_BASE_URL`: The URL of your Looker instance.
556+
* `LOOKER_CLIENT_ID`: The client ID for the Looker API.
557+
* `LOOKER_CLIENT_SECRET`: The client secret for the Looker API.
558+
* `LOOKER_VERIFY_SSL`: Whether to verify SSL certificates.
559+
* `LOOKER_USE_CLIENT_OAUTH`: Whether to use OAuth for authentication.
560+
* `LOOKER_SHOW_HIDDEN_MODELS`: Whether to show hidden models.
561+
* `LOOKER_SHOW_HIDDEN_EXPLORES`: Whether to show hidden explores.
562+
* `LOOKER_SHOW_HIDDEN_FIELDS`: Whether to show hidden fields.
563+
* **Permissions:**
564+
* A Looker account with permissions to access the desired projects
565+
and LookML is required.
566+
* **Tools:**
550567
* `health_pulse`: Test the health of a Looker instance.
551568
* `health_analyze`: Analyze the LookML usage of a Looker instance.
552569
* `health_vacuum`: Suggest LookML elements that can be removed.

internal/prebuiltconfigs/prebuiltconfigs_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var expectedToolSources = []string{
4242
"elasticsearch",
4343
"firestore",
4444
"looker-conversational-analytics",
45+
"looker-dev",
4546
"looker",
4647
"mindsdb",
4748
"mssql",

0 commit comments

Comments
 (0)