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

fix(mqtt): Publish mosquitto bridge status to c8y when enabled #2901

Conversation

albinsuresh
Copy link
Contributor

@albinsuresh albinsuresh commented May 24, 2024

Proposed changes

If the mosquitto bridge is used for C8y connectivity, then the bridge service status must also be published to C8y.

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

#2898

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 May 24, 2024

Codecov Report

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

Project coverage is 78.0%. Comparing base (c53e14a) to head (8a91efb).
Report is 1 commits behind head on main.

Current head 8a91efb differs from pull request most recent head 48fe6a9

Please upload reports for the commit 48fe6a9 to get more accurate results.

Additional details and impacted files
Files Coverage Δ
crates/extensions/c8y_mapper_ext/src/converter.rs 83.6% <0.0%> (-0.1%) ⬇️

... and 8 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented May 24, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
427 14 3 441 96.83 1h31m40.235889s

Failed Tests

Name Message ⏱️ Duration Suite
Set Configuration when file does not exist Several failures occurred: 1) Expected operation (id=10406589) to be SUCCESSFUL, but got: PENDING (failureReason: ) 2) Expected operation (id=10406733) to be SUCCESSFUL, but got: PENDING (failureReason: ) 3) DeviceNotFound 4) DeviceNotFound 307.759 s Configuration Operation
Set Configuration when file exists Several failures occurred: 1) Expected operation (id=10408214) to be SUCCESSFUL, but got: PENDING (failureReason: ) 2) Expected operation (id=10408502) to be SUCCESSFUL, but got: PENDING (failureReason: ) 3) DeviceNotFound 4) DeviceNotFound 310.866 s Configuration Operation
Set configuration with broken url Several failures occurred: 1) Expected operation (id=10408658) to be FAILED, but got: PENDING 2) DeviceNotFound 158.886 s Configuration Operation
Get Configuration from Main Device Several failures occurred: 1) Expected operation (id=10408667) to be SUCCESSFUL, but got: PENDING (failureReason: ) 2) Expected operation (id=10408669) to be SUCCESSFUL, but got: PENDING (failureReason: ) 242.539 s Configuration Operation
Get Configuration from Child Device Several failures occurred: 1) DeviceNotFound 2) DeviceNotFound 61.523 s Configuration Operation
Get Unknown Configuration Type From Device Several failures occurred: 1) Expected operation (id=10408671) to be FAILED, but got: PENDING 2) DeviceNotFound 63.132 s Configuration Operation
Get non existent configuration file From Device Several failures occurred: 1) Expected operation (id=10408673) to be FAILED, but got: PENDING 2) DeviceNotFound 63.415 s Configuration Operation
Update configuration plugin config via cloud Several failures occurred: 1) Supported Configuration fragment (c8y_SupportedConfigurations) does not match. wanted: ['/etc/tedge/tedge.toml', 'CONFIG1', 'CONFIG1_BINARY', 'system.toml', 'tedge-configuration-plugin'] got: ['/etc/tedge/tedge.toml', 'system.toml', 'tedge-configuration-plugin'] 2) DeviceNotFound 64.225 s Configuration Operation
Modify configuration plugin config via local filesystem modify inplace Several failures occurred: 1) Supported Configuration fragment (c8y_SupportedConfigurations) does not match. wanted: ['/etc/tedge/tedge.toml', 'CONFIG1', 'CONFIG1_BINARY', 'system.toml', 'tedge-configuration-plugin'] got: ['/etc/tedge/tedge.toml', 'system.toml', 'tedge-configuration-plugin'] 2) DeviceNotFound 61.934 s Configuration Operation
Modify configuration plugin config via local filesystem overwrite Several failures occurred: 1) Supported Configuration fragment (c8y_SupportedConfigurations) does not match. wanted: ['/etc/tedge/tedge.toml', 'CONFIG1', 'CONFIG1_BINARY', 'system.toml', 'tedge-configuration-plugin'] got: ['/etc/tedge/tedge.toml', 'system.toml', 'tedge-configuration-plugin'] 2) DeviceNotFound 63.370 s Configuration Operation
Update configuration plugin config via local filesystem copy Several failures occurred: 1) Supported Configuration fragment (c8y_SupportedConfigurations) does not match. wanted: ['/etc/tedge/tedge.toml', 'CONFIG1', 'CONFIG1_BINARY', 'system.toml', 'tedge-configuration-plugin'] got: ['/etc/tedge/tedge.toml', 'system.toml', 'tedge-configuration-plugin'] 2) DeviceNotFound 63.802 s Configuration Operation
Update configuration plugin config via local filesystem move (different directory) Several failures occurred: 1) Supported Configuration fragment (c8y_SupportedConfigurations) does not match. wanted: ['/etc/tedge/tedge.toml', 'CONFIG1', 'CONFIG1_BINARY', 'system.toml', 'tedge-configuration-plugin'] got: ['/etc/tedge/tedge.toml', 'system.toml', 'tedge-configuration-plugin'] 2) DeviceNotFound 62.557 s Configuration Operation
Update configuration plugin config via local filesystem move (same directory) Several failures occurred: 1) Supported Configuration fragment (c8y_SupportedConfigurations) does not match. wanted: ['/etc/tedge/tedge.toml', 'CONFIG1', 'CONFIG1_BINARY', 'system.toml', 'tedge-configuration-plugin'] got: ['/etc/tedge/tedge.toml', 'system.toml', 'tedge-configuration-plugin'] 2) DeviceNotFound 64.728 s Configuration Operation
Default plugin configuration Matching messages is less than minimum. wanted: 1 got: 0 messages: [] 31.172 s Configuration Operation

Copy link
Member

@rina23q rina23q left a comment

Choose a reason for hiding this comment

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

This PR fixes the reported bug

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

Approved

crates/extensions/c8y_mapper_ext/src/converter.rs Outdated Show resolved Hide resolved
@reubenmiller reubenmiller changed the title fix(#2898): Publish mosquitto bridge status to c8y when enabled fix(mosquitto): Publish mosquitto bridge status to c8y when enabled May 24, 2024
@reubenmiller reubenmiller changed the title fix(mosquitto): Publish mosquitto bridge status to c8y when enabled fix(mqtt): Publish mosquitto bridge status to c8y when enabled May 24, 2024
@albinsuresh albinsuresh force-pushed the fix/2898/publish-mosquitto-bridge-status branch from 7f9d459 to 8a91efb Compare May 24, 2024 18:35
@albinsuresh albinsuresh disabled auto-merge May 24, 2024 18:38
@albinsuresh albinsuresh force-pushed the fix/2898/publish-mosquitto-bridge-status branch from 8a91efb to 48fe6a9 Compare May 24, 2024 18:38
@albinsuresh albinsuresh added this pull request to the merge queue May 24, 2024
Merged via the queue into thin-edge:main with commit 6bd29a9 May 24, 2024
30 checks passed
Copy link
Contributor

@gligorisaev gligorisaev left a comment

Choose a reason for hiding this comment

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

The test script is well-structured to verify the existence of an external identity and the status of the bridge service.

@albinsuresh albinsuresh deleted the fix/2898/publish-mosquitto-bridge-status branch May 28, 2024 05:48
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