#1103 Force the epoch on SRPM artifacts in the modulemd files uploaded to the CG build
Merged 7 months ago by mprahl. Opened 7 months ago by mprahl.

@@ -263,6 +263,12 @@ 

          # Temporary dict with build_id as a key to find builds easily.

          builds = {build['build_id']: build for build in builds}

  

+         # Create a mapping of build IDs to SRPM NEVRAs so that the for loop below can directly

+         # access these values when adding the `srpm_nevra` key to the returned RPMs

+         build_id_to_srpm_nevra = {

+             srpm["build_id"]: kobo.rpmlib.make_nvra(srpm, force_epoch=True)

+             for srpm in src_rpms.values()

+         }

          # Handle the multicall result. For each build associated with the source RPM,

          # store the exclusivearch and excludearch lists. For each RPM, store the 'license' and

          # also other useful data from the Build associated with the RPM.

@@ -274,7 +280,7 @@ 

  

              rpm["license"] = headers["license"]

              rpm['srpm_name'] = build['name']

-             rpm['srpm_nevra'] = build['nvr']

+             rpm['srpm_nevra'] = build_id_to_srpm_nevra[rpm["build_id"]]

              rpm['exclusivearch'] = build['exclusivearch']

              rpm['excludearch'] = build['excludearch']

  

@@ -342,6 +342,7 @@ 

              {

                  'id': 1,

                  'arch': 'src',

+                 'epoch': None,

                  'build_id': 875991,

                  'name': 'module-build-macros',

                  'release': '1.module_92011fe6',

@@ -350,6 +351,7 @@ 

              {

                  'id': 2,

                  'arch': 'noarch',

+                 'epoch': None,

                  'build_id': 875991,

                  'name': 'module-build-macros',

                  'release': '1.module_92011fe6',

@@ -358,6 +360,7 @@ 

              {

                  'id': 3,

                  'arch': 'src',

+                 'epoch': 3,

                  'build_id': 875636,

                  'name': 'ed',

                  'release': '2.module_bd6e0eb1',

@@ -366,6 +369,7 @@ 

              {

                  'id': 4,

                  'arch': 'x86_64',

+                 'epoch': 3,

                  'build_id': 875636,

                  'name': 'ed',

                  'release': '2.module_bd6e0eb1',

@@ -376,6 +380,7 @@ 

          builds = [

              {

                  'build_id': 875636,

+                 'epoch': 3,

                  'name': 'ed',

                  'release': '2.module_bd6e0eb1',

                  'version': '1.14.1',

@@ -383,6 +388,7 @@ 

              },

              {

                  'build_id': 875991,

+                 'epoch': None,

                  'name': 'module-build-macros',

                  'release': '1.module_92011fe6',

                  'version': '0.1',

@@ -403,9 +409,11 @@ 

          for rpm in rpms:

              # We want to mainly check the excludearch and exclusivearch code.

              if rpm["name"] == "module-build-macros":

+                 assert rpm["srpm_nevra"] == "module-build-macros-0:0.1-1.module_92011fe6.src"

                  assert rpm["excludearch"] == ["x86_64"]

                  assert rpm["license"] == "MIT"

              else:

+                 assert rpm["srpm_nevra"] == "ed-3:1.14.1-2.module_bd6e0eb1.src"

                  assert rpm["exclusivearch"] == ["x86_64"]

                  assert rpm["license"] == "GPL"

  

no initial comment

rebased onto 6f505927efc081b1faee74390d4d3a287f03b82c

7 months ago

rebased onto c3a4b2b

7 months ago

Commit 78bb367 fixes this pull-request

Pull-Request has been merged by mprahl

7 months ago

Pull-Request has been merged by mprahl

7 months ago