googleapis / google-cloud-cpp

C++ Client Libraries for Google Cloud Services
https://cloud.google.com/
Apache License 2.0
554 stars 374 forks source link

impl(generator): push and pop deprecated pragma when needed #14852

Closed scotthart closed 4 days ago

scotthart commented 5 days ago

In a previous PR, the disable_deprecations_warnings.inc was added to services that were deprecated. This PR also adds this include file when the service contains methods that are marked as deprecated. As the disable_deprecations_warnings.inc includes a pragma push, the corresponding pragma pop needed to be added, which this PR adds.

This was tested with both protobuf v28.3 and protobuf v29.0-rc3 and in both cases the [[deprecated]] present in the generated protobuf messages no longer results in a compilation error.


This change is Reviewable

codecov[bot] commented 5 days ago

Codecov Report

Attention: Patch coverage is 63.63636% with 24 lines in your changes missing coverage. Please review.

Project coverage is 92.99%. Comparing base (8e7038e) to head (8e219d8). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
generator/internal/service_code_generator.cc 77.77% 4 Missing :warning:
...nerator/internal/connection_impl_rest_generator.cc 0.00% 2 Missing :warning:
generator/internal/connection_rest_generator.cc 0.00% 2 Missing :warning:
...rator/internal/logging_decorator_rest_generator.cc 0.00% 2 Missing :warning:
...ator/internal/metadata_decorator_rest_generator.cc 0.00% 2 Missing :warning:
...erator/internal/round_robin_decorator_generator.cc 0.00% 2 Missing :warning:
generator/internal/stub_factory_rest_generator.cc 0.00% 2 Missing :warning:
generator/internal/stub_rest_generator.cc 0.00% 2 Missing :warning:
generator/internal/forwarding_client_generator.cc 0.00% 1 Missing :warning:
...erator/internal/forwarding_connection_generator.cc 0.00% 1 Missing :warning:
... and 4 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #14852 +/- ## ========================================== - Coverage 93.00% 92.99% -0.02% ========================================== Files 2351 2351 Lines 209479 209543 +64 ========================================== + Hits 194818 194856 +38 - Misses 14661 14687 +26 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: