#1853 fix CGRefundBuild to release build properly
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue1852  into  master

file modified
+2 -1
@@ -5809,7 +5809,7 @@ 

      data['cg_id'] = cg_id

      # CGs shouldn't have to worry about epoch

      data.setdefault('epoch', None)

-     build_id = new_build(data, strict=True)

+     build_id = new_build(data, strict=False)

      # store token

      token = generate_token()

      insert = InsertProcessor(table='build_reservations')
@@ -5855,6 +5855,7 @@ 

      binfo = get_build(build_id, strict=True)

      koji.plugin.run_callbacks('postBuildStateChange', attribute='state',

                                old=koji.BUILD_STATES['BUILDING'], new=state, info=binfo)

+     clear_reservation(build_id)



  def cg_import(metadata, directory, token=None):

CGInitBuild will fail on already existing build (even canceled/failed),
so it can't be used to reuse previously refunded nvr.

CGRefund build doesn't delete reservation. Having reservation token for
build which is no more in BUILDING doesn't make much sense and blocks
and reservation of same NVR.

Fixes: https://pagure.io/koji/issue/1852

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Commit 1865a0c fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

2 years ago