Once the Brew finishes the build of container, the BrewContainerTaskStateChangeHandler should submit builds of all container images depending on it.
BrewContainerTaskStateChangeHandler
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.
dep_on
None
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.
if
_build_first_batch
build_args
repo_urls
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...
container_task_state_change.py
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.
dep_on=None
After discussion on IRC, we will keep the current code in build_image_artifact_build including the three ifs.
build_image_artifact_build
Pull-Request has been merged by jkaluza
Once the Brew finishes the build of container, the
BrewContainerTaskStateChangeHandlershould submit builds of all container images depending on it.