Skip to content
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

impl(generator): handle deprecated services #14849

Merged

Conversation

scotthart
Copy link
Member

@scotthart scotthart commented Nov 19, 2024

v29 of protobuf adds [[deprecated]] attributes to proto message types generated from deprecated services. We need to disable compiler warnings on these types because of -Werror until we remove the deprecated services.


This change is Reviewable

@scotthart scotthart force-pushed the generator_detect_deprecated_service branch from ec3bc37 to d844d6b Compare November 20, 2024 01:16
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 51.88172% with 179 lines in your changes missing coverage. Please review.

Project coverage is 93.00%. Comparing base (000bb23) to head (cb3c9f3).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...s/golden/v1/internal/deprecated_connection_impl.cc 28.57% 15 Missing ⚠️
...den/v1/internal/deprecated_rest_connection_impl.cc 0.00% 15 Missing ⚠️
.../v1/internal/deprecated_rest_metadata_decorator.cc 0.00% 14 Missing ⚠️
...n_tests/golden/v1/internal/deprecated_rest_stub.cc 0.00% 14 Missing ⚠️
...golden/v1/internal/deprecated_rest_stub_factory.cc 0.00% 13 Missing ⚠️
...ests/golden/v1/internal/deprecated_tracing_stub.cc 0.00% 12 Missing ⚠️
...olden/v1/internal/deprecated_metadata_decorator.cc 42.10% 11 Missing ⚠️
...ntegration_tests/golden/v1/deprecated_connection.h 58.33% 10 Missing ⚠️
...tion_tests/golden/v1/deprecated_rest_connection.cc 0.00% 10 Missing ⚠️
...olden/v1/internal/deprecated_tracing_connection.cc 25.00% 9 Missing ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14849      +/-   ##
==========================================
- Coverage   93.07%   93.00%   -0.08%     
==========================================
  Files        2319     2351      +32     
  Lines      209109   209479     +370     
==========================================
+ Hits       194630   194824     +194     
- Misses      14479    14655     +176     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long run, I think we want to deprecate these clients. As in GOOGLE_CLOUD_CPP_DEPRECATED(...).

@@ -237,13 +237,19 @@ class ServiceCodeGenerator : public GeneratorInterface {

std::vector<MixinMethod> const& MixinMethods() const;

/**
* If the service is defined with `option deprecated = true;`.
* @return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove this line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member Author

@scotthart scotthart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I went ahead an added it to the generated Client.

Reviewable status: 0 of 113 files reviewed, all discussions resolved (waiting on @dbolduc)

@@ -237,13 +237,19 @@ class ServiceCodeGenerator : public GeneratorInterface {

std::vector<MixinMethod> const& MixinMethods() const;

/**
* If the service is defined with `option deprecated = true;`.
* @return
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@scotthart scotthart merged commit 45f2699 into googleapis:main Nov 20, 2024
65 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants