-
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-884] Disable RHEL repos when performing checks #1174
[RHELC-884] Disable RHEL repos when performing checks #1174
Conversation
3787342
to
dcaa034
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1174 +/- ##
==========================================
+ Coverage 95.42% 95.44% +0.02%
==========================================
Files 54 54
Lines 4699 4720 +21
Branches 829 833 +4
==========================================
+ Hits 4484 4505 +21
Misses 132 132
Partials 83 83
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@hosekadam, looking at how we are disabling the repos, maybe we should use I'm asking this more because if RHEL introduces a new repo, or modifies the name at some point to have something like: |
@r0x0d Thanks for taking a look! I used |
a5c22e2
to
6e4d131
Compare
# Import the YUM inside the test. If YUM is not present the test isn't run | ||
import yum |
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.
Why not using pkgmanager for this?
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'll take a look, there is one more problem with mocking the doPackageList
- the tests failed. It was just a test if that yum.repos.Repository
works :D
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.
Now it's working, the tests test_get_packages_to_update_yum_rhel
and test_get_packages_to_update_dnf_rhel
are ready @r0x0d
612e7d0
to
e6db3b0
Compare
So from the last time:
I'm not sure if there is requirement to add unit tests for |
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, but confused about the skip if index 0 part
assert rhel_repo_id in enabled_repos | ||
|
||
# Choose one of the enabled repos on the system | ||
# Avoid getting the rhel_repo_id if on 0 index, then get the repo id from 1 |
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.
Why?
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'm trying to disable one of the repos available on the system to test repo provided through the tool_opts (monkeypatch.setattr(tool_opts, "enablerepo", repo_for_disable)
). I want to have something different than the added RHEL repo but still present on the system.
So I'm getting it in this way - I know if on the 0 index is rhel repo, on the 1 will be something different I can use
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'd write that out a bit clearer in the text, avoid getting something is clear but not super clear in the comments of why you do it
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.
Comment about it added.
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 good!
e6db3b0
to
0a84a44
Compare
@pr-watson needs to try something. The PR is now WIP |
4bcd581
to
d6f2a90
Compare
TBD:
|
d6f2a90
to
8139107
Compare
|
62767d7
to
960c86f
Compare
|
28ea6f0
to
737e36b
Compare
convert2rhel/pkghandler.py
Outdated
@@ -393,8 +393,11 @@ def _get_package_repositories(pkgs): | |||
if system_info.version.major >= 8: | |||
query_format = "C2R %{NAME}-%{EPOCH}:%{VERSION}-%{RELEASE}.%{ARCH}&%{REPOID}\n" | |||
|
|||
# RHELC-884 disable the RHEL repos to avoid downloading pkgs from them. | |||
disable_repo_command = repo.get_rhel_disable_repos_command() |
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.
This is part of discussion. Will be changed to be sent via argument from list third party pkgs to be more future-proof. Will do tomorrow
EDIT: During testing and final checking the output found another :( repoquery in RemoveSpecialPackages
, will handle similarly as in the ListThirdPartyPackages
737e36b
to
45901ba
Compare
About the |
Related issue: [RHELC-884] We need to disable RHEL repos when performing checks. If user registers the system to satellite which provides Centos and RHEL repos and the RHEL repos would be enabled, it would cause a fail. The recommended way is to disable the rhel repos prior the conversion, but is expected it might be forgotten. This helps avoiding the problems caused by wrong setup of the repos. RHEL repos are disabled when: * trying to download backup of package present on original system * when checking if kernel and packages are up-to-date * when retrieving repository info from packages (RemoveSpecialPkgs and ListThirdParty packages)
45901ba
to
63656f8
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 good to me. Test failure is not related
We need to disable RHEL repos. If user registers the system to satellite which provides Centos and RHEL repos and the RHEL repos would be enabled, it would cause a fail. The recommended way is to disable the rhel repos prior the conversion, but is expected it might be forgotten. This helps avoiding the problems caused by wrong setup of the repos.
Jira Issues: https://issues.redhat.com/browse/RHELC-884
Checklist
[RHELC-]
is part of the PR titleRelease Pending
if relevant