-
Notifications
You must be signed in to change notification settings - Fork 378
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
ci: clear previously generated files #14524
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14524 +/- ##
==========================================
- Coverage 93.58% 93.58% -0.01%
==========================================
Files 2316 2316
Lines 206957 206957
==========================================
- Hits 193677 193671 -6
- Misses 13280 13286 +6 ☔ View full report in Codecov by Sentry. |
Do you think this is a fix for #12587 ? |
Yes, it is. I remember us discussing it, but I couldn't find the issue when I searched for it. Thanks. |
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @dbolduc)
ci/cloudbuild/builds/generate-libraries.sh
line 29 at r2 (raw file):
if [ -z "${GENERATE_GOLDEN_ONLY}" ]; then io::log_h2 "Removing all other previously generated files" git grep -l "Generated by the Codegen C++ plugin" google | xargs rm
This probably needs to also delete any generated files under the protos/ dir as well.
f3f5b93
to
06f65cf
Compare
Thanks, I did not think about this. (You know more about this, but) I think the discovery to proto process depends on the existing protos to make sure we do not break backwards compatibility. If I remove the protos before regenerating them, some of the field indices change. So I restored the code that removes obsolete compute 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.
That is correct. We do need the previous generation to compare message field id numbers.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @dbolduc)
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.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @dbolduc)
ci/cloudbuild/builds/generate-libraries.sh
line 54 at r3 (raw file):
rm "${newer_tmp_file}" io::log_h2 "Formatting and adding any new google/cloud/compute/v1/internal/common_*.proto"
IIRC, we need to format the new protos before we generate code from them because that could change line numbers in the proto files that we put in documentation links.
We already format the protos a few lines down, before running the generator on google-cloud-cpp/ci/cloudbuild/builds/generate-libraries.sh Lines 68 to 69 in 06f65cf
|
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.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @dbolduc)
Fixes #12587
Make the
generate-libraries
build a bit more hermetic by removing previously generated files. This is how I found #14519@scotthart - my read is that the
compute
stuff is the old way of doing things andUPDATED_DISCOVERY_DOCUMENT=compute
is the new way. You would know better.This change is