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

Replace special characters in package version #2683

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

Ruadhri17
Copy link
Contributor

Proposed changes

This PR provides a quick fix to the tedge-apt-plugin bug, which prevents the package installation if it contains a colon character. More in #2666.

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

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4347525) 75.9% compared to head (153b90f) 75.9%.
Report is 9 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
crates/core/plugin_sm/src/plugin.rs 15.7% <100.0%> (+3.9%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

github-actions bot commented Feb 5, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
391 0 3 391 100 50m40.018s

@Ruadhri17 Ruadhri17 force-pushed the apt-replace-colon branch 2 times, most recently from e5d734c to 43c5c13 Compare February 5, 2024 20:53
@Ruadhri17 Ruadhri17 changed the title Replace colon character in package version Replace special characters in package version Feb 5, 2024
@Ruadhri17 Ruadhri17 temporarily deployed to Test Pull Request February 5, 2024 21:01 — with GitHub Actions Inactive
@didier-wenzek
Copy link
Contributor

Software not installed. errors=[('package-with-epoch', 'MISSING')]

You have to add package-with-epoch to the list of packages not filtered out by the tedge-apt-plugin.

@reubenmiller
Copy link
Contributor

Software not installed. errors=[('package-with-epoch', 'MISSING')]

You have to add package-with-epoch to the list of packages not filtered out by the tedge-apt-plugin.

Good point. I overlooked this…or maybe we could modify the default setting to include a naming convention or even better filter by maintainer

Copy link
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.

Tests (including generation of test files) looks good.

@reubenmiller
Copy link
Contributor

@Ruadhri17
The reason why the Apply name filter test is now failing is because the default maintainer filter was added to the base integration test image, and in this test it is calling the tedge-apt-plugin list command manually which is inheriting the maintainer filter from the tedge.toml (which previously did not exist). So we just need to prevent that from happening by using --maintainer "" in the test.

Here is the git patch to fix the issue:

diff --git a/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot b/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot
index b921944f5e..12e74768ce 100644
--- a/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot
+++ b/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot
@@ -11,7 +11,7 @@ Test Tags           theme:software    theme:plugins
 *** Test Cases ***
 Apply name filter
     ${packages_list}=    Execute Command
-    ...    sudo /etc/tedge/sm-plugins/apt list --name tedge
+    ...    sudo /etc/tedge/sm-plugins/apt list --name tedge --maintainer ""
     ...    exp_exit_code=0
     Should Match Regexp    ${packages_list}    ^tedge\\s+${VERSION}

@reubenmiller reubenmiller added the theme:software Theme: Software management label Feb 6, 2024
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

@reubenmiller
Copy link
Contributor

@Ruadhri17 The reason why the Apply name filter test is now failing is because the default maintainer filter was added to the base integration test image, and in this test it is calling the tedge-apt-plugin list command manually which is inheriting the maintainer filter from the tedge.toml (which previously did not exist). So we just need to prevent that from happening by using --maintainer "" in the test.

Here is the git patch to fix the issue:

diff --git a/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot b/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot
index b921944f5e..12e74768ce 100644
--- a/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot
+++ b/tests/RobotFramework/tests/plugin_apt/filter_packages_list_output.robot
@@ -11,7 +11,7 @@ Test Tags           theme:software    theme:plugins
 *** Test Cases ***
 Apply name filter
     ${packages_list}=    Execute Command
-    ...    sudo /etc/tedge/sm-plugins/apt list --name tedge
+    ...    sudo /etc/tedge/sm-plugins/apt list --name tedge --maintainer ""
     ...    exp_exit_code=0
     Should Match Regexp    ${packages_list}    ^tedge\\s+${VERSION}

I was able to apply the patch myself (after disabling the git-lfs pre-commit hook which was previously blocking me to do so)

@reubenmiller reubenmiller added this pull request to the merge queue Feb 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 6, 2024
@reubenmiller reubenmiller added this pull request to the merge queue Feb 6, 2024
Merged via the queue into thin-edge:main with commit 166dc8f Feb 6, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:software Theme: Software management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants