Closed hosekadam closed 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.01%. Comparing base (
ab3bbdd
) to head (0269506
). Report is 4 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/packit test --labels tier0
@hosekadam I had forgotten that I even reviewed this, but I created a solution too without realizing we had a solution created already. What is stopping us from doing something like this?
https://github.com/Venefilyn/convert2rhel/commit/1e480493e74b7f2c672bd876348b26baf1c88bf8
@Venefilyn looking at it, I would say they are really similar. Maybe the mine solution is easier to read (but it's probably because I did that :D) - like just adding the backed up path to the list of already backed up paths (which we already use, just extending it).
And yours where we have in the paths to back up just unique paths. Maybe the memory usage will be lower in this case.
Just one case came to my mind - what if the status or type of file would differ, but the path would be the same? In that case it would be added to the list, right? But maybe this is a too much corner case...
But I would definitely use the unit tests from this PR, which checks the complete process of the backup and rollback, I think the unit test is good because it tests the real usage (and I spent some time on it :D). But I understand, with your solution it's probably not needed so much.
what if the status or type of file would differ, but the path would be the same?
Good question. Feels like that would never occur though :thinking:
@bookwar @r0x0d WDYT
/packit test --labels tier0
what if the status or type of file would differ, but the path would be the same?
Good question. Feels like that would never occur though 🤔
@bookwar @r0x0d WDYT
I would merge the two PRs in this one. I prefer @Venefilyn solution as it is simpler and does not require always updating a list after each new backed up file. Ideally, we should receive the data in that function already prepared to parse and backup.
But I agree with @hosekadam to keep his unit_tests as it is testing the whole situation. I would try to look for a way to split the test or simplify if possible. The test itself is very difficult to read :thinking:.
My vote here is then to pick @Venefilyn solution and @hosekadam unit_tests.
We decided to merge this and my PR so closing this one
File can be present multiple times in the output of 'rpm -Va' command. The file is backed up only once.
Also, the unit test was updated to handle this situation.
Jira Issues:
Checklist
[RHELC-]
or[HMS-]
is part of the PR titleRelease Pending
if relevant