Bug 1173542

Summary: [RFE] [API] split transaction to before/after-transaction
Product: [Fedora] Fedora Reporter: Igor Gnatenko <ignatenko>
Component: dnfAssignee: Jaroslav Rohel <jrohel>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: akozumpl, danielkza2, fry.kun, jmracek, jrohel, jzeleny, mluscon, packaging-team-maint, pnemade, tim.lauridsen
Target Milestone: ---Keywords: EasyFix, FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-14 14:46:25 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: 1248806    

Description Igor Gnatenko 2014-12-12 11:53:58 UTC
Now I'm working on writing DNF plugin for snapper (http://snapper.io/)

It will create snapshot before transaction (pre-snapshot) and after finished transaction (post-snapshot).

In this case I can't use resolved() stage for pre-snapshot.

Comment 1 Honza Silhan 2014-12-19 16:38:37 UTC
We can do this. I'd rather collect all request from plugin developers first, then rename some current hooks to make more sense (transaction -> transaction_end, ...) with new ones added. In the meantime you can wastefully save snapshots in `resolved` hook.

Comment 2 Radek Holy 2014-12-19 19:02:27 UTC
FTR, the use case is that the plugin wants to create the snapshot only if it's already clear that the transaction will be performed. I.e. after the user's confirmation.

Comment 3 Radek Holy 2015-02-16 12:52:20 UTC
*** Bug 1192741 has been marked as a duplicate of this bug. ***

Comment 4 Daniel Miranda 2015-09-19 11:55:43 UTC
Any new info/decision about this request? I've recently hit a case with the snapper plugin where I lost files after having to revert to a previous snapshot, because it was from the previous packaging operation some days ago. I had to extract files manually from the snapshots, which is never pleasant.

Having the ability to take snapshots immediately before and after a transaction would be really helpful.

Comment 5 Fedora Admin XMLRPC Client 2016-07-08 09:25:21 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Jaroslav Mracek 2017-04-20 17:25:52 UTC
Please Igor, can you re-evaluate the request. Or can you try to implement it according to your needs? Thanks a lot.

Comment 7 Jaroslav Rohel 2017-05-19 09:50:05 UTC
New pre_transaction hook for plugins in PR https://github.com/rpm-software-management/dnf/pull/818
This hook is called just before the transaction execution.

Comment 8 Jaroslav Mracek 2017-06-14 14:46:25 UTC
The patch was released in dnf-2.5.1-1 into rawhide and Fc26.