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

Create generic tedge configuration plugin #2238

Merged
merged 4 commits into from
Sep 25, 2023

Conversation

Ruadhri17
Copy link
Contributor

@Ruadhri17 Ruadhri17 commented Sep 8, 2023

Proposed changes

This PR adds generic configuration plugin
TODO:

  • Replace device-topic-root and device-topic-identifier with the one from tedge config
  • Add downloader actor for config update

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

@Ruadhri17 Ruadhri17 force-pushed the config-plugin-ref branch 2 times, most recently from 5a428bb to b6b05dd Compare September 8, 2023 08:26
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 8, 2023 08:37 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
288 0 3 288 100 1h0m33.033999999s

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.

Since it's still draft, I didn't dive into details, but Cargo.toml you can fix quickly.

crates/extensions/tedge_config_manager/Cargo.toml Outdated Show resolved Hide resolved
crates/core/tedge_api/src/messages.rs Show resolved Hide resolved
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 11, 2023 18:59 — with GitHub Actions Inactive
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 12, 2023 00:14 — with GitHub Actions Inactive
@Ruadhri17 Ruadhri17 force-pushed the config-plugin-ref branch 3 times, most recently from 58fb1bb to 5d7b18d Compare September 12, 2023 21:39
@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #2238 (f75f5c2) into main (be351da) will decrease coverage by 0.2%.
The diff coverage is 72.3%.

Additional details and impacted files
Files Changed Coverage Δ
crates/core/tedge_api/src/mqtt_topics.rs 80.6% <0.0%> (-1.3%) ⬇️
...rates/extensions/tedge_config_manager/src/error.rs 0.0% <0.0%> (ø)
plugins/tedge_configuration_plugin/src/main.rs 0.0% <0.0%> (ø)
...ates/extensions/tedge_config_manager/src/config.rs 59.8% <59.8%> (ø)
...rates/extensions/tedge_config_manager/src/actor.rs 69.4% <69.4%> (ø)
crates/core/tedge_api/src/messages.rs 92.1% <78.5%> (-0.8%) ⬇️
crates/extensions/tedge_config_manager/src/lib.rs 91.4% <91.4%> (ø)
...rates/extensions/tedge_config_manager/src/tests.rs 91.9% <91.9%> (ø)

... and 7 files with indirect coverage changes

@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 12, 2023 21:52 — with GitHub Actions Inactive
@Ruadhri17 Ruadhri17 force-pushed the config-plugin-ref branch 2 times, most recently from 23f5b38 to f3f531d Compare September 18, 2023 17:40
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 18, 2023 17:52 — with GitHub Actions Inactive
@Ruadhri17 Ruadhri17 marked this pull request as ready for review September 18, 2023 18:04
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 18, 2023 18:13 — with GitHub Actions Inactive
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 19, 2023 21:09 — with GitHub Actions Inactive
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.

I'm still not finishing review, but I would submit now and will continue review tomorrow.

My general questions is:

  • Do we need to create a library crate to avoid the code duplication between c8y-configuration-manager and tedge-configuration-manager?

I would also remark that this implementation omits timer_actor, which exists in c8y-configuration-manager. Need to think which one is appropriate one to address the timeout, mapper or plugin?

Cargo.toml Outdated Show resolved Hide resolved
plugins/tedge_configuration_plugin/src/main.rs Outdated Show resolved Hide resolved
crates/extensions/tedge_config_manager/Cargo.toml Outdated Show resolved Hide resolved
crates/extensions/tedge_config_manager/src/config.rs Outdated Show resolved Hide resolved
@Ruadhri17 Ruadhri17 force-pushed the config-plugin-ref branch 2 times, most recently from 2d67a03 to 601d2e0 Compare September 21, 2023 18:19
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 21, 2023 18:33 — with GitHub Actions Inactive
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

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.

I tested according to the spec. It works, and addressing error cases! Very good job!

Almost all of my comments are minor. The exception is the default contents of the tedge-configuration-plugin.toml file, but it should be one-liner change, so you only need 1 minute to fix it.
For others, If you have time, you can modify them. But don't spend too much time. If you feel it's too much change, then stop and we can merge this PR.

crates/extensions/tedge_config_manager/src/actor.rs Outdated Show resolved Hide resolved
crates/extensions/tedge_config_manager/src/lib.rs Outdated Show resolved Hide resolved
crates/extensions/tedge_config_manager/src/config.rs Outdated Show resolved Hide resolved
crates/extensions/tedge_config_manager/src/config.rs Outdated Show resolved Hide resolved
crates/extensions/tedge_config_manager/src/tests.rs Outdated Show resolved Hide resolved
@Ruadhri17 Ruadhri17 force-pushed the config-plugin-ref branch 2 times, most recently from aa6f953 to 792a445 Compare September 25, 2023 10:17
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.

LGTM!

Signed-off-by: Krzysztof Piotrowski <[email protected]>
Signed-off-by: Krzysztof Piotrowski <[email protected]>
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request September 25, 2023 10:43 — with GitHub Actions Inactive
@Ruadhri17 Ruadhri17 merged commit 3ba5851 into thin-edge:main Sep 25, 2023
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.

3 participants