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
Collaborator

@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 Apr 15, 2021
@tbpg tbpg requested a review from as a code owner Apr 15, 2021
@google-cla google-cla bot added the cla: yes label Apr 15, 2021
@snippet-bot
Copy link

@snippet-bot 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

Loading

Copy link
Member

@codyoss codyoss left a comment

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

Loading

internal/gapicgen/generator/gapics.go Show resolved Hide resolved
Loading
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
Loading
internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
Loading
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
Loading
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

@codyoss codyoss Apr 15, 2021

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.

Loading

Copy link
Collaborator Author

@tbpg tbpg Apr 16, 2021

Choose a reason for hiding this comment

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

Done.

Loading

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

@noahdietz noahdietz left a comment

LGTM ill let Cody approve

Loading

Copy link
Collaborator Author

@tbpg tbpg left a comment

Thanks!

Loading

internal/gapicgen/generator/gapics.go Show resolved Hide resolved
Loading
internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
Loading
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
Loading
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
Collaborator Author

@tbpg tbpg Apr 16, 2021

Choose a reason for hiding this comment

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

Done.

Loading

internal/gapicgen/generator/gapics.go Outdated Show resolved Hide resolved
Loading
internal/gapicgen/generator/gapics.go Show resolved Hide resolved
Loading
@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

LGTM

Loading

@codyoss codyoss merged commit b70e0fc into master Apr 16, 2021
4 checks passed
Loading
@codyoss codyoss deleted the gen branch Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants