oamg / convert2rhel

A tool to automate converting Oracle/CentOS/Scientific/Rocky/Alma Linux and CentOS Stream to Red Hat Enterprise Linux
GNU General Public License v3.0
104 stars 84 forks source link

refactor: Improved logger usage #1373

Closed Venefilyn closed 1 month ago

Venefilyn commented 2 months ago

This refactor of the usage of our logging is to get away from custom functions that causes attribute errors in editors and IDEs. This will also standarize the usage of logger and the loglevels.

In future PRs we can include changes to include prepare, rollback, and final specific message styles.

Jira Issues:

-

Depends on

Checklist

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 79.72973% with 30 lines in your changes missing coverage. Please review.

Project coverage is 96.09%. Comparing base (d603f04) to head (943cec0). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
convert2rhel/phase.py 57.69% 18 Missing and 4 partials :warning:
convert2rhel/main.py 82.35% 2 Missing and 4 partials :warning:
convert2rhel/logger.py 66.66% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1373 +/- ## ========================================== - Coverage 96.59% 96.09% -0.51% ========================================== Files 71 72 +1 Lines 5113 5174 +61 Branches 883 896 +13 ========================================== + Hits 4939 4972 +33 - Misses 98 119 +21 - Partials 76 83 +7 ``` | [Flag](https://app.codecov.io/gh/oamg/convert2rhel/pull/1373/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | Coverage Δ | | |---|---|---| | [centos-linux-7](https://app.codecov.io/gh/oamg/convert2rhel/pull/1373/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `91.61% <78.47%> (-0.46%)` | :arrow_down: | | [centos-linux-8](https://app.codecov.io/gh/oamg/convert2rhel/pull/1373/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.46% <79.16%> (-0.47%)` | :arrow_down: | | [centos-linux-9](https://app.codecov.io/gh/oamg/convert2rhel/pull/1373/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.59% <79.72%> (-0.46%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

has-bot commented 2 months ago

/packit test --labels sanity


Comment generated by an automation.

Log | Bot Usage
Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit build

Venefilyn commented 2 months ago

/packit test --labels sanity

Venefilyn commented 2 months ago

/packit test --labels sanity

hosekadam commented 2 months ago

/packit test --labels sanity

hosekadam commented 2 months ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test --labels sanity

Venefilyn commented 1 month ago

/packit test

Venefilyn commented 1 month ago

/packit test

Venefilyn commented 1 month ago

/packit test

Venefilyn commented 1 month ago

The changes look great! I see the integration tests are failing and some of them related to the expected messages, maybe something got messed up? I can't see it. For example in integration tests in CentOS7 it expects to see CUSTOM_REPOSITORIES_ARE_VALID::UNABLE_TO_ACCESS_REPOSITORIES but instead C2R fails with:

convert2rhel("-y --no-rhsm --enablerepo fake-rhel-8-for-x86_64-baseos-rpms --debug", unregister=True)

(ERROR) REMOVE_SPECIAL_PACKAGES::SPECIAL_PACKAGE_REMOVAL_FAILED - Failed to remove some packages necessary for the conversion. Description: The cause of this error is unknown, please look at the diagnosis for more information. Diagnosis: Couldn't download the centos- release-7-9.2009.2.el7.centos.x86_64 package. This means we will not be able to do a complete rollback and may put the system in a broken state. Check to make sure that the CentOS Linux repositories are enabled and the package is updated to its latest version.

@SerCantus is it occurring in other PRs or in main?

Venefilyn commented 1 month ago

/packit test

SerCantus commented 1 month ago

@SerCantus is it occurring in other PRs or in main?

@Venefilyn I commented after reviewing this PR checks but I see other PRs have similar failures so it might not be caused by this one. After discussing, it might be related to some infra.

Venefilyn commented 1 month ago

Ack, feel free to approve and merge with squash