feat(bigquery): validate integration + add dataset/table lifecycle tools#5480
Conversation
…et/table lifecycle + query-result tools - Cross-checked existing query/list_datasets/list_tables/get_table/insert_rows tools against BigQuery REST v2 docs; no critical issues found - Added 6 new tools covered by the existing bigquery OAuth scope: create/delete dataset, create/delete table, list table data, get query results - Wired new operations into the block (subblocks, conditions, tools.config), registry, and barrel exports
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The block gains new operation dropdown entries, operation-grouped subblocks (including Reviewed by Cursor Bugbot for commit 6ca7101. Configure here. |
Greptile SummaryThis PR adds 6 new BigQuery tools (create/delete dataset, create/delete table, list table data, get query results) and wires them into the block, tool registry, and barrel exports. It also deduplicates the block's condition arrays into shared constants (
Confidence Score: 5/5Safe to merge — all six new tools are correctly wired end-to-end and all previously identified trimming bugs have been addressed. All URL-path identifiers are trimmed before encoding. The block's params() function correctly maps newDatasetId→datasetId and newTableId→tableId without leaking stale selector values. Shared constants cleanly replace duplicated condition arrays. The schema validation in create_table handles malformed JSON with a clear error. No logic gaps or data-loss paths were found across the full chain from block → params → tool → API. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Block["GoogleBigQueryBlock\n(operation dropdown)"] --> Switch{"params.operation"}
Switch -->|query| QT["google_bigquery_query\nPOST /jobs (runQuery)"]
Switch -->|get_query_results| GQR["google_bigquery_get_query_results\nGET /queries/{jobId}"]
Switch -->|list_datasets| LD["google_bigquery_list_datasets\nGET /datasets"]
Switch -->|create_dataset| CD["google_bigquery_create_dataset\nPOST /datasets\ndatasetId.trim() in body"]
Switch -->|delete_dataset| DD["google_bigquery_delete_dataset\nDELETE /datasets/{id.trim()}\n?deleteContents="]
Switch -->|list_tables| LT["google_bigquery_list_tables\nGET /datasets/{id}/tables"]
Switch -->|get_table| GT["google_bigquery_get_table\nGET /datasets/{id}/tables/{id}"]
Switch -->|create_table| CT["google_bigquery_create_table\nPOST /datasets/{id.trim()}/tables\nSchema JSON validated + parsed"]
Switch -->|delete_table| DT["google_bigquery_delete_table\nDELETE /datasets/{id}/tables/{id.trim()}"]
Switch -->|list_table_data| LTD["google_bigquery_list_table_data\nGET /datasets/{id}/tables/{id}/data\nRows: positional arrays"]
Switch -->|insert_rows| IR["google_bigquery_insert_rows\nPOST /datasets/{id}/tables/{id}/insertAll"]
Params["params() mapping\nnewDatasetId → datasetId\nnewTableId → tableId\ndatasetLocation → location"] --> Switch
Constants["Shared constants\nEXISTING_DATASET_OPS\nEXISTING_TABLE_OPS\nLOCATION_OPS"] --> Params
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
Block["GoogleBigQueryBlock\n(operation dropdown)"] --> Switch{"params.operation"}
Switch -->|query| QT["google_bigquery_query\nPOST /jobs (runQuery)"]
Switch -->|get_query_results| GQR["google_bigquery_get_query_results\nGET /queries/{jobId}"]
Switch -->|list_datasets| LD["google_bigquery_list_datasets\nGET /datasets"]
Switch -->|create_dataset| CD["google_bigquery_create_dataset\nPOST /datasets\ndatasetId.trim() in body"]
Switch -->|delete_dataset| DD["google_bigquery_delete_dataset\nDELETE /datasets/{id.trim()}\n?deleteContents="]
Switch -->|list_tables| LT["google_bigquery_list_tables\nGET /datasets/{id}/tables"]
Switch -->|get_table| GT["google_bigquery_get_table\nGET /datasets/{id}/tables/{id}"]
Switch -->|create_table| CT["google_bigquery_create_table\nPOST /datasets/{id.trim()}/tables\nSchema JSON validated + parsed"]
Switch -->|delete_table| DT["google_bigquery_delete_table\nDELETE /datasets/{id}/tables/{id.trim()}"]
Switch -->|list_table_data| LTD["google_bigquery_list_table_data\nGET /datasets/{id}/tables/{id}/data\nRows: positional arrays"]
Switch -->|insert_rows| IR["google_bigquery_insert_rows\nPOST /datasets/{id}/tables/{id}/insertAll"]
Params["params() mapping\nnewDatasetId → datasetId\nnewTableId → tableId\ndatasetLocation → location"] --> Switch
Constants["Shared constants\nEXISTING_DATASET_OPS\nEXISTING_TABLE_OPS\nLOCATION_OPS"] --> Params
Reviews (5): Last reviewed commit: "fix(bigquery): stop leaking stale datase..." | Re-trigger Greptile |
- create_table: guard JSON.parse on the schema field with a clear error, trim tableReference IDs in the request body - create_dataset: trim datasetId in the request body - block: stop leaking a stale query "location" value into create_dataset when datasetLocation is empty; clarify pageToken output description covers list_table_data and get_query_results too
|
bugbot run |
- create_table: validate parsed schema is a non-empty array of field objects with a name, not just syntactically valid JSON - get_query_results: guard timeoutMs with Number.isFinite before appending to the query string, matching maxResults
|
@greptile please re-review; bugbot run |
…dation - Add missing projectId block output (returned by get_table/create_table/create_dataset but was silently dropped from the block's output schema) - Switch query/rows/schema subBlocks from long-input to code, matching the JSON/SQL field convention used by every other DB integration (clickhouse, mongodb, postgresql, supabase)
|
@greptile please re-review; bugbot run — pushed a final alignment pass (added missing projectId block output, switched query/rows/schema subblocks from long-input to code to match repo convention for JSON/SQL fields). |
|
bugbot run |
…et/create_table Same class of bug as the earlier location leak: params() spread hidden datasetId/tableId from ...rest unconditionally, so a stale value from a previously-selected operation could survive into create_dataset/create_table if the dedicated new-ID field was somehow empty. Gate datasetId/tableId (and location) to the operations that actually use them, via shared op-list constants also reused by the corresponding subblock conditions.
|
@greptile please re-review; bugbot run — fixed a stale datasetId/tableId leak into create_dataset/create_table (same class as the earlier location leak), and deduped the operation-list conditions into shared constants. |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6ca7101. Configure here.
Summary
bigqueryOAuth scope (no new scopes requested): create dataset, delete dataset, create table, delete table, list table data, get query resultstools.config), tool registry, and barrel exportsType of Change
Testing
bun run lint:checkcleanbun run type-checkclean (bigquery-related)bun run check:api-validationpassedChecklist