Bug 1582546

Summary: [modularity] Updating a module does not install dependent module's default stream
Product: [Fedora] Fedora Reporter: Rafael Fonseca <rdossant>
Component: dnfAssignee: rpm-software-management
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dmach, jmracek, mblaha, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1582548 (view as bug list) Environment:
Last Closed: 2018-11-22 18:12:49 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:    
Bug Blocks: 1478068, 1582548    

Description Rafael Fonseca 2018-05-25 14:21:35 UTC
Description of problem: Let's say we have ModuleA:f26:1 installed into the system. There is an updated version of ModuleA (ModuleA:f26:2) which now depends on ModuleB. When updating ModuleA, dnf does not install ModuleB.


Version-Release number of selected component (if applicable): 2.7.5-14


How reproducible: always


Steps to Reproduce:
1. Given module definitions:
        ---
        data:
          name: ModuleA
          stream: f26
          version: 1
          summary: Module ModuleA summary
          description: Module ModuleA description
          license:
            module: [MIT]
          profiles:
            default:
              rpms: [TestA]
          artifacts:
            rpms: ["TestA-0:1-1.modA.noarch"]
          components:
            rpms:
              TestA: {rationale: 'rationale for TestA'}
        document: modulemd
        version: 2
        ---
        data:
          name: ModuleA
          stream: f26
          version: 2
          summary: Module ModuleA summary
          description: Module ModuleA description
          license:
            module: [MIT]
          dependencies:
            - requires:
                ModuleB: []
          profiles:
            default:
              rpms: [TestA]
          artifacts:
            rpms: ["TestA-0:2-1.modA.noarch"]
          components:
            rpms:
              TestA: {rationale: 'rationale for TestA'}
        document: modulemd
        version: 2
        ---
        data:
          name: ModuleB
          stream: f26
          version: 1
          summary: Module ModuleB summary
          description: Module ModuleB description
          license:
            module: [MIT]
          profiles:
            minimal:
              rpms: [TestB]
          artifacts:
            rpms: ["TestB-0:1-1.modB.noarch"]
          components:
            rpms:
              TestB: {rationale: 'rationale for TestB'}
        document: modulemd
        version: 2

2. And a file "/etc/dnf/modules.defaults.d/ModuleB.yaml" with
        """
        document: modulemd-defaults
        version: 1
        data:
          module: ModuleB
          stream: f26
          profiles:
            f26: [minimal]
        """
3. Install ModuleA:f26:1
4. Update ModuleA

Actual results: ModuleB is not installed


Expected results: ModuleB's default stream ('minimal') is installed


Additional info:
      Captured stdout:
      shell.command: ['dnf-3', 'module', 'install', 'ModuleA:f26:1', '-y']
      shell.command.stdout:
      Last metadata expiration check: 0:00:00 ago on Fri May 25 14:18:52 2018.
      Dependencies resolved.
      ================================================================================
       Package        Arch            Version             Repository             Size
      ================================================================================
      Installing module packages:
       TestA          noarch          1-1.modA            modularityAB          6.4 k
      
      Transaction Summary
      ================================================================================
      
      Total size: 6.4 k
      Installed size: 0  
      Downloading Packages:
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Installing       : TestA-1-1.modA.noarch                                  1/1 
        Verifying        : TestA-1-1.modA.noarch                                  1/1 
      
      Complete!
      
      shell.command.stderr:
      
      shell.command: ['dnf-3', 'module', 'update', 'ModuleA', '-y']
      shell.command.stdout:
      Last metadata expiration check: 0:00:01 ago on Fri May 25 14:18:52 2018.
      Dependencies resolved.
      ================================================================================
       Package        Arch            Version             Repository             Size
      ================================================================================
      Upgrading:
       TestA          noarch          2-1.modA            modularityAB          6.4 k
      Installing dependencies:
       TestC          noarch          1-1                 modularityAB          6.3 k
      
      Transaction Summary
      ================================================================================
      Install  1 Package
      Upgrade  1 Package
      
      Total size: 13 k
      Downloading Packages:
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Installing       : TestC-1-1.noarch                                       1/3 
        Upgrading        : TestA-2-1.modA.noarch                                  2/3 
        Cleanup          : TestA-1-1.modA.noarch                                  3/3 
        Verifying        : TestC-1-1.noarch                                       1/3 
        Verifying        : TestA-2-1.modA.noarch                                  2/3 
        Verifying        : TestA-1-1.modA.noarch                                  3/3 
      
      Installed:
        TestC.noarch 1-1                                                              
      
      Upgraded:
        TestA.noarch 2-1.modA                                                         
      
      Complete!

Notice that running "dnf module install ModuleB" works as expected and install the default stream.

Comment 1 Karel Srot 2018-05-25 14:33:52 UTC
I am not sure this is a bug. AFAIK for dependencies the modules are just enabled and rpm package relations are used for complete the requires. This doesn't mean any real profiles is being installed for the required module.

Comment 2 Rafael Fonseca 2018-05-25 14:47:33 UTC
I see. But ModuleB is not even being enabled.

Comment 3 Karel Srot 2018-05-28 07:11:33 UTC
@QE: this scenario is covered by module-update-2.feature in the ci-dnf-stack test suite. Once this bug is resolved, please update/remove this scenario according to the expected functionality.

Comment 4 Martin Hatina 2018-05-28 11:44:18 UTC
Yes, ModuleB's default stream should be enabled.

Comment 6 Jan Kurik 2018-08-14 11:13:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.