#952 Get buildrequired modules for koji tag inheritance using NSVC, not just NSV.
Merged a year ago by mprahl. Opened a year ago by jkaluza.
jkaluza/fm-orchestrator fix-resolver-buildrequires  into  master

@@ -156,9 +156,12 @@ 

  

              buildrequires = xmd_mbs['buildrequires']

              for br_name, details in buildrequires.items():

-                 build = session.query(models.ModuleBuild).filter_by(

-                     name=br_name, stream=details['stream'], version=details['version'],

-                     state=models.BUILD_STATES['ready']).first()

+                 build = models.ModuleBuild.get_build_from_nsvc(

+                     session, br_name, details['stream'], details['version'], details['context'],

+                     state=models.BUILD_STATES['ready'])

+                 if not build:

+                     raise RuntimeError(

+                         'Buildrequired module %s %r does not exist in MBS db' % (br_name, details))

                  module_tags[build.koji_tag] = build.mmd()

  

          return module_tags

@@ -29,7 +29,7 @@ 

      mbs:

        buildrequires:

          parent: {ref: 147dca4ca65aa9a1ac51f71b7e687f9178ffa5df, stream: master,

-           version: '20170816080815'}

+           version: '20170816080815', context: '123'}

        commit: 722fd739fd6cf66faf29f6fb95dd64f60ba3e39a

        rpms:

          ed: {ref: 01bf8330812fea798671925cc537f2f29b0bd216}

@@ -21,11 +21,12 @@ 

    stream: master

    summary: A test module in all its beautiful beauty

    version: 20170816080815

+   context: 123

    xmd:

      mbs:

        buildrequires:

          testmodule: {ref: 147dca4ca65aa9a1ac51f71b7e687f9178ffa5df, stream: master,

-           version: '20170616125652'}

+           version: '20170616125652', context: '321'}

        requires:

          platform: {ref: virtual, stream: f28, version: '3'}

        commit: 722fd739fd6cf66faf29f6fb95dd64f60ba3e39a

@@ -21,6 +21,7 @@ 

    stream: master

    summary: A test module in all its beautiful beauty

    version: 20170816080815

+   context: 321

    xmd:

      mbs:

        buildrequires:

@@ -21,6 +21,7 @@ 

    stream: master

    summary: A test module in all its beautiful beauty

    version: 20170816080816

+   context: 321

    xmd:

      mbs:

        buildrequires:

The buildrequires in xmd sections contains particular NSVC of buildrequired module. MBS ignored the context from that NSVC and instead just took .first() module from MBS db matching the NSV. This is wrong and leads to wrong koji tag inheritance in case of buildrequires with multiple streams built by MSE.

It should fix FACTORY-2600.

Commit 5e12152 fixes this pull-request

Pull-Request has been merged by mprahl

a year ago

Pull-Request has been merged by mprahl

a year ago