When Freshmaker generates the list of images to rebuild, the current code
does not handle the case when older foo image was built against x-1-1
and newer foo against y-1-1 well. It will generate following list:
bar-1-1 will be rebuilt against foo-1-2, because foo-1-2 is the latest release.
foo-1-2 will be rebuilt against x-1-1, because original parent ofbar-1-1wasfoo-1-1and it depended onx-1-1. This is wrong. In fact, it should be built against
latest release of y which is y-1-1.
This PR fixes this problem by introducing another initial phase in code which
deduplicates images to rebuild.
In this phase, Freshmaker will search for cases when older image has different
parent than the newer image and if it finds such case, it will replace the
parents completely according to latest image, because we will in the end
use the latest image.
In our example, it will do following in this initial phase:
It finds out that foo-1-1 has different parent than foo-1-2.
It knows that foo-1-2 is latest, and therefore it will change the foo-1-1 parent of bar-1-1 to foo-1-2, include its dependency
on y-1-1.
After this initial phase, the bar-1-1 will have foo-1-2 dependency.
This will make Freshmaker to generate proper list of images to rebuild.
Consider following situations:
foo-1-1hasx-1-1parent image.foo-1-2hasy-1-1parent image.bar-1-1hasfoo-1-1parent image.When Freshmaker generates the list of images to rebuild, the current code
does not handle the case when older
fooimage was built againstx-1-1and newer
fooagainsty-1-1well. It will generate following list:bar-1-1will be rebuilt againstfoo-1-2, becausefoo-1-2is the latest release.foo-1-2will be rebuilt againstx-1-1, becauseoriginal parent ofbar-1-1wasfoo-1-1and it depended onx-1-1. This is wrong. In fact, it should be built againstlatest release of
ywhich isy-1-1.This PR fixes this problem by introducing another initial phase in code which
deduplicates images to rebuild.
In this phase, Freshmaker will search for cases when older image has different
parent than the newer image and if it finds such case, it will replace the
parents completely according to latest image, because we will in the end
use the latest image.
In our example, it will do following in this initial phase:
foo-1-1has different parent thanfoo-1-2.foo-1-2is latest, and therefore it will change thefoo-1-1parent ofbar-1-1tofoo-1-2, include its dependencyon
y-1-1.After this initial phase, the
bar-1-1will havefoo-1-2dependency.This will make Freshmaker to generate proper list of images to rebuild.