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

refactor: CommandStatus::Executing takes extra MQTT messages #3049

Conversation

rina23q
Copy link
Member

@rina23q rina23q commented Aug 2, 2024

Proposed changes

Unlike other c8y operations that we support so far, c8y_DeviceProfile operation requires a inventory update MQTT message after EXECUTING message. Refer to the doc.

This PR changes CommandStatus::Executing to take extra MQTT messages after sending EXECUTING message to c8y.

P.S.
If we have a requirement that extra messages need to be send right before the EXECUTING message, this API need to be changed again. It will probably look like CommandStatus::Executing {messages: Vec<MqttMessage>} and all operation handlers need to add 501,<op_type message to the vector explicitly. Since there is no such a requirement as of now, I prefer to hide 501 message creation inside the API as it is.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 78.0%. Comparing base (be3b850) to head (094ec0b).
Report is 8 commits behind head on main.

Files Patch % Lines
.../c8y_mapper_ext/src/operations/handlers/restart.rs 0.0% 3 Missing ⚠️
...ions/c8y_mapper_ext/src/operations/handlers/mod.rs 83.3% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files Coverage Δ
...per_ext/src/operations/handlers/config_snapshot.rs 91.7% <100.0%> (+<0.1%) ⬆️
...apper_ext/src/operations/handlers/config_update.rs 92.7% <100.0%> (+<0.1%) ⬆️
...per_ext/src/operations/handlers/firmware_update.rs 93.1% <100.0%> (+<0.1%) ⬆️
...y_mapper_ext/src/operations/handlers/log_upload.rs 92.7% <100.0%> (+<0.1%) ⬆️
...per_ext/src/operations/handlers/software_update.rs 93.7% <100.0%> (+<0.1%) ⬆️
...ions/c8y_mapper_ext/src/operations/handlers/mod.rs 77.2% <83.3%> (+0.1%) ⬆️
.../c8y_mapper_ext/src/operations/handlers/restart.rs 75.0% <0.0%> (-5.0%) ⬇️

... and 6 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Aug 2, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
491 0 2 491 100 1h21m58.486650999s

@rina23q rina23q added this pull request to the merge queue Aug 2, 2024
Merged via the queue into thin-edge:main with commit ee032a8 Aug 2, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Developer value
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants