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

Centralize URLClient logic to the Request package #205

Merged

Conversation

brandonforster
Copy link
Contributor

Fixes #196.

This is the final PR for #196. This PR moves all calls of URLPrefix to the request package to reduce duplication.

There are two places I would like to call out for special review:

ValueDescriptorsUsage() in metadata/provision_watcher.go and
sendLog() in `logger/logger.go.

These two functions required me creating a new URLClient that returns an empty string to fulfill the contract and preserve functionality. I did my best, but am not tremendously happy with this solution and would like any suggestions on how to improve it.

@codecov-io
Copy link

codecov-io commented Jan 23, 2020

Codecov Report

Merging #205 into master will increase coverage by 3.45%.
The diff coverage is 32.6%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #205      +/-   ##
=========================================
+ Coverage   45.85%   49.3%   +3.45%     
=========================================
  Files          64      64              
  Lines        2133    1937     -196     
=========================================
- Hits          978     955      -23     
+ Misses       1066     910     -156     
+ Partials       89      72      -17
Impacted Files Coverage Δ
clients/logger/logger.go 11.42% <0%> (ø) ⬆️
clients/notifications/client.go 100% <100%> (+25%) ⬆️
clients/metadata/addressable.go 89.47% <100%> (+20.72%) ⬆️
clients/general/client.go 66.66% <100%> (-4.77%) ⬇️
clients/command/client.go 100% <100%> (+33.33%) ⬆️
clients/metadata/command.go 6.66% <16.66%> (+0.14%) ⬆️
clients/coredata/reading.go 19.14% <20%> (+3.01%) ⬆️
clients/metadata/device_service.go 11.76% <20%> (+1.76%) ⬆️
clients/metadata/device_profile.go 11.42% <22.22%> (+0.9%) ⬆️
clients/coredata/event.go 31.25% <25%> (+7.53%) ⬆️
... and 3 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 40d6aaf...f718b51. Read the comment docs.

Copy link
Member

@michaelestrin michaelestrin left a comment

Choose a reason for hiding this comment

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

Rebase off master to facilitate review/merge and re-request review from me.

Alternately, wait for dependent #203 to be accepted and merged to re-request a review from me.

Signed-off-by: Brandon Forster <me@brandonforster.com>
clients/command/client.go Outdated Show resolved Hide resolved
clients/coredata/event.go Show resolved Hide resolved
clients/coredata/value_descriptor.go Outdated Show resolved Hide resolved
clients/logger/logger.go Outdated Show resolved Hide resolved
Signed-off-by: Brandon Forster <me@brandonforster.com>
Copy link
Member

@michaelestrin michaelestrin left a comment

Choose a reason for hiding this comment

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

LGTM.

@michaelestrin michaelestrin merged commit e252808 into edgexfoundry:master Jan 28, 2020
@brandonforster brandonforster deleted the issue_196_centralized branch January 29, 2020 17:34
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.

Refactor client endpoints and fix race condition
3 participants