#4528 CGImport() and CGInitBuild() take ‘start_time’ as different types
Opened by evilcica. Modified

When reserving a build with CGInitBuild() (cg_init_build()), the start_time of the data parameter is not transformed and data is passed to new_build() as is.

https://pagure.io/koji/blob/5f0ee908d1fa4fe34f67aec435ccd8eedcf8bcf5/f/kojihub/kojihub.py#_6900

This leads to the start_time field being expected to be an ISO datetime string. However, when calling cg_import() later, it ends up being expected to be a float timestamp which is converted to a string automatically in prep_build().

https://pagure.io/koji/blob/5f0ee908d1fa4fe34f67aec435ccd8eedcf8bcf5/f/kojihub/kojihub.py#_7195

This inconsistency means the same buildinfo dict that was used initially for reserving the build cannot be used again for doing the import as-is which makes the process more complex than it needs to be for content generators.

I'm unsure if any existing content generators account for this behaviour or rely on it, but if that is not a concern, this can be fixed by also taking start_time as a float timestamp in cg_init_build() and converting it there, and I can provide a PR for this.


Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.37

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/4528

Please continue any further discussion there.

Metadata