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: Add optional "parent" field to Device objects. #887

Conversation

eaton-coreymutter
Copy link
Member

Related to issue edgexfoundry/edgex-go#4769 but does not close it, other PRs to come.

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-core-contracts/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • [ x ] I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • [ x ] I am not introducing a new dependency (add notes below if you are)
  • [ x ] I have added unit tests for the new feature or bug fix (if not, why?)
  • [ x ] I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)
    Docs to update are in edgex-go (the OpenAPIs), will update those in another PR for this issue

Testing Instructions

I built core-metadata, core-command, device-virtual with these changes, verified I could set the "parent" field via PATCH or via inclusion in YAML device definition file, the field can be set to empty via PATCH with empty-string value, and the field persists across restarts of core-metadata.

New Dependency Instructions (If applicable)

Also add DeviceClient function to query a tree of devices.

Signed-off-by: Corey Mutter <[email protected]>
@eaton-coreymutter eaton-coreymutter changed the title Feat/4769 add parent device field feat: Add optional "parent" field to Device objects. Apr 4, 2024
Signed-off-by: Corey Mutter <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 64.25%. Comparing base (7c7fc6d) to head (1b5d019).

Files Patch % Lines
clients/http/device.go 83.33% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
+ Coverage   62.32%   64.25%   +1.93%     
==========================================
  Files          93       93              
  Lines        3679     3696      +17     
==========================================
+ Hits         2293     2375      +82     
+ Misses       1164     1100      -64     
+ Partials      222      221       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@AnilChoudhury-Eaton AnilChoudhury-Eaton left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudxxx8 cloudxxx8 merged commit 132cf7a into edgexfoundry:main Apr 11, 2024
3 checks passed
@cloudxxx8
Copy link
Member

@eaton-coreymutter the device client mock should be regenerated, or we will get the unit test failure in other services
edgexfoundry/device-sdk-go#1575 (review)

jackchenjc added a commit to jackchenjc/go-mod-core-contracts that referenced this pull request Apr 23, 2024
These updates were missed in edgexfoundry#887 and edgexfoundry#886.

Signed-off-by: Jack Chen <[email protected]>
@cloudxxx8
Copy link
Member

[2024-04-23T04:16:06.573Z] --- FAIL: TestAddReadingTags (0.00s)
[2024-04-23T04:16:06.573Z] panic: interface conversion: *mocks.DeviceClient is not interfaces.DeviceClient: missing method AllDevicesWithChildren [recovered]
[2024-04-23T04:16:06.573Z] panic: interface conversion: *mocks.DeviceClient is not interfaces.DeviceClient: missing method AllDevicesWithChildren

fixed in #889

@eaton-coreymutter
Copy link
Member Author

@eaton-coreymutter the device client mock should be regenerated, or we will get the unit test failure in other services edgexfoundry/device-sdk-go#1575 (review)

Sorry about that - I regenerated it once but forgot to do it again after changing the signature.

@cloudxxx8
Copy link
Member

no problem

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.

4 participants