Bug 1762262

Summary: [RFE] DNF transaction with strict=False should report skipped packages
Product: [Fedora] Fedora Reporter: Jiri Konecny <jkonecny>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: edgar.hoch, jmracek, jrohel, mblaha, mhatina, mkolman, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
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: 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:

Description Jiri Konecny 2019-10-16 10:54:32 UTC
Description of problem:
When you disable strict option in DNF it will skip all the packages with a conflict, that is desired behavior. However, from my understanding there is no information about what packages were skipped. This information should be available for further debugging of the transaction.

Justification:
Anaconda wants to add a possibility for kickstart automated installation to skip conflicting packages automatically. For this we have to disable the strict option. However, it's impossible to debug problematic behavior of the resulting system when there is no information of what packages were skipped because of the strict option.

Version-Release number of selected component (if applicable):
dnf-4.2.11-2.fc32

How reproducible:
Always

Actual results:
No log messages when packages are skipped because of disabled strict option.

Expected results:
Information about what packages were skipped with ideally a reason why there were skipped.

Comment 1 Edgar Hoch 2019-10-18 12:49:30 UTC
I think it would be a good idea to show (or log, in case of pykickstart) which packages are skipped and why, even with strict disabled. I often missed this information when using dnf.

Comment 2 Jaroslav Mracek 2023-08-23 09:31:08 UTC
DNF code base allows to re-run the transaction with strict rules - 

We use internally following code:

```
    def _skipped_packages(self, report_problems, transaction):
        """returns set of conflicting packages and set of packages with broken dependency that would
        be additionally installed when --best and --allowerasing"""
        if self._goal.actions & (hawkey.INSTALL | hawkey.UPGRADE | hawkey.UPGRADE_ALL):
            best = True
        else:
            best = False
        ng = deepcopy(self._goal)
        params = {"allow_uninstall": self._allow_erasing,
                  "force_best": best,
                  "ignore_weak": True}
        ret = ng.run(**params)
        if not ret and report_problems:
            msg = dnf.util._format_resolve_problems(ng.problem_rules())
            logger.warning(msg)
```

In DNF5 event-logges should provide the message by default.