#163 Request boot.iso compose for base image rebuild
Merged by jkaluza. Opened by cqi.
cqi/freshmaker refactor-compose_id  into  master

Download 163.patch

This PR contains a series of commits that are for requesting boot.iso compose to rebuild a base image.

To achieve this goal, we are facing a challenge of where to store the boot.iso compose id for a specific base image, and how to query base image artifact build by a boot.iso compose id because rebuild starts only when all assocated composes finish.

Currently there are two types of composes for a rebuild, a normal compose including updated RPMs and pulp compose, and each of them has its own place to be stored. For former one, it's stored in Event.compose_id, and for the latter one, it's stored in ArtifactBuild.build_args['odcs_pulp_compose_id']. So, based on this implementation, we might need another build_args to store boot.iso comopse id, for example ArtifactBuild.build_args['boot_iso_compose_id']. But, it is not easy to query by boot_iso_comopse_id or perhaps impossible to do that.

To fix this problem, this PR refactors database schema and code that stores and uses compose id to get repository URLs for starting rebuild.

This PR also contains another two fixes that we (Jan and me) talked about, that is

  • code finding dependent events (aka. extra events) needs to be updated (or rewritten) as there is no need to find out images for each dependent event again. I proposed a solution to fix this in this PR.

  • there is a bug that original Event.compose_id is overwritten by new comopse id requested for the same Event as a dependent Event.

1 new commit added

  • Add unique index on Compose.odcs_compose_id

6 new commits added

  • Add unique index on Compose.odcs_compose_id
  • Request boot.iso compose for base image rebuild
  • Remove Event.compose_id
  • Refactor to store compose id to Compose model
  • Add many-2-many relationship between ArtifactBuild and Compose
  • Rewrite finding dependent events

This would make better sense to me: "Find other unreleased Events which built the same builds (or just some of them) as this Event."

Hm, based on the self.add_event_dependency() call in the end of this method, I would also add something like "... and adds them as a dependency for this event."

Can we check here (or maybe better in the add_event_dependency) that we don't add the same dependency multiple times?

This needs with krb_context():

I'm done with some initial review, looks good so far ;). Can you rebase please?

distinct is used in above query. There is no duplicate dependent event id to be added.

rebased onto cc885ea12626403ba57680455336c4aa722b8a1c

@jkaluza fixed issues your comments mentioned, also rebased. Please review again.

1 new commit added

  • Disable to request boot.iso compose

Looks good.

Pull-Request has been merged by jkaluza

Metadata