Bug 1411423 - RFE: Add package scriptlet action to dnf.callback.TransactionProgress
Summary: RFE: Add package scriptlet action to dnf.callback.TransactionProgress
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1406130
TreeView+ depends on / blocked
 
Reported: 2017-01-09 16:54 UTC by Martin Kolman
Modified: 2017-04-01 17:22 UTC (History)
5 users (show)

Fixed In Version: dnf-2.2.0-1.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-01 17:22:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1411432 0 medium CLOSED doc: Expected order of actions not documented for dnf.callback.TransactionProgress 2021-02-22 00:41:40 UTC

Internal Links: 1411432

Description Martin Kolman 2017-01-09 16:54:08 UTC
Description of problem:
During a Fedora installation the Anaconda installer runs a DNF transaction that usually contains a couple hundred package and sometimes much more.

In such a case the part of the transaction where DNF runs package scriptlets is quite long, in some cases even longer that the package installation phase. 

But unfortunately unlike the package installation phase there is currently no interface for monitoring the "scriptlet-phase" of the transaction. So for now the the user is stuck with a generic "processing post installation setup tasks" message instead of more informative progress reporting ("configuring package foo (115/558)"). 

This would be also help if the transaction gets stuck on a broken scriptlet - it would be much easier to find which package is at fault.

Anaconda uses the dnf.callback.TransactionProgress class for package installation progress monitoring. The TransactionProgress class defines a number of constants that identify individual actions that might happen during the DNF transaction (PKG_INSTALL, PKG_CLEANUP, PKG_VERIFY, etc.).

It looks like it should be possible to add another a action constants, say PKG_SCRIPTLET or PKG_RUN_SCRIPTLET (or similar) that would be triggered what a scriptlet for a package is started.

This could then be used by Anaconda (and likely also by others) to provide progress reporting for the scriptlet phase of the DNF transaction. 

A couple of things to note:
- this is only about number of scriptlets run/total number of scriptlets to run style progress reporting, not detailed progress reporting for individual scriptlets
- what should be the value of the ti_done & ti_total arguments for the progress() method for a scritplet-running action ?

Comment 1 Honza Silhan 2017-01-16 12:22:42 UTC
we should revert dnf commit which removes RPM callbacks.

Comment 2 Jaroslav Mracek 2017-03-16 14:02:45 UTC
I tried to fulfill your request. Here is pull request: https://github.com/rpm-software-management/dnf/pull/763. Please can you provide a feedback if the patch is exactly what you requested? Thanks a lot

Comment 3 Martin Kolman 2017-03-16 14:51:49 UTC
(In reply to Jaroslav Mracek from comment #2)
> I tried to fulfill your request. Here is pull request:
> https://github.com/rpm-software-management/dnf/pull/763. Please can you
> provide a feedback if the patch is exactly what you requested? Thanks a lot

Thanks a lot! :) I'll check it out and let you know.

Comment 4 Jaroslav Mracek 2017-03-17 13:28:05 UTC
I tried to fulfill your request. Here is pull request: https://github.com/rpm-software-management/dnf/pull/763.

Comment 5 Martin Kolman 2017-03-21 19:09:57 UTC
I've managed to setup a testing environment (had to add python3-gpg & gpgme to the installation environment) and I'm currently testing the patch & checking the API provides what Anaconda needs to correctly report scriptlets being processed.

Comment 6 Martin Kolman 2017-03-21 20:21:00 UTC
Seems fine so far! I've noted my detailed findings in the PR:
https://github.com/rpm-software-management/dnf/pull/763#issuecomment-288205671

Comment 7 Fedora Update System 2017-03-27 19:21:00 UTC
dnf-2.2.0-1.fc26, libdnf-0.8.0-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-65586fa42b

Comment 8 Fedora Update System 2017-04-01 17:22:13 UTC
dnf-2.2.0-1.fc26, libdnf-0.8.0-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.