Skip to content

feat(generator): support parameters named "options"#8283

Merged
coryan merged 5 commits into
googleapis:mainfrom
coryan:fix-generator-unique-names-for-Options-parameter
Feb 7, 2022
Merged

feat(generator): support parameters named "options"#8283
coryan merged 5 commits into
googleapis:mainfrom
coryan:fix-generator-unique-names-for-Options-parameter

Conversation

@coryan
Copy link
Copy Markdown
Contributor

@coryan coryan commented Feb 7, 2022

The googleapis RPCs can define "method signatures" which decompose a
proto request object into its key parameters. The generator maps these
to overloads, and adds the Options options parameter. This does not
work when one of the arguments defined in the method signature is
already called options. This changes the extract Options options
parameter to Options opts, which, as of this writing, does not have
any conflicts in the googleapis protos.

Part of the work for #8175


This change is Reviewable

@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: d4fabf64bcf0ed676e4d5ac0c212cb18fc9063c1

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 7, 2022

Codecov Report

Merging #8283 (963ccf5) into main (1257132) will not change coverage.
The diff coverage is 91.52%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8283   +/-   ##
=======================================
  Coverage   94.94%   94.94%           
=======================================
  Files        1337     1337           
  Lines      119336   119336           
=======================================
  Hits       113306   113306           
  Misses       6030     6030           
Impacted Files Coverage Δ
...egration_tests/golden/golden_kitchen_sink_client.h 100.00% <ø> (ø)
...tegration_tests/golden/golden_thing_admin_client.h 100.00% <ø> (ø)
generator/internal/client_generator.cc 27.38% <0.00%> (ø)
generator/internal/descriptor_utils_test.cc 97.66% <ø> (ø)
...gration_tests/golden/golden_kitchen_sink_client.cc 88.31% <87.09%> (ø)
...egration_tests/golden/golden_thing_admin_client.cc 98.02% <97.56%> (ø)
generator/internal/descriptor_utils.cc 88.21% <100.00%> (ø)
google/cloud/bigtable/internal/common_client.cc 95.71% <0.00%> (-1.43%) ⬇️
.../cloud/storage/benchmarks/throughput_experiment.cc 74.37% <0.00%> (-0.51%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 97.75% <0.00%> (-0.50%) ⬇️
... and 4 more

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 1257132...963ccf5. Read the comment docs.

@coryan coryan marked this pull request as ready for review February 7, 2022 20:34
@coryan coryan requested a review from a team February 7, 2022 20:34
Comment thread generator/internal/client_generator.cc Outdated
The googleapis RPCs can define "method signatures" which decompose a
proto `request` object into its key parameters. The generator maps these
to overloads, and adds the `Options options` parameter. This does not
work when one of the arguments defined in the method signature is
already called `options`.  This changes the extract `Options options`
parameter to `Options opts`, which, as of this writing, does not have
any conflicts in the googleapis protos.
@coryan coryan force-pushed the fix-generator-unique-names-for-Options-parameter branch from d4fabf6 to 963ccf5 Compare February 7, 2022 21:47
@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: 963ccf5fe453f086f4c64e6f2890b3bc8c7f5d1b

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

@coryan coryan enabled auto-merge (squash) February 7, 2022 23:12
@coryan coryan merged commit 97a1bd5 into googleapis:main Feb 7, 2022
@coryan coryan deleted the fix-generator-unique-names-for-Options-parameter branch February 8, 2022 00:14
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