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

fix(generator): Connection base-class operations should fail #8236

Merged
merged 8 commits into from
Feb 4, 2022

Conversation

devbww
Copy link
Contributor

@devbww devbww commented Feb 4, 2022

While we do not test the behavior of the generated "ServiceConnection"
base classes, all operations should fail with kUnimplemented. That
was not the case for paginated calls, which previously returned an
empty sequence instead.


This change is Reviewable

While we do not test the behavior of the generated "ServiceConnection"
base classes, all operations should fail with `kUnimplemented`. That
was not the case for paginated calls, which previously returned an
empty sequence instead.
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 0b1ffcfc462d95f14828d78c74270c1ce46aff38

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #8236 (2892287) into main (6600f0f) will increase coverage by 0.01%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8236      +/-   ##
==========================================
+ Coverage   94.95%   94.97%   +0.01%     
==========================================
  Files        1327     1327              
  Lines      119194   119169      -25     
==========================================
- Hits       113186   113185       -1     
+ Misses       6008     5984      -24     
Impacted Files Coverage Δ
...ion_tests/golden/golden_kitchen_sink_connection.cc 45.71% <0.00%> (+5.71%) ⬆️
...tion_tests/golden/golden_thing_admin_connection.cc 28.57% <0.00%> (+7.51%) ⬆️
generator/internal/connection_generator.cc 67.08% <ø> (ø)
google/cloud/internal/pagination_range.h 100.00% <100.00%> (ø)
.../cloud/storage/benchmarks/throughput_experiment.cc 74.37% <0.00%> (-0.51%) ⬇️
google/cloud/pubsub/samples/samples.cc 92.02% <0.00%> (-0.08%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 98.00% <0.00%> (+0.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6600f0f...2892287. Read the comment docs.

@devbww devbww marked this pull request as ready for review February 4, 2022 05:41
@devbww devbww requested a review from a team as a code owner February 4, 2022 05:41
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.

Can we return this instead:

return google::cloud::internal::MakeUnimplementedPaginationRange<
    StreamRange<$range_output_type$>>();

template <typename Range>
Range MakeUnimplementedPaginationRange() {
using ValueType = typename Range::value_type::value_type;
return MakeStreamRange<ValueType>(
[]() -> typename StreamReader<ValueType>::result_type {
return Status{StatusCode::kUnimplemented, "needs-override"};
});
}

where maybe we change the message to "not implemented" instead of "needs-override"

While we do not test the behavior of the generated "ServiceConnection"
base classes, all operations should fail with kUnimplemented. That
was not the case for paginated calls, which previously returned an
empty sequence instead.
@devbww
Copy link
Contributor Author

devbww commented Feb 4, 2022

Can we return this instead:

Done. PTAL.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: ef7628a70f936b2f096e288031439cbf93de743d

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: a329b3127fcca3c1c25cdfa8f5befbd2de9b80dd

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 28922870319714ebf293dea6a07813f796c6740b

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@devbww
Copy link
Contributor Author

devbww commented Feb 4, 2022

Note: Unfortunately the change in google/cloud/internal/pagination_range.h from "needs-override" to "not implemented" was incorrectly grouped in the "regeneration" commit ef7628a.

@devbww devbww enabled auto-merge (squash) February 4, 2022 19:53
@devbww devbww merged commit 4074a0e into googleapis:main Feb 4, 2022
@devbww devbww deleted the generator-pagination-range branch February 4, 2022 20:29
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.

3 participants