-
Notifications
You must be signed in to change notification settings - Fork 53
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 without post-processing #1935
feat: generate showcase without post-processing #1935
Conversation
This reverts commit 3d612f8.
function cleanup { | ||
script_dir=$1 | ||
cd "${script_dir}" | ||
rm -rdf gapic-generator-java* google schema protobuf-* protoc-gen-grpc-java* showcase-output out |
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 keep all of these folders in a temporary directory because when the script fails midway and cleanup is skipped, it's petty messy? It would be easier if there was a subdirectory under showcase
like build
that contained all of this.
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.
+1. Similar to the temp bazel folders like bazel-out
when we were using bazel.
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.
@meltsufin would it make sense to have a separate PR for this? This will also affect the main generation scripts (cc: @blakeli0 )
…e-without-postprocessing
PROTO_UNPACK_DIR=$PWD | ||
# compare with proto library | ||
PROTO_PROJECT_DIR='proto-gapic-showcase-v1beta1' | ||
diff -ru "${SHOWCASE_DIR}/${PROTO_PROJECT_DIR}/src" "${SCRIPT_DIR}/showcase-output/proto-showcase-output/src" |
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.
Now that we are generating all three modules at the same time, is it possible to have a diff for all three modules?
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.
Unless there is a better way than preparing two special folders with a similar structure and run diff
on their roots I think the simplest is to just run diff
one time for each of the folders (proto
, gapic
and grpc
) in a single call to verify.sh
. We don't compare all the contents of gapic-showcase
or grpc-gapic-showcase-v1beta1
because there are other special files not generated by the scripts (e.g. ITs).
function cleanup { | ||
script_dir=$1 | ||
cd "${script_dir}" | ||
rm -rdf gapic-generator-java* google schema protobuf-* protoc-gen-grpc-java* showcase-output out |
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.
+1. Similar to the temp bazel folders like bazel-out
when we were using bazel.
Co-authored-by: Joe Wang <[email protected]>
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.
You follow up on the outstanding comments in a separate PR.
…ostprocessing' into feat/generate-showcase-without-postprocessing
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.
LGTM. It would be better if we can add unit tests for new utility functions as @JoeWang1127 mentioned if it's not too much, otherwise it's OK to add it in another PR.
Thanks @blakeli0 and @JoeWang1127 . I added a couple tests for info extraction functions. |
[java_showcase_integration_tests] Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
[java_showcase_unit_tests] Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
[gapic-generator-java-root] Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Modifies the logic of #1916 to support generation of
showcase
NOTES
proto_path
(i.e. path from repository root to proto location).proto/bazel-out/.../schema/...
.enable-golden-tests
profile was updated so it compares the current source code of showcase against a recently generated library via the hermetic build scripts.verify
profile calls the new scripts without merging them into the current showcase source and running adiff
to confirm nothing has changedPENDING