googleapis / gax-ruby

Google API Extensions for Ruby
https://rubygems.org/gems/google-gax
BSD 3-Clause "New" or "Revised" License
20 stars 22 forks source link

Add DerivedConfiguration #195

Closed blowmage closed 5 years ago

blowmage commented 5 years ago

This new class shares the structure with a super configuration object, but it can only change values. It cannot alter the structure.

The intention is that this will be used to customize a global config. For example, to override settings for an individual client.

codecov[bot] commented 5 years ago

Codecov Report

Merging #195 into master will decrease coverage by 0.26%. The diff coverage is 93.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
- Coverage   97.97%   97.71%   -0.27%     
==========================================
  Files          34       38       +4     
  Lines        1929     2143     +214     
==========================================
+ Hits         1890     2094     +204     
- Misses         39       49      +10
Impacted Files Coverage Δ
lib/google/gax/configuration/deferred_value.rb 100% <100%> (ø)
test/google/gax/configuration_test.rb 100% <100%> (ø) :arrow_up:
lib/google/gax/configuration.rb 85.57% <87.8%> (-1.78%) :arrow_down:
.../google/gax/configuration/derived_configuration.rb 90.69% <90.69%> (ø)
lib/google/gax/configuration/schema.rb 94.33% <94.33%> (ø)
test/google/gax/configuration/derive_test.rb 94.91% <94.91%> (ø)

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 44a94c3...af0ceb4. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #195 into master will decrease coverage by 0.3%. The diff coverage is 92.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
- Coverage   97.97%   97.67%   -0.31%     
==========================================
  Files          34       38       +4     
  Lines        1929     2104     +175     
==========================================
+ Hits         1890     2055     +165     
- Misses         39       49      +10
Impacted Files Coverage Δ
lib/google/gax/configuration/deferred_value.rb 100% <100%> (ø)
test/google/gax/configuration_test.rb 100% <100%> (ø) :arrow_up:
lib/google/gax/configuration.rb 85.57% <80.95%> (-1.78%) :arrow_down:
lib/google/gax/configuration/schema.rb 94.23% <94.23%> (ø)
test/google/gax/configuration/derive_test.rb 94.91% <94.91%> (ø)
lib/google/gax/errors.rb 95.34% <0%> (-0.11%) :arrow_down:
test/google/gax/api_call/retry/retry_test.rb 98.33% <0%> (-0.03%) :arrow_down:
test/google/gax/paged_enumerable/enum_test.rb 100% <0%> (ø) :arrow_up:
test/google/gax/gax_error/status_details_test.rb 100% <0%> (ø) :arrow_up:
...ax/paged_enumerable/valid_request_response_test.rb 100% <0%> (ø) :arrow_up:
... and 9 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 44a94c3...f4e9a6b. Read the comment docs.

blowmage commented 5 years ago

Isn't it an implementation detail, though? Unless we expect that users will generally use DeferredValue.new instead of Configuration.deferred (in which case maybe we should drop the latter)

Both were marked private. If Configuration.deferred is marked visible then we also have to document it's return type, which is DeferredValue. I'd be fine marking DeferredValue.new as private, but previous to this both Configuration.deferred and DeferredValue were marked private.

dazuma commented 5 years ago

Isn't it an implementation detail, though? Unless we expect that users will generally use DeferredValue.new instead of Configuration.deferred (in which case maybe we should drop the latter)

Both were marked private. If Configuration.deferred is marked visible then we also have to document it's return type, which is DeferredValue. I'd be fine marking DeferredValue.new as private, but previous to this both Configuration.deferred and DeferredValue were marked private.

Then I'm inclined to prefer keeping DeferredValue.new, and dropping Configuration.deferred. The latter is not as clear, and I'm not sure what benefit it gives us.

codecov-io commented 5 years ago

Codecov Report

Merging #195 into master will decrease coverage by 0.26%. The diff coverage is 92.54%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #195      +/-   ##
=========================================
- Coverage   97.97%   97.7%   -0.27%     
=========================================
  Files          34      38       +4     
  Lines        1927    2139     +212     
=========================================
+ Hits         1888    2090     +202     
- Misses         39      49      +10
Impacted Files Coverage Δ
lib/google/gax/configuration/deferred_value.rb 100% <100%> (ø)
test/google/gax/configuration_test.rb 100% <100%> (ø) :arrow_up:
lib/google/gax/configuration.rb 85.57% <80.95%> (-1.78%) :arrow_down:
lib/google/gax/configuration/derived.rb 90.69% <90.69%> (ø)
lib/google/gax/configuration/schema.rb 94.23% <94.23%> (ø)
test/google/gax/configuration/derive_test.rb 94.91% <94.91%> (ø)

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 7eaf522...3a570b1. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

Merging #195 into master will decrease coverage by 0.3%. The diff coverage is 92.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
- Coverage   97.97%   97.67%   -0.31%     
==========================================
  Files          34       38       +4     
  Lines        1929     2104     +175     
==========================================
+ Hits         1890     2055     +165     
- Misses         39       49      +10
Impacted Files Coverage Δ
lib/google/gax/configuration/deferred_value.rb 100% <100%> (ø)
test/google/gax/configuration_test.rb 100% <100%> (ø) :arrow_up:
lib/google/gax/configuration.rb 85.57% <80.95%> (-1.78%) :arrow_down:
lib/google/gax/configuration/schema.rb 94.23% <94.23%> (ø)
test/google/gax/configuration/derive_test.rb 94.91% <94.91%> (ø)
lib/google/gax/errors.rb 95.34% <0%> (-0.11%) :arrow_down:
test/google/gax/api_call/retry/retry_test.rb 98.33% <0%> (-0.03%) :arrow_down:
test/google/gax/paged_enumerable/enum_test.rb 100% <0%> (ø) :arrow_up:
test/google/gax/gax_error/status_details_test.rb 100% <0%> (ø) :arrow_up:
...ax/paged_enumerable/valid_request_response_test.rb 100% <0%> (ø) :arrow_up:
... and 9 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 44a94c3...b713e92. Read the comment docs.