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

chore: script to create a new module #8517

Merged
merged 15 commits into from
Oct 6, 2022

Conversation

suztomo
Copy link
Member

@suztomo suztomo commented Oct 4, 2022

Cont of #8257. generation/new_client/README.md is the usage document.

#8519 is an example output of this script. The pull request to create a new module.

suztomo@suztomo:~/google-cloud-java/generation/new_client$ python3.9 new-client.py generate --api_shortname=apikeys --proto-path=google/api/apikeys --name-pretty="API Keys API" --product-docs="https://cloud.google.com/api-keys/" --api-description="API Keys lets you create and manage your API keys for your projects." --release-level=preview --transport=grpc --language=java --monorepo-url="https://github.com/googleapis/google-cloud-java"

@suztomo suztomo requested a review from meltsufin October 5, 2022 17:33
.gitignore Outdated

# Environments
.env
Copy link
Member

Choose a reason for hiding this comment

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

Why all these changes in .gitignore.

Copy link
Member Author

@suztomo suztomo Oct 5, 2022

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Maybe group all of the Python-related ignores in a separate section? Or, restrict it to a specific subdirectory like generation/?

Copy link
Member Author

Choose a reason for hiding this comment

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

Grouped the Python-related entries.

@@ -0,0 +1,24 @@
# Copyright 2021 Google LLC
Copy link
Member

Choose a reason for hiding this comment

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

Can we put these template files under generation/new_client?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to place template files in a separate directory than scripts files.

Copy link
Member

Choose a reason for hiding this comment

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

Can you make a subdirectory within generation/?

Copy link
Member Author

Choose a reason for hiding this comment

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

(The better question is) What do you feel is the problem with the current location?

Copy link
Member

Choose a reason for hiding this comment

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

It's used only by scripts in /generation. So, I think it makes sense to be organized that way. For someone navigating the code, it will cause less head scratching. They can still be in a separate directory: generation/templates.

Copy link
Member Author

Choose a reason for hiding this comment

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

For those who navigate code, the current structure is unnecessarily deep. That makes sense. Let me change it less nested.

Copy link
Member Author

@suztomo suztomo Oct 5, 2022

Choose a reason for hiding this comment

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

Moved template files from generation/new_client/templates/new-client to generation/new_client/templates. I keep the templates directory within new_client because it's clear that the template files are for new client library generation.

Copy link
Member

Choose a reason for hiding this comment

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

I think I actually misread the original directory structure. Did you have it in generation/templates already? I thought it was in templates parallel to generation. In that case, sorry for the confusion.

@@ -29,6 +37,22 @@ docs/
api_key

# Python utilities
*.pyc
Copy link
Member Author

Choose a reason for hiding this comment

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

pyc is covered by *.py[cod]


monorepo/
Copy link
Member Author

Choose a reason for hiding this comment

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

This moved to the end.

@@ -0,0 +1,24 @@
# Copyright 2021 Google LLC
Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to place template files in a separate directory than scripts files.

@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 5, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 5, 2022
@suztomo suztomo added the automerge Merge the pull request once unit tests and other checks pass. label Oct 5, 2022
@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 5, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 5, 2022
@suztomo suztomo merged commit 8dfdeb0 into googleapis:main Oct 6, 2022
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 6, 2022
@suztomo suztomo deleted the new_client_script2 branch October 6, 2022 00:35
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