-
Notifications
You must be signed in to change notification settings - Fork 68
fix: prepare to generate grafeas #2761
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
Changes from 7 commits
dab57a2
d9863f0
98a3359
c6a33bb
608c155
509c792
2d9cc27
3257cc8
aac204b
d473f02
a8cfbdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "api_shortname": "baremetalsolution", | ||
| "name_pretty": "Bare Metal Solution", | ||
| "product_documentation": "https://cloud.google.com/bare-metal/docs", | ||
| "api_description": "Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.", | ||
| "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bare-metal-solution/latest/overview", | ||
| "release_level": "preview", | ||
| "transport": "grpc", | ||
| "language": "java", | ||
| "repo": "googleapis/google-cloud-java", | ||
| "repo_short": "java-bare-metal-solution", | ||
| "distribution_name": "com.google.cloud:google-cloud-bare-metal-solution", | ||
| "library_type": "GAPIC_AUTO", | ||
| "requires_billing": true, | ||
| "rest_documentation": "https://cloud.google.com/bare-metal/docs/reference/rest", | ||
| "rpc_documentation": "https://cloud.google.com/bare-metal/docs/reference/rpc" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |
| from library_generation.utils.proto_path_utils import remove_version_from | ||
|
|
||
| script_dir = os.path.dirname(os.path.realpath(__file__)) | ||
| EMPTY_API_ID = "" | ||
|
|
||
|
|
||
| def create_argument(arg_key: str, arg_container: object) -> List[str]: | ||
|
|
@@ -216,9 +217,12 @@ def generate_prerequisite_files( | |
| if config.is_monorepo() | ||
| else f"googleapis/{language}-{library_name}" | ||
| ) | ||
| api_id = ( | ||
| library.api_id if library.api_id else f"{library.api_shortname}.googleapis.com" | ||
| ) | ||
| if library.api_id == EMPTY_API_ID: | ||
|
||
| api_id = None | ||
| elif not library.api_id: | ||
| api_id = f"{library.api_shortname}.googleapis.com" | ||
| else: | ||
| api_id = library.api_id | ||
| client_documentation = ( | ||
| library.client_documentation | ||
| if library.client_documentation | ||
|
|
@@ -251,6 +255,9 @@ def generate_prerequisite_files( | |
| "requires_billing": library.requires_billing, | ||
| } | ||
|
|
||
| if not repo_metadata["api_id"]: | ||
| repo_metadata.pop("api_id") | ||
|
|
||
| if library.api_reference: | ||
| repo_metadata["api_reference"] = library.api_reference | ||
| if library.codeowner_team: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we just skip generating samples for grafeas as they are currently not included in the repo?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should generate samples so that the logic is same as other libraries.
I refactored the code to remove this special case and included unit tests.