Story #3982

Updated by ttereshc almost 5 years ago

h3. Motivation 

 * Currently there is no way Need an api to copy modules with all their retrieve the    module artifacts without bringing in all dependencies. 
 * Internally Pulp parses modulemd artifact names (specified in metadata) and looks for each RPM by NEVRA every time it needs to know which RPM units belong to a module. rpm associations. 

 The modulemd fetch content units call returns a list like this   
     {"default"=>["python2-django"], "python2_development"=>["python2-django"]}, 
    "summary"=>"A high-level Python Web framework", 
     "Django is a high-level Python Web framework that encourages rapid development and a clean, pragmatic design. It focuses on automating as much as possible and adhering to the DRY (Don't Repeat Yourself) principle."}, 



 What katello would like with respect to the the publish operation is a rpm uuid/unit it mapping for each of these rpms. This will aid katello in accounting for rpms that got copied over and hence make the determination on the modules to copy over. 

 h2. Suggested API change 

 Artifacts field can't be modified due to semver reasons. 
 Add a new field to the output of a module: 

    "pulp_artifacts_map"=> "artifacts"=> 
     [{"filename": "python-django-bash-completion-",  
        "unit_id": <uuid>}, [{name: "python-django-bash-completion-0:", rpm_uuid:<uuid>}, 
       "unit_id": <uuid>}] {name:"python2-django-0:", rpm_uuid:<uuid>}], 

 @filename@ should correspond to the filename in Pulp and can/will be different from the one mentioned in the @artifacts@ field. 
 @unit_id@ is a UUID of an RPM related to the module of interest. 
 Note: at the moment only RPMs can be present in the artifacts, so it's not necessary to have @type@ for each entry of the @pulp_artifacts_map@. At any point later it can be added if needed, since it's an additive change. 

 h3. Suggested solution