-
Notifications
You must be signed in to change notification settings - Fork 54
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: generate showcase using docker image #3568
base: main
Are you sure you want to change the base?
Conversation
Quality Gate failed for 'gapic-generator-java-root'Failed conditions |
Quality Gate passed for 'java_showcase_integration_tests'Issues Measures |
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.
Thanks Diego! This approach looks good in general, however, have we ever considered treating showcase a dedicate repo instead of a library in sdk-platform-java? Meaning that we create a separate generation_config.yaml in showcase module?
@@ -95,6 +95,14 @@ changed_libraries=$(python hermetic_build/common/cli/get_changed_libraries.py cr | |||
--current-generation-config-path="${generation_config}") | |||
echo "Changed libraries are: ${changed_libraries:-"No changed library"}." | |||
|
|||
# do not generate showcase automatically |
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.
We probably do want to generate showcase automatically? For example, if we update protoc version in the docker image, we do want the showcase module to be updated.
libraries: | ||
- api_shortname: showcase | ||
folder_name: showcase # prevents java-showcase |
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 feel it is probably too much effort to introduce a new argument folder_name
, just to prevent showcase
to be renamed to java-showcase
. I think it is OK to rename it.
- proto_path: google/rpc/context | ||
- proto_path: google/shopping/type | ||
- proto_path: google/type | ||
- proto_path: google/api |
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.
Is this change intended?
# fixed. | ||
rest_numeric_enums = False, | ||
service_yaml = "showcase_v1beta1.yaml", | ||
test_deps = [ |
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.
Can we make this file minimum? For example, I don't think we need any test_deps
since we only parses rest_numeric_enums
, transport
and include_samples
.
@@ -17,3 +17,6 @@ proto-google-iam-v2:1.45.1:1.45.1 | |||
grpc-google-iam-v2:1.45.1:1.45.1 | |||
google-cloud-core:2.49.1:2.49.1 | |||
google-cloud-shared-dependencies:3.41.1:3.41.1 | |||
gapic-showcase:0.0.0:0.0.1-SNAPSHOT |
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.
This is OK as long as release-please does not start bumping versions for showcase. Can you confirm it or maybe @suztomo can confirm?
# download api definitions from googleapis repository | ||
googleapis_commitish=$(grep googleapis_commitish generation_config.yaml | cut -d ":" -f 2 | xargs) | ||
api_def_dir=$(mktemp -d) | ||
git clone https://github.com/googleapis/googleapis.git "${api_def_dir}" |
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.
Maybe I missed it but I don't see these repos being cleaned up after the generation is completed.
# looks at sdk-platform-java/showcase/gapic-showcase/pom.xml to extract the | ||
# version of gapic-showcase | ||
# see https://github.com/googleapis/gapic-showcase/releases | ||
showcase_version=$(get_version_from_pom \ |
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.
Is this used? We should still use it to checkout showcase repo with a release tag.
--transport "${transport}" | ||
echo "generating showcase" | ||
workspace_name="/workspace" | ||
docker run \ |
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.
Since this is using docker now, I don't think we can run them from local Mac or Windows anymore, can you please update the README of the showcase module to indicate it?
} | ||
# This is a special case for showcase, where the additional protos | ||
# are not declared in the gapic library instead | ||
pattern_gapic_library_to_additional_protos = { |
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.
Do you mind elaborating on why we need this special case?
Fixes #2470
Approach
In
hermetic_build/
sdk-platform/showcase
instead ofsdk-platform/java-showcase
)In
showcase/
-Penable-golden-tests
and-Pupdate
to build and use the Hermetic Build Docker imageEffects
samples/
folder added inshowcase
showcase/