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

feat(sdk): Use v2 Command Client #845

Merged
merged 1 commit into from
May 19, 2021

Conversation

AlexCuse
Copy link
Contributor

Register v2 client in dic and change interface used throughout.

Signed-off-by: Alex Ullrich [email protected]

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

v1 client is still exposed to custom services by the SDK, does not work with commands routed to v2 device services.

Issue Number: #844

What is the new behavior?

v2 client is registered with dic and interface used in references throughout.

Does this PR introduce a breaking change?

Yes this will break any usages of the client retrieved through context.CommandClient() by returning a new interface.

  • Yes
  • No

Are there any new imports or modules? If so, what are they used for and why?

Are there any specific instructions or things that should be known prior to reviewing?

I updated the mocks by hand since I didn't want to worry about mockery version or usage differences messing something up.

Other information

@AlexCuse AlexCuse requested a review from lenny-goodell May 19, 2021 13:48
@codecov-commenter
Copy link

Codecov Report

Merging #845 (22ed9b3) into master (d014dc0) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #845      +/-   ##
==========================================
- Coverage   62.79%   62.77%   -0.02%     
==========================================
  Files          31       31              
  Lines        1981     1980       -1     
==========================================
- Hits         1244     1243       -1     
  Misses        647      647              
  Partials       90       90              
Impacted Files Coverage Δ
internal/app/service.go 40.08% <ø> (ø)
internal/appfunction/context.go 90.47% <ø> (ø)
internal/bootstrap/handlers/clients.go 100.00% <100.00%> (ø)

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 d014dc0...22ed9b3. Read the comment docs.

@@ -63,10 +63,10 @@ func NotificationsClientFrom(get di.Get) notifications.NotificationsClient {
var CommandClientName = di.TypeInstanceToName((*command.CommandClient)(nil))
Copy link
Member

Choose a reason for hiding this comment

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

change command.CommandClient to interfaces.CommandClient

Register v2 client in dic and change interface used throughout.

Signed-off-by: Alex Ullrich <[email protected]>
@AlexCuse AlexCuse force-pushed the v2-command-client branch from 22ed9b3 to 89e9755 Compare May 19, 2021 19:46
Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

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

LGTM

@lenny-goodell lenny-goodell merged commit 65135f1 into edgexfoundry:master May 19, 2021
@lenny-goodell lenny-goodell linked an issue May 27, 2021 that may be closed by this pull request
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.

v2: use new command client
3 participants