#451 Mark parent images as directly affected when necessary
Merged by mprahl. Opened by mprahl.
mprahl/freshmaker 5446  into  master

Download 451.patch

If a directly affected image returned by find_images_with_packages_from_content_set is also a parent image, it could possible be set incorrectly as a dependent.

This ensures that if the image from find_parent_images_with_package is used instead of the one returned by find_images_with_packages_from_content_set, directly affected is set on the image.

@gnaponie and @jkaluza, this is my attempt at resolving FACTORY-5446. I couldn't figure out a way to reproduce the issue locally, so this might not be the correct solution. Please let me know your thoughts.

The case that spawned this issue is

parent -> child graph for notes

base -> foo-base -> foo-worker
base -> fooz-base ->fooz-api

you then get list of images that look like the following in sorted order.

base
foo-base
foo-worker
fooz-api
fooz-base

If you walk through them in that order looking at parent/child one of the *-base images would be detected incorrectly as dependent instead of directly affected. Not sure from quick look at test code how to get that example coded into test case.

rebased onto d0727adf06ed334f28e70309653ccf26b6fc30ad

@gnaponie @jkaluza I refactored the tests to be a little less fragile. Could you please review?

minor: it would be nice to keep consistent quotes and double quotes.

This looks good to me. +1

rebased onto 89d110005a3d6ee150820a23e976777912e182b2

minor: it would be nice to keep consistent quotes and double quotes.

I fixed the quotes but that was actually copied from another leaf image definition. It might be worth fixing it in the rest of the test to make it consistent.

Pull-Request has been merged by mprahl

Metadata