Bug 1755148

Summary: libmodulemd defaults can be clobbered by third-party repos such as EPEL
Product: Red Hat Enterprise Linux 8 Reporter: Stephen Gallagher <sgallagh>
Component: libmodulemdAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: high    
Version: 8.0CC: sgallagh
Target Milestone: rc   
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:57:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1752511    
Bug Blocks:    

Description Stephen Gallagher 2019-09-24 21:16:48 UTC
Description of problem:
A third-party repository such as EPEL that wants to add a supplementary module stream to a module that is shipped by RHEL and enable a default profile for that stream will cause the defaults shipped by RHEL to be discarded.

Version-Release number of selected component (if applicable):
libmodulemd-2.5.0-2.el8

How reproducible:
Every time


Steps to Reproduce:
1. Pick a module shipped in RHEL 8 AppStream (e.g. "nodejs").
2. Create and build a new stream for that module (e.g "13").
3. Create a repository for the newly-built module with createrepo_c.
4. Produce a defaults document and append it to the repodata produced by the module build:

```
document: modulemd-defaults
data:
  module: nodejs
  modified: 201909240000
  profiles:
    11: [ "default" ]
```

(Make sure "modified" is a higher value than the one currently shipping in the RHEL AppStream repository.)


Actual results:
When the repository metadata from AppStream is merged with the additional repository, the defaults data from AppStream is lost, replaced by the one from the additional repository (or the reverse, if AppStream has a newer 'modified' value than the repo).


Expected results:
Non-conflicting profile defaults should be merged together. Conflicting profile defaults and default streams will be taken from the defaults document with the higher 'modified' value.

Additional info:
This bug exists in both the 1.x and 2.x APIs of libmodulemd.

Comment 1 Stephen Gallagher 2019-11-05 20:57:51 UTC

*** This bug has been marked as a duplicate of bug 1761805 ***