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: software artifacts are downloaded twice when the update-list feature is not available #3065

Conversation

Ruadhri17
Copy link
Contributor

@Ruadhri17 Ruadhri17 commented Aug 14, 2024

This small PR fixes issue with software artifacts being downloaded twice when update-list is not available. Extra validation step was introduced to check if artifact is downloaded.

Proposed changes

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

…t available

Signed-off-by: Krzysztof Piotrowski <krzysztof.piotrowski@inetum.com>
@Ruadhri17 Ruadhri17 added bug Something isn't working theme:software Theme: Software management labels Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

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

Files Patch % Lines
crates/core/plugin_sm/src/plugin.rs 0.00% 4 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Aug 14, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
492 0 2 492 100 1h22m14.571546s

Copy link
Contributor

@albinsuresh albinsuresh left a comment

Choose a reason for hiding this comment

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

LGTM. Can a system test be added to fully confirm the effectiveness of the fix? You can just assert that the agent log contains only one "downloading" statement for that artefact.

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.

I would only log an info! telling that the agent installs the packages one after the other as update_list is not supported for this type of packages

Comment on lines 138 to 139
if let Err(SoftwareError::UpdateListNotSupported(name)) = outcome {
info!("{}", SoftwareError::UpdateListNotSupported(name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if let Err(SoftwareError::UpdateListNotSupported(name)) = outcome {
info!("{}", SoftwareError::UpdateListNotSupported(name));
if let Err(err @ SoftwareError::UpdateListNotSupported(_)) = outcome {
info!("{err}");

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, applied

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
@rina23q rina23q force-pushed the fix-artifacts-download-twice-for-software-update branch from 8eed947 to 1d99114 Compare August 16, 2024 16:03
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

@didier-wenzek didier-wenzek added this pull request to the merge queue Aug 16, 2024
Merged via the queue into thin-edge:main with commit 412f491 Aug 16, 2024
33 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.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:software Theme: Software management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants