-
Notifications
You must be signed in to change notification settings - Fork 55
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?
Changes from 45 commits
f61c630
99c711f
7c0ed51
0328d96
c1d1696
bb28ae6
85201ee
cad57f6
bfc9bba
b4aa910
779d011
d29ce8c
334384a
66e7366
f0a7d53
072ee70
0214666
2f47daa
3063dab
e1c270a
1514dd7
6476131
4880451
c29ce8c
55141af
2711c7d
0a0726c
2d6802f
5bf0a5b
8afe6a4
3a839bf
702644b
8728b79
37d1a95
c8bc219
812f3d9
2d879f2
d1f2d20
52d65f6
5f07086
4246310
e55ab79
1e33cde
4cdb78a
9868bc7
5647988
405108d
a6447c3
e122029
493b5a4
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
set -ex | ||
# This script should be run at the root of the repository. | ||
# This script is used to, when a pull request changes the generation | ||
# configuration (generation_config.yaml by default) or Dockerfile: | ||
|
@@ -89,6 +89,10 @@ pushd "${api_def_dir}" | |
git checkout "${googleapis_commitish}" | ||
popd | ||
|
||
# we also setup showcase | ||
source java-showcase/scripts/showcase_utilities.sh | ||
append_showcase_to_api_defs "${api_def_dir}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this function be called from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's called both from the automatic generation script (this one) and the manual update + golden test scripts ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My concern is that this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, since the workflow also ends up using the common-usage There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think only action.yaml is reused. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
|
||
# get changed library list. | ||
changed_libraries=$(python hermetic_build/common/cli/get_changed_libraries.py create \ | ||
--baseline-generation-config-path="${baseline_generation_config}" \ | ||
|
@@ -98,7 +102,6 @@ echo "Changed libraries are: ${changed_libraries:-"No changed library"}." | |
# run hermetic code generation docker image. | ||
docker run \ | ||
--rm \ | ||
--quiet \ | ||
-u "$(id -u):$(id -g)" \ | ||
-v "$(pwd):${workspace_name}" \ | ||
-v "${api_def_dir}:${workspace_name}/googleapis" \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
java_gapic_library( | ||
deps = [ | ||
"//google/cloud/location:location_java_proto", | ||
"//google/iam/v1:iam_java_proto" | ||
], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
proto_library_with_info( | ||
# this comment should not indicate an end of a pattern match ) | ||
deps = [ | ||
"//google/cloud/location:location_proto", | ||
] | ||
) | ||
|
||
java_gapic_library( | ||
# this comment should not indicate an end of a pattern match ) | ||
deps = [ | ||
"//google/iam/v1:iam_java_proto" | ||
], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
deep-remove-regex: | ||
- "/showcase/grpc-gapic-showcase-v1beta1/src" | ||
- "/showcase/proto-gapic-showcase-v1beta1/src" | ||
- "/showcase/gapic-showcase/src" | ||
- "/showcase/samples/snippets/generated" | ||
|
||
deep-preserve-regex: | ||
- "/showcase/gapic-showcase/src/test" | ||
|
||
deep-copy-regex: | ||
- source: "/schema/google/showcase/(v.*)/.*-java/proto-.*/src" | ||
dest: "/owl-bot-staging/showcase/$1/proto-gapic-showcase-$1/src" | ||
- source: "/schema/google/showcase/(v.*)/.*-java/grpc-.*/src" | ||
dest: "/owl-bot-staging/showcase/$1/grpc-gapic-showcase-$1/src" | ||
- source: "/schema/google/showcase/(v.*)/.*-java/gapic-.*/src" | ||
dest: "/owl-bot-staging/showcase/$1/gapic-showcase/src" | ||
- source: "/schema/google/showcase/(v.*)/.*-java/samples/snippets/generated" | ||
dest: "/owl-bot-staging/showcase/$1/samples/snippets/generated" | ||
|
||
api-name: showcase |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"api_shortname": "showcase", | ||
"name_pretty": "Showcase", | ||
"product_documentation": "https://cloud.google.com/dummy", | ||
"api_description": "Showcase module", | ||
"client_documentation": "https://cloud.google.com/java/docs/reference/gapic-showcase/latest/overview", | ||
"release_level": "preview", | ||
"transport": "both", | ||
"language": "java", | ||
"repo": "googleapis/sdk-platform-java", | ||
"repo_short": "java-showcase", | ||
"distribution_name": "com.google.cloud:gapic-showcase", | ||
"library_type": "OTHER", | ||
"requires_billing": true, | ||
"excluded_poms": "gapic-showcase-bom" | ||
} |
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 moved the generator jar copy later in the final stage so the previous steps can run in parallel with
mvn install
. It saves dozens of seconds.