-
Notifications
You must be signed in to change notification settings - Fork 6
CLOS-3344: Add a check for leftover cldeploy package repository files #36
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
Conversation
These files are created and used during cldeploy conversions. They have the following naming scheme: repo.cloudlinux.com_cloudlinux_8_BaseOS_x86_64_os_.repo Normally these files are cleaned up by cldeploy before it finishes, but in some cases they can remain on the system. When that happens, they can introduce issues with Elevate upgrades. Therefore, we add a check to catch these cases in pre-upgrade.
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp from PR#42, use It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
[Deprecated] To launch on-demand regression testing public members of oamg organization can leave the following comment:
Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
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.
Pull Request Overview
Adds a pre-upgrade check to detect leftover repository files created by the cldeploy tool under /etc/yum.repos.d
, preventing them from blocking Elevate upgrades.
- Introduce
get_cldeploy_repo_files
to filter out cldeploy‐style repo files by prefix. - Create a report if any leftover files are found, halting the upgrade.
- Add a new actor (
CheckCldeployRepofile
) wired into the pre‐upgrade workflow.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/tests/unit_test_checkcldeployrepofile.py | Tests for the new get_cldeploy_repo_files helper |
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/libraries/checkcldeployrepofile.py | Implements file‐filtering logic, report creation, and processing |
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/actor.py | Defines the new actor that invokes the library on CloudLinux |
Comments suppressed due to low confidence (4)
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/tests/unit_test_checkcldeployrepofile.py:31
- [nitpick] The test name refers to packages but exercises repository file detection. Rename it to something like
test_get_cldeploy_repo_files
for clarity.
def test_problem_packages_installed(repo_file_paths, expected_res):
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/tests/unit_test_checkcldeployrepofile.py:15
- The test fixture omits the
.repo
extension, but real cldeploy files end with.repo
. Update the path to include the suffix so tests mirror real filenames.
/etc/yum.repos.d/repo.cloudlinux.com_cloudlinux_8_BaseOS_x86_64_os_
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/actor.py:8
- [nitpick] The class name
CheckCldeployRepofile
is hard to parse. Consider renaming toCheckClDeployRepoFile
for consistency and readability.
class CheckCldeployRepofile(Actor):
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/libraries/checkcldeployrepofile.py:23
- There are no unit tests for
create_report
. Add tests to verify thatreporting.create_report
is called with the expected title, summary, severity, groups, and remediation.
def create_report(cldeploy_repo_files):
repos/system_upgrade/cloudlinux/actors/checkcldeployrepofile/libraries/checkcldeployrepofile.py
Show resolved
Hide resolved
lgtm |
These files are created and used during cldeploy conversions. They have the following naming scheme:
repo.cloudlinux.com_cloudlinux_8_BaseOS_x86_64_os_.repo
Normally these files are cleaned up by cldeploy before it finishes, but in some cases they can remain on the system.
When that happens, they can introduce issues with Elevate upgrades.
Therefore, we add a check to catch these cases in pre-upgrade.