@@ -263,10 +263,10 @@ def build_from_commit(self, task_state):
263263 self .logger .info ('Found %s builds from commit %s' , count , commit )
264264 builds = response_data ["results" ]
265265 build_for_image = {}
266- for image_name , build_id , dg_name in [(b ["build_0_name" ], int (b ["build_0_id" ]), b ["dg_name" ]) for b in builds ]:
266+ for image_name , build_id , dg_name , image_nvr in [(b ["build_0_name" ], int (b ["build_0_id" ]), b ["dg_name" ], b [ "build_0_nvr " ]) for b in builds ]:
267267 # checks which image to exclude from payload
268- if self .is_image_for_release (dg_name ) and (image_name not in build_for_image or build_id < build_for_image .get (image_name , float ('inf' ))):
269- build_for_image [image_name ] = build_id
268+ if self .is_image_for_release (dg_name ) and (image_name not in build_for_image or build_id < build_for_image .get (image_name , float ('inf' ))[ 0 ] ):
269+ build_for_image [image_name ] = [ build_id , image_nvr ]
270270 return build_for_image .values ()
271271 self .logger .info ('Found no builds from commit %s' , commit )
272272
@@ -280,15 +280,9 @@ def find_builds(self):
280280 if successful_builds :
281281 self .logger .info (f'*** successful_builds: { successful_builds } ***' )
282282 self .logger .info ("Found successful builds for given PR" )
283- nvr = None
284283 for build in successful_builds :
285- try :
286- nvr = util .get_build_nvr (build )
287- except BrewNVRNotFound as e :
288- self .logger .error (f"Could not find NVR from build: { e } " )
289- self .so .say (f"Could not find NVR from buildid { build } " )
290284 self .so .say (
291- f"First successful build: <{ BREW_URL } /buildinfo?buildID={ build } |{ nvr } >. All consecutive builds will include this PR." )
285+ f"First successful build: <{ BREW_URL } /buildinfo?buildID={ build [ 0 ] } |{ build [ 1 ] } >. All consecutive builds will include this PR." )
292286 return
293287
294288 self .logger .info ("No successful builds found given PR" )
@@ -297,7 +291,7 @@ def find_builds(self):
297291 for build in failed_builds :
298292 self .logger .info (f"First failed build: { build } " )
299293 self .so .say (
300- f"No successful build found. First failed build: <{ BREW_URL } /buildinfo?buildID={ build } |{ build } >" )
294+ f"No successful build found. First failed build: <{ BREW_URL } /buildinfo?buildID={ build [ 0 ] } |{ build [ 1 ] } >" )
301295 return
302296
303297 self .logger .info ("No builds have run yet." )
0 commit comments