Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(internal): auto-generate snippets #3949

Merged
merged 2 commits into from Apr 16, 2021
Merged

feat(internal): auto-generate snippets #3949

merged 2 commits into from Apr 16, 2021

Conversation

tbpg
Copy link
Contributor

@tbpg tbpg commented Apr 15, 2021

I created a new package to make it easier to run than calling the binary. I included a binary for local development.

I needed to install build-base in the Docker image to get gcc, which was needed to Load all packages.

I modified gapics.go to replace genproto in every go.mod because the changes need to be visible everywhere to Load every module.

I ran the generator locally and it seems to work. I only included one directory in this PR because there are a lot of files. I can upload the rest in this PR after initial review.

Updates #3916.

I created a new package to make it easier to run than calling the binary. I included a binary for local development.

I needed to install `build-base` in the Docker image to get `gcc`, which was needed to `Load` all packages.

I modified `gapics.go` to replace `genproto` in every `go.mod` because the changes need to be visible everywhere to `Load` every module.
@tbpg tbpg requested review from codyoss and noahdietz April 15, 2021 18:22
@tbpg tbpg requested a review from a team as a code owner April 15, 2021 18:22
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 15, 2021
@snippet-bot
Copy link

snippet-bot bot commented Apr 15, 2021

Here is the summary of possible violations 😱

There is a possible violation for not having product prefix.

The end of the violation section. All the stuff below is FYI purposes only.


Here is the summary of changes.

You are about to add 1 region tag.
You are about to delete 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

Just a couple of small things or else looks good. Thanks for some of the cleanup you did as well!

internal/gapicgen/generator/gapics.go Show resolved Hide resolved
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
func (g *GapicGenerator) addModReplaceGenproto() error {
log.Println("adding temporary genproto replace statement")
func (g *GapicGenerator) addModReplaceGenproto(dir string) error {
log.Printf("[%s] adding temporary genproto replace statement\n", dir)
Copy link
Member

Choose a reason for hiding this comment

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

nit: same as above about newline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
Copy link
Contributor

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

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

LGTM ill let Cody approve

Copy link
Contributor Author

@tbpg tbpg left a comment

Choose a reason for hiding this comment

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

Thanks!

internal/gapicgen/generator/gapics.go Show resolved Hide resolved
internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
func (g *GapicGenerator) addModReplaceGenproto() error {
log.Println("adding temporary genproto replace statement")
func (g *GapicGenerator) addModReplaceGenproto(dir string) error {
log.Printf("[%s] adding temporary genproto replace statement\n", dir)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
@tbpg tbpg changed the title feat(internal): generate snippets feat(internal): auto-generate snippets Apr 16, 2021
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

LGTM

@codyoss codyoss merged commit b70e0fc into master Apr 16, 2021
@codyoss codyoss deleted the gen branch April 16, 2021 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants