#87 Submit container image builds depending on finished container build.
Merged by jkaluza. Opened by jkaluza.
jkaluza/freshmaker container-build-submit  into  master

Download 87.patch

Once the Brew finishes the build of container, the BrewContainerTaskStateChangeHandler should submit builds of all container images depending on it.

rebased onto 70a991b7aa5effbad520dcd4efb8237a7fe48f22

Filtering out Events whose dep_on is None could have better performance, because dep_on of most of the builds are not None in most of the time.

EDIT:

Maybe the query could be

select from Event where state != ArtifactBuildState.PLANNED.value and dep_on is null and build_args != ''

I would prefer to move above three if to _build_first_batch and just pass build_args and repo_urls. From the method name and description, we know that this method is responsible for submitting container build to Koji. Selecting proper ArtifactBuild to submit could be moved out of this method.

But that would mean I would have to duplicate those three ifs also in container_task_state_change.py to get the build_args there...

Looks good to me. Some comments are added, they are my thoughts emerged in my mind while I'm reading these changes, but it is not a big problem I think.

I think we can abstract it to a method

def ArtifactBuild.get_buildables(self, dep_on=None, ...):
    pass

rebased onto b147d02bcb3a3168baed45b0d52fca52df5e9041

Updated, it now gets only builds with dep_on=None instead of filtering that in the python code.

After discussion on IRC, we will keep the current code in build_image_artifact_build including the three ifs.

Pull-Request has been merged by jkaluza

Metadata