-
Notifications
You must be signed in to change notification settings - Fork 84
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
[RHELC-1270] Update package handling check to properly report removed packages #999
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #999 +/- ##
==========================================
- Coverage 94.22% 94.18% -0.05%
==========================================
Files 47 47
Lines 4378 4382 +4
Branches 775 777 +2
==========================================
+ Hits 4125 4127 +2
Misses 177 177
- Partials 76 78 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
If there is a Jira issue about fixing this wording, please assign the PR to that. Otherwise create one so it's documented that we address this somewhere
@@ -207,13 +207,13 @@ def run(self): | |||
description="Repository file packages which could not be removed", | |||
diagnosis=message, | |||
) | |||
else: | |||
if pkgs_removed: |
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.
Keep in mind that pkgs_removed
wasn't declared outside of the try-catch, so this would fail if that ever changes. I would initialize pkgs_removed before it gets sorted
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.
But with the current state of the code wouldn't it be fine?
This line pkgs_removed = sorted(pkghandler.remove_pkgs_unless_from_redhat(pkgs_to_remove) or [])
ensures that we either get the removed packages or an empty list.
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.
It does! However, it is within a try-catch. So if we change the try catch in the future to not exit, we'd run into the issue where pkgs_removed
might be undefined
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.
Okay that makes sense, let me initialize pkgs_removed
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.
LGTM
0d93571
to
43e806c
Compare
/packit test --labels sanity |
With the current setup of the conditionals in handle_packages, there are cases where a message explaining that packages were removed will be made regardless if there are any packages removed or not. This PR changes the conditionals to only display the packages removed message when there are packages contained inside the pkgs_removed variable.
Jira Issues: RHELC-1270
Checklist
[RHELC-]
is part of the PR titleRelease Pending
if relevant