-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add requester prefix with timestamp to command operations #2381
Conversation
3d55fb8
to
27b2a67
Compare
@Ruadhri17 Just a few questions/requests:
|
Sure
For now only for log and config operations. However, it is possible to apply it to e.g restart though the structure is a little bit different. I will continue working on that. |
Robot Results
|
Yes, this should not cause specific issues. |
deb0905
to
03d7b25
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 need the clarification to the behaviour when the command is not issued by the requester.
I really believe that the mapper that is not the command issuer should ignore the message. It means c8y-mapper should not publish any status change messages (e.g. EXECUTING, FAILED, SUCCESSFUL) to c8y if the command ID doesn't contain c8y-mapper
, which means the command must be addressed by the other mapper.
Exactly. The mapper should only emit and process commands with an identifier matching its prefix. |
fb18bfc
to
dadb409
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.
The code is correct and I will be happy to approve once the tests fixed.
The unit tests have to be updated with appropriate prefix:
- &Topic::new_unchecked("te/device/child1///cmd/config_snapshot/1234"),
+ &Topic::new_unchecked("te/device/child1///cmd/config_snapshot/c8y-mapper-1234"),
The failing system test is flaky.
I pushed a fix to use the same prefix for all commands forwarded to the mapper. |
There seems to be other build issues here |
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.
Approved
Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
- restart - software_list - software_update Signed-off-by: Didier Wenzek <[email protected]>
1229d54
to
4049e2f
Compare
Signed-off-by: Reuben Miller <[email protected]>
Proposed changes
This PR fixes issue of #2251 with clearing log upload commands but not being a requester. It was also applied to config operations as the problem is basically the same. To make command ids more clearer and easier to debug, current
nanoid
was replaced withRFC3339
timestamp.Types of changes
Paste Link to the issue
#2251
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments