-
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-1225] Fix an exception when listing third-party packages with Epoch 2 #984
Conversation
Unit tests are failing but code if works seems good |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #984 +/- ##
=======================================
Coverage 94.32% 94.32%
=======================================
Files 47 47
Lines 4354 4355 +1
Branches 772 772
=======================================
+ Hits 4107 4108 +1
Misses 172 172
Partials 75 75
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -706,8 +706,9 @@ def _get_package_repositories(pkgs): | |||
repositories_mapping[package] = "N/A" | |||
else: | |||
for line in output: | |||
if "C2R" in line: | |||
split_output = line.lstrip("C2R ").split("&") | |||
line = line.lstrip() |
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.
I don't think we'll encounter this in the wild tbh, it's just something within our own tests, but doesn't hurt so let's leave it be for now
Simple and effective
|
…Epoch 2 (oamg#984) * Fix a bug processing repoquery output with an epoch 2 package. * Strip any initial whitespace from repoquery output. * Add unit test for Epoch 2 packages.
@jochapma, out of curiosity, why was the code failing with the epoch being specifically 2? Wouldn't other epoch cause the issue as well? |
@bocekm, we meant to strip off "C2R" from the left side of the string. Unfortunately, we were using lstrip(), which strips off all instances of any character in the string, so it removed C, 2, and R. So epoch 2 specifically got stripped off. |
Ugh, that was a nasty bug indeed, I would have not thought that lstrip() has this behavior. Thanks for the explanation. |
A bug processing output from the repoquery command caused packages with an Epoch equal to 2 to raise an exception in the third-party package listing task. This change fixes the processing.
Jira Issues: RHELC-1225
Checklist
[RHELC-]
is part of the PR titleRelease Pending
if relevant