-
Notifications
You must be signed in to change notification settings - Fork 55
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 operation mapping for device profile #3015
Conversation
7c3536a
to
5e02a3b
Compare
5e02a3b
to
717e594
Compare
717e594
to
c46a879
Compare
c46a879
to
403d198
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mapping logic looks fine in general. But spotted a few corner cases.
The device profile payload may or may not contain all of software
, firmware
and configuration
values at all times. If firmware
is not included, it won't even be there in the cloud payload. But the current logic expects that key at all times, failing to convert otherwise. software
and configuration
can be empty arrays as well but not absent. But, I'd be defensive and code against their absence as well. Also, it'd also be nice if those entries are excluded from the mapped tedge command payload when those arrays are empty as well, just to reduce noise. But that'd be a secondary improvement.
Also, improve the test coverage for softwareType
conversions as well, by using type suffixes in versions.
crates/extensions/c8y_mapper_ext/src/operations/device_profile.rs
Outdated
Show resolved
Hide resolved
b696494
to
0d00a20
Compare
Robot Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only major missing piece is the status update mapping.
Although the test coverage has improved, a few more cases can be added as highlighted. Also, note that the codecov report isn't favourable either. You'll have to make it happy as well.
crates/extensions/c8y_mapper_ext/src/operations/handlers/mod.rs
Outdated
Show resolved
Hide resolved
crates/extensions/c8y_mapper_ext/src/operations/handlers/device_profile.rs
Show resolved
Hide resolved
crates/extensions/c8y_mapper_ext/src/operations/handlers/device_profile.rs
Outdated
Show resolved
Hide resolved
ce7f2ab
to
41a8f23
Compare
587f135
to
965f5b0
Compare
While I am testing end-to-end, I found that handling for the This match needs to be expanded. The implementation should be very similar to the case thin-edge.io/crates/extensions/c8y_mapper_ext/src/converter.rs Lines 1123 to 1149 in 1c68fab
I'll let you decide if you address this in this PR or a follow-up PR. |
Another problem: c8y-mapper doesn't subscribe to if capabilities.device_profile {
topics.add_all(crate::operations::device_profile::topic_filter(&mqtt_schema));
} to this file thin-edge.io/crates/extensions/c8y_mapper_ext/src/config.rs Lines 201 to 218 in 1c68fab
|
Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
965f5b0
to
a92c04d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed both issue were fixed. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature is working as expected. But, the codecov report is not at all favourable. Something needs to be done to get it in shape.
a92c04d
to
1e39e2d
Compare
Signed-off-by: Krzysztof Piotrowski <[email protected]>
1e39e2d
to
5358ddc
Compare
The feature is working as expected, QA checked the functionality according description |
Proposed changes
TODO:
Types of changes
Paste Link to the issue
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments