Skip to content

feat(sidekick/rust): add bigquery code gen#6322

Merged
alvarowolfx merged 8 commits into
googleapis:mainfrom
alvarowolfx:feat-bq-query-builder
Jun 10, 2026
Merged

feat(sidekick/rust): add bigquery code gen#6322
alvarowolfx merged 8 commits into
googleapis:mainfrom
alvarowolfx:feat-bq-query-builder

Conversation

@alvarowolfx

Copy link
Copy Markdown
Contributor

@alvarowolfx alvarowolfx requested a review from dbolduc June 5, 2026 15:54

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 support for generating a Rust BigQuery query builder, including new generation logic, field mapping, and a Mustache template. Feedback highlights a style guide violation regarding excessive blank lines, an incorrect template name in an error message, and a potential runtime panic due to an unsafe type assertion.

Comment thread internal/librarian/rust/generate.go
Comment thread internal/librarian/rust/generate.go
Comment thread internal/sidekick/rust/bigquery.go Outdated

@dbolduc dbolduc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Look into using a simplified model instead of generating synthetic fields and I think most of the complexity is going to go away.

And you need tests for complicated algorithms.

Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/sidekick/rust/bigquery.go
Comment thread internal/sidekick/rust/templates/common/message.mustache
Comment thread internal/sidekick/rust/templates/common/setters.mustache

@dbolduc dbolduc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks pretty good! I left suggestions to maybe generalize the template for all field types, but I am only like 60% sure it will work

Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated

@alvarowolfx alvarowolfx left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks for the tips to improve the code, I addressed the comments with the latest commit. Now I need to add unit tests.

Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
alvarowolfx added a commit that referenced this pull request Jun 10, 2026
Allow setters template to be reused outside full message template.

Split from #6322
@alvarowolfx alvarowolfx marked this pull request as ready for review June 10, 2026 14:50
@alvarowolfx alvarowolfx requested review from a team as code owners June 10, 2026 14:50
@alvarowolfx

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 support for generating Rust BigQuery query builders by adding a new generation template, synthetic message builders, and corresponding unit tests. The code review identified critical issues regarding the generation of invalid Rust code due to using raw proto field names instead of Rust-formatted names in the templates. Additionally, the reviewer pointed out a bug in the module generation loop that prematurely terminates processing, redundant lookups, and a minor receiver consistency issue.

Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/librarian/rust/generate.go
Comment thread internal/librarian/rust/generate.go
Comment thread internal/sidekick/rust/bigquery.go Outdated
Comment thread internal/librarian/rust/generate.go
Comment thread internal/sidekick/rust/templates/bigquery/run_query_builder.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/sidekick/rust/templates/bigquery/run_query_request.rs.mustache Outdated
Comment thread internal/librarian/rust/generate.go
Comment thread internal/sidekick/rust/bigquery_test.go Outdated
Comment thread internal/sidekick/rust/bigquery_test.go Outdated
@alvarowolfx alvarowolfx merged commit a7846f5 into googleapis:main Jun 10, 2026
29 of 30 checks passed
jskeet pushed a commit that referenced this pull request Jun 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.20.0](v0.19.0...v0.20.0)
(2026-06-10)


### Features

* **nodejs:** add a DefaultVersion field to NodeJSPackage
([#6358](#6358))
([af3218f](af3218f))
* **sidekick/rust:** add bigquery code gen
([#6322](#6322))
([a7846f5](a7846f5))
* **sidekick/swift:** non-string maps
([#6361](#6361))
([2b6d7e4](2b6d7e4))
* **sidekick/swift:** support discovery-based modules
([#6351](#6351))
([09ef5cf](09ef5cf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.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.

2 participants