Skip to content

fix: Capability message for firmware_update workflow#3146

Merged
albinsuresh merged 1 commit intothin-edge:mainfrom
albinsuresh:fix/3145/capability_message_for_firmware_update_workflow
Oct 1, 2024
Merged

fix: Capability message for firmware_update workflow#3146
albinsuresh merged 1 commit intothin-edge:mainfrom
albinsuresh:fix/3145/capability_message_for_firmware_update_workflow

Conversation

@albinsuresh
Copy link
Copy Markdown
Contributor

@albinsuresh albinsuresh commented Sep 30, 2024

Proposed changes

Tedge-agent to publish empty capability message when a workflow is defined for firmware_update operation.

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

#3145

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

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 30, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
505 0 2 505 100 1h36m23.646114s

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should just replace the existing system tests in this file: tests/RobotFramework/tests/cumulocity/firmware/firmware_operation.robot, as the old test file was created before thin-edge.io had official support for c8y_Firmware, and now the existing test add no value.

Copy link
Copy Markdown
Contributor Author

@albinsuresh albinsuresh Oct 1, 2024

Choose a reason for hiding this comment

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

Okay. I left it as-is since it's still testing the "C8Y operation overriding" mechanism with the c8y_Firmware operation definition file. If we don't really need that anymore, then yeah I can replace that with this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we have workflows, we don't need the older operation declaration, especially for the c8y_Firmware operation as the official recommended extension point is to create a workflow.

@albinsuresh albinsuresh force-pushed the fix/3145/capability_message_for_firmware_update_workflow branch from e5be66b to 57cdbcb Compare October 1, 2024 05:43
@albinsuresh albinsuresh temporarily deployed to Test Pull Request October 1, 2024 05:43 — with GitHub Actions Inactive
Set Suite Variable $DEVICE_SN
Device Should Exist ${DEVICE_SN}

Execute Command tedge config set c8y.enable.firmware_update true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wondering why we've disabled this by default at the mapper level. Unless someone explicitly creates a C8Y operation file or defines a workflow, the supported operation won't be declared by the mapper. So, I'm not sure why we want to disable the whole mapping itself, by default. @rina23q do you remember why? Can we switch to back to true?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe it was done to ensure we don't break systems which are using c8y-firmware-plugin...though we do need to think about a cleaner upgrade path (though correct me if I'm wrong here).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think first mapper implementation was done while agent side was not completed. That's why it was marked false as a temporary solution, however, it's forgotten to be true, even after firmware implementation in agent side was done...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by bdaabc5

@albinsuresh albinsuresh marked this pull request as ready for review October 1, 2024 06:05

*** Test Cases ***
Send firmware update operation from Cumulocity IoT
Cumulocity.Should Contain Supported Operations c8y_Firmware
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might also be worthwhile to add a check for the local capability message as well, e.g. te/device/main///cmd/firmware_update, to ensure that the functionality on the main device is discoverable to other clients listening to the same MQTT broker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by bdaabc5

@reubenmiller reubenmiller added theme:firmware Theme: Firmware update topics theme:workflows Theme: Workflow engine topics labels Oct 1, 2024
@albinsuresh albinsuresh force-pushed the fix/3145/capability_message_for_firmware_update_workflow branch from 57cdbcb to bdaabc5 Compare October 1, 2024 12:11
@albinsuresh albinsuresh temporarily deployed to Test Pull Request October 1, 2024 12:11 — with GitHub Actions Inactive
Test Teardown Get Logs

Test Tags theme:c8y theme:firmware theme:plugins
Test Tags theme:tedge_agent
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can still have the c8y theme on this as we are also testing the c8y_Firmware cloud operation, and tedge-agent is not needed as we would have to add the tag to almost all the non-cloud features

Suggested change
Test Tags theme:tedge_agent
Test Tags theme:c8y theme:firmware

Library Cumulocity

Test Setup Custom Setup
Suite Setup Custom Setup
Copy link
Copy Markdown
Contributor

@reubenmiller reubenmiller Oct 1, 2024

Choose a reason for hiding this comment

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

Why do we need to change to a Suite Setup, it would be better to leave it untouched as Test Suite is less prone to unexpected side effects from preceding test cases (in the same file).

Suggested change
Suite Setup Custom Setup
Test Setup Custom Setup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by d2c2cff

Resource ../../../resources/common.resource
Library Cumulocity
Library ThinEdgeIO
Library Cumulocity
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revert the Libary import sequence (not change is necessary)

Library             Cumulocity
Library             ThinEdgeIO

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved by d2c2cff

Copy link
Copy Markdown
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 (rust updates)

@albinsuresh albinsuresh force-pushed the fix/3145/capability_message_for_firmware_update_workflow branch from bdaabc5 to d2c2cff Compare October 1, 2024 12:39
@albinsuresh albinsuresh temporarily deployed to Test Pull Request October 1, 2024 12:39 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@reubenmiller reubenmiller 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 (Tests and change of default firmware_update setting)

@albinsuresh albinsuresh enabled auto-merge October 1, 2024 13:10
@albinsuresh albinsuresh added this pull request to the merge queue Oct 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 1, 2024
@albinsuresh albinsuresh added this pull request to the merge queue Oct 1, 2024
Merged via the queue into thin-edge:main with commit 4e0a879 Oct 1, 2024
@albinsuresh albinsuresh deleted the fix/3145/capability_message_for_firmware_update_workflow branch October 22, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:firmware Theme: Firmware update topics theme:workflows Theme: Workflow engine topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants