oamg / leapp-repository

Leapp repositories containing actors for the Leapp framework (https://github.com/oamg/leapp). Currently provides leapp repositories for in-place upgrades of RHEL systems.
Apache License 2.0
48 stars 144 forks source link

pes_events_scanner: override repositories when applying an event #1194

Closed MichalHe closed 5 months ago

MichalHe commented 5 months ago

The Package class has custom __hash__ and __eq__ methods in order to achieve a straightforward presentation via set manipulation. However, this causes problems, e.g., when applying split events. For example: Applying the event Split event: in={(A, repo1)}, out={(A, repo2), (B, repo2)} to the package state {(A, repo1), (B, repo1)} results in the following: {(A, repo1), (B, repo1)} --apply--> {(A, repo2), (B, repo1)} which is undesired as repo1 is a source system repository. Such a package will get reported to the user as potentially removed during the upgrade. This patch addresses this unwanted behavior.

jira: OAMG-10559

github-actions[bot] commented 5 months ago

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. If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use /packit test oamg/leapp#42 Note that first time contributors cannot run tests automatically - they will be started by a reviewer.

It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, beaker-minimal and kernel-rt, both can be used to be run on all upgrade paths or just a couple of specific ones. To launch on-demand tests with packit:

See other labels for particular jobs defined in the .packit.yaml file.

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.

pirat89 commented 5 months ago

/packit build

fernflower commented 5 months ago

While the comments give some details about the mechanism - would it be possible to come up with a unit test that covers the scenario "the package is no longer among packages-to-be-removed"? Or is it too much work and integration tests are a better fit?

MichalHe commented 5 months ago

@fernflower I have added the described unit test.

MichalHe commented 5 months ago

@pirat89 I have applied @dkubek's suggestions, and, therefore, the patch is ready to be merged.

pirat89 commented 5 months ago

@MichalHe :D line too long. pls take a look

MichalHe commented 5 months ago

@pirat89 huh, sorry. I did notice when I applied the changes. Should be fine now, though.

pirat89 commented 5 months ago

@MichalHe np :) it's happening to me as well.