Story #3919

Updated by ttereshc almost 3 years ago

If an erratum is released for a modular content, it will contain information about module the RPMs are relevant to.
Information about a module is added to a collection in a pkglist.
Each collection corresponds to one module or to non-modular content.
There can be multiple collections in one pkglist (this is just for information, no changes here, it's this way now).
The module element is *optional*. Absense of the module element means that the collection is for normal non-modular RPMs and should be proccesed as usual.

Example of the modular errata content can be found in updateinfo.xml in the fixtures repo:

Here is the snippet of the new format:
<collection short="">
<module name="kangaroo" stream="0" version="20180730223407" context="deadbeef" arch="noarch"/>
<package arch="noarch" name="kangaroo" release="1" src="" version="0.3">
<package ... >
<collection short="">

For upload, JSON is usually used, so the format will be:
"issued": "2015-03-05 05:42:53 UTC",
"pkglist": [{
"name": "coll_name1",
"module": {
"name": "duck",
"stream": "0",
"version": "20180730233102",
"context": "deadbeef",
"arch": "noarch"
"packages": [{
"arch": "noarch",
"filename": "duck-0.7-1.noarch.rpm",
"name": "duck",
"release": "1",
"sum": ["sha256", "ceb0f0bb58be244393cc565e8ee5ef0ad36884d8ba8eec74542ff47d299a34c1"],
"version": "0.7",
}, {
"name": "coll_name2",


h2. Deliverables

* *Sync* should recognize module element in the erratum and save it on the model

* no changes to the model itself are needed (aka migration is not needed) due to changes in the nested structure, inside a pkglist.

* *Publish* should respect the module element and publish info about the module in the errata if this info is available

* see the fixture repo
* publish should continue filtering by rpms available in the repo
* if no rpms are found for/associated with an erratum but module information is specified, such erratum has to be published. It's possible that just module metadata changed and no rpms has been updated.
* make sure collection names are unique per erratum (Pulp takes care of that and regenerates collection names to make them unique)

* *Upload* should support the module element

* see the JSON format in the description above

* *Copy*

* simple copy is expected to just work
* copy with --recursive flag should respect the module info in the erratum

* a whole module should be copied in this case: *all* its RPMs, module itself, and relevant module_defaults(?)

* *Search* API

* probably no changes needed, it should just work

Out of scope: *Applicability* (it will be implemented as a separate story).