-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(sm-plugin): filter packages output list with exclude/include pattern #2869
feat(sm-plugin): filter packages output list with exclude/include pattern #2869
Conversation
258a14a
to
acfb164
Compare
acfb164
to
eda808f
Compare
eda808f
to
8222726
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
Robot Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to do the settings in a non breaking way as the old apt.name and apt.maintainer (inclusive) filters still need to be accepted (otherwise it will break everyone's existing config, and it will be in violation of the semver versioning).
We can introduce new settings but we need to then map the old settings to the new ones.
Also I'm not sure I fully understand the decision around the tedge-apt-plugin flag choice, as it stands the user can't use inclusive and exclusive filters via the cli...I would have expected something like "--inclusive-name" and "--exclusive-name" flags. The flag renaming is less important here as this was only ever used for adhoc validation an shouldn't break anyone's existing setup
crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs
Outdated
Show resolved
Hide resolved
crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs
Outdated
Show resolved
Hide resolved
8222726
to
33b3853
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test
- filter_packages_list_output_with_exclude_pattern.robot
Appears to be well-structured, covering a range of scenarios, and designed with maintainability and reliability in mind. Provides solid foundation for testing package filtering functionality - tests/RobotFramework/tests/plugin_apt/filter_packages_list_output_with_include_pattern.robot
Changes should be acurate enought to check the functionality properly - tests/RobotFramework/tests/tedge/call_tedge_config_list.robot
Effectively tests the setting and unsetting of configuration values for apt name and maintainer.
e774d79
to
d694d63
Compare
57c40a0
to
4ceffd5
Compare
4ceffd5
to
2e730c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved - with a suggestion
2e730c1
to
e218137
Compare
e218137
to
eb60c35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming the test cases are sufficient and correct, the implementation is correct.
tests/RobotFramework/tests/cumulocity/software_management/sm-plugin.robot
Outdated
Show resolved
Hide resolved
eb60c35
to
241361b
Compare
crates/common/tedge_config/src/tedge_config_cli/tedge_config.rs
Outdated
Show resolved
Hide resolved
Signed-off-by: Krzysztof Piotrowski <krzysztof.piotrowski@inetum.com>
Signed-off-by: Krzysztof Piotrowski <krzysztof.piotrowski@inetum.com>
Signed-off-by: Krzysztof Piotrowski <krzysztof.piotrowski@inetum.com>
Signed-off-by: Krzysztof Piotrowski <krzysztof.piotrowski@inetum.com>
241361b
to
40e1cfe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I experimented with the filters on a Yocto device and the combination of filters was able to reduce the list from 2000 to 160, perfect.
Proposed changes
This PR introduce two new tedge configs:
software.plugin.include
andsoftware.plugin.exclude
. This allows to filter packages list output insm-plugin
using include pattern and exclude pattern. When both patterns are provided in config, include pattern takes precedence over exclude pattern.Types of changes
Paste Link to the issue
#2848
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments