#512 Make resolve_commit not set published property
Merged 4 years ago by cqi. Opened 4 years ago by cqi.
cqi/freshmaker remove-side-effect  into  master

file modified
-1
@@ -203,7 +203,6 @@ 

              "error": None,

              "arches": None,

              "odcs_compose_ids": None,

-             "published": None,

              "parent_image_builds": None,

          }

  

A ContainerImage published property is resolved and set by
resolve_published. Therefore, if resolve_commit sets the published
property, there will be a side-effect when resolve_commit is called
again against an already resolved image, that is published property is
reset to None.

Whatever a ContainerImage is published or not, resolve_published will
always set the property. So, just simply remove published from
return value of _get_default_additional_data().

Resolves: FACTORY-6028

Signed-off-by: Chenxiong Qi cqi@redhat.com

:thumbsup: I like this approach because if a piece of the code is accessing the published property before resolve_published has been called, for whatever reason, then an exception will be raised, instead of silently assuming the image in not published.

Commit 4c7e4d8 fixes this pull-request

Pull-Request has been merged by cqi

4 years ago

Pull-Request has been merged by cqi

4 years ago