#498 Generate rebuilt_nvr just before submitting an image build
Merged by cqi. Opened by cqi.
cqi/freshmaker generate-rebuilt_nvr-release-when-build  into  master

Download 498.patch

This change ensures the timestamp inside the release part of a
rebuilt_nvr just reflects when the image build is submitted.

Resolves: FACTORY-5949

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

rebased onto 281cb66c5a99e6b1ed55725f2f2cf471d192cb2b

rebased onto daa83deab2831798dcc9146a0ebcbef5b49d5064

Ping for review

Why are you removing this? Is it because it gets done in the __init__.py?

What about the few lines above?

516         if not build.rebuilt_nvr and build.original_nvr:                                            
517             build.rebuilt_nvr = get_rebuilt_nvr(                                                    
518                 build.type, build.original_nvr)                                                     
519                                                                                                     
520         if not build.rebuilt_nvr:                                                                   
521             build.transition(                                                                       
522                 ArtifactBuildState.FAILED.value,                                                    
523                 "Container image does not have rebuilt_nvr set.")                                   
524             return   
525                                                                                                     
526         release = parse_NVR(build.rebuilt_nvr)["release"]

Should we just move this whole chunk down to just before self.build_container is called?

rebased onto f9291c345869a9be8c300a8197c895d2656246f6

rebased onto 1a0340b8688a7e3ca9f297b0a2b67a72da1cde3b

Why are you removing this? Is it because it gets done in the init.py?

Yes.

@lucarval Updated. PTAL.

Looks good to me +1
but wait for @lucarval final review before merging.

Nice catch!

For debugging purposes, it would be nice if both of these log messages were combined.

Committing the DB changes makes sense, but I wonder why it wasn't done before. Any ideas?

Left some optional comments, but I don't see any functional issues. :thumbsup:

My understand is, this function is called by start_to_build_images where db.session.commit is called, and if ODCSComposeNotReady is raised, the event handler ensures db.session.commit is called eventually

rebased onto 97d57a9db975b58b43113e15d29e35de6c1a3f0b

Thanks for the review. The CI job passes. I'll merge this PR.

Commit e0643d84 fixes this pull-request

Pull-Request has been merged by cqi

Pull-Request has been merged by cqi

Metadata