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

[RHELC-1753] Handle yum failing on trying to reach inaccessible --enablerepo repos #1425

Closed hosekadam closed 1 day ago

hosekadam commented 2 weeks ago

Avoid reaching unaccessible repositories provided by user using --enablerepo argument. Those repos are manually disabled during analysis, but when user provides unreachable repo the analysis would fail.

This change adds check if provided repos are accessible - if not, those unaccessible ones are removed from the list for manual disable during analysis.

Jira Issues:

Checklist

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.12%. Comparing base (7c3db22) to head (3ba3fe6). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1425 +/- ## ========================================== + Coverage 96.09% 96.12% +0.03% ========================================== Files 72 72 Lines 5146 5186 +40 Branches 889 896 +7 ========================================== + Hits 4945 4985 +40 Misses 119 119 Partials 82 82 ``` | [Flag](https://app.codecov.io/gh/oamg/convert2rhel/pull/1425/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/1425/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `91.65% <100.00%> (+0.06%)` | :arrow_up: | | [centos-linux-8](https://app.codecov.io/gh/oamg/convert2rhel/pull/1425/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.50% <100.00%> (+0.05%)` | :arrow_up: | | [centos-linux-9](https://app.codecov.io/gh/oamg/convert2rhel/pull/1425/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=oamg) | `92.62% <100.00%> (+0.05%)` | :arrow_up: | 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.

hosekadam commented 2 weeks ago

Note for reviewers: I used the singleton pattern as we don't exactly know the order of actions and possible where the repo.py would be imported. If we decide to create an instance inside the repo.py we can end up preparing the disablerepo list when we don't actually need it (and possibly the analysis can fail in earlier actions).

This solution creates an instance when it's needed and also the list is prepared only once (it can be a bit time-consuming in case of many unreachable repos)

EDIT: One thing which is left is to comment the unit tests, but the rest is ready for review.

danmyway commented 1 week ago

/packit test --labels tier0

danmyway commented 1 week ago

/packit retest-failed

danmyway commented 1 week ago

/packit test --labels tier0

has-bot commented 1 week ago

/packit test --labels tier0


Comment generated by an automation.

Log | Bot Usage
danmyway commented 1 week ago

The failure of /tests/integration/tier1/destructive/system-not-up-to-date/system_not_updated is a false negative and to be fixed in #1423

danmyway commented 2 days ago

/packit test --labels tier0

bocekm commented 1 day ago

Not a problem coming with this PR (it's been like that for quite a while) but just for the record - there's a corner case where:

hosekadam commented 1 day ago

/packit test --labels tier0