Bug 1066867

Summary: [RFE] [api] Support package changelog.
Product: [Fedora] Fedora Reporter: Tim Lauridsen <tim.lauridsen>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: rawhideCC: adam, allanlewis99, as.kmr.sinh+redhat, awilliam, baptiste.millemathias, brovvnout+rh, cbm, dmach, evan, goeran, iamdexpl, johannespfrang, jzeleny, matteo, mblaha, mkolman, mvanderw, mvanross, ngompa13, prd-fedora, projects.rg, redhat-bugzilla, redhat, rocketraman, samuel-rhbugs, txn2tahx3v, woiling, zing
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.0.9-1.fc29 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-05 02:33:50 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: 850912    
Bug Blocks: 1631942, 1665453, 1066869, 1214060, 1235551, 1378430, 1483458    

Description Tim Lauridsen 2014-02-19 09:25:47 UTC
Description of problem:
In a package manager gui like yumex, it is useful to be be able to show 
the changelog for available packages.
yum support that, but dnf dont yet


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

How reproducible:
every time

Steps to Reproduce:
1. po = a python package object
2. print(po.changelog)
3.

Actual results:
fails

Expected results:
show package changelog

Additional info:

Comment 1 Ales Kozumplik 2014-02-19 10:25:00 UTC
Valid thing, we'll see what we can do.

Comment 2 Igor Gnatenko 2015-01-25 16:55:42 UTC
reassigning to rawhide, because it's feature and we don't want to forget about it when F20 will be EOLed

Comment 3 Radek Holy 2015-03-04 17:07:51 UTC
So, it turned out that changelogs are stored in metadata that are not downloaded by DNF by default. And we probably don't want to change this because they have few megabytes and DNF doesn't need them (so far). So, I hate to say it but we are not going to implement this feature in the foreseeable future unless it turns out that DNF needs the data.

So, take it as postponed for now. I'm afraid that it means that you have to download and parse the XML by yourself in the meantime if you need changelogs.

FTR, when the time of the implementation comes... We are thinking about adding a parameter to `Base.fill_sack` and an attribute to `Cli.demands` to let it download the data on demand. However there might be a problem once DNF downloads the metadata, what should happen in the next run. Should it remove the data because they might be old? Or how it will affect the mechanism of determining the age of the cache. And also, if the changelog will be available through a dnf.Package attribute, what should happen if the data are not available.

Comment 4 Adam Goode 2015-03-04 17:11:43 UTC
Is there a way to split out the changelogs in the metadata? Best would be to only download the relevant changes (from version X -> Y) rather than all changes.

Comment 5 Radek Holy 2015-03-04 17:25:09 UTC
I'm not aware of such thing. They are stored in a single XML file (see e.g. the *-other.xml.gz file in http://download.fedoraproject.org/pub/fedora/linux/releases/21/Everything/x86_64/os/repodata). After the change in bug 850896, the situation may be better but I'm afraid that still there might be people that would complain about downloading unnecessary data.

Comment 6 Mark van Rossum 2015-04-30 12:45:23 UTC
> I'm afraid that still there might be people that would complain about >downloading unnecessary data.

That is rather overcautious.
If changelog were an option, as it was in yum, such complaints would not arise.

Comment 7 Tim Lauridsen 2015-05-01 06:26:18 UTC
other metadata was not download by default in yum, it was optional, It would be nice if an API user could request it.

dnf cli should not download it by default, but API and plugin should be able to request it to be downloaded

Comment 8 Adam Williamson 2015-05-12 00:51:03 UTC
This also manifests as a missing feature (vs. yum) in repoquery. I use 'repoquery --changelog (package)' quite often; 'dnf repoquery --changelog (package)' does not work.

Comment 9 Radek Holy 2015-05-12 07:31:39 UTC
Adam, could you please file a bug if you miss the feature? I believe that it can be implemented also without any support in DNF (as mentioned above) since it seems that librepo is able to download the file and createrepo_c is able to parse it.

Comment 10 Tim Lauridsen 2015-05-12 07:59:48 UTC
(In reply to Radek Holy from comment #9)
> Adam, could you please file a bug if you miss the feature? I believe that it
> can be implemented also without any support in DNF (as mentioned above)
> since it seems that librepo is able to download the file and createrepo_c is
> able to parse it.

Sounds a little strange if a dnf plugin like repoquery, should use librepo directly to download a metadata file and parse it.
I would be much more nice, if there was a more highlevel api in dnf or hawkey to enable it and get them by pkg.changelog like you can with yum.

Comment 11 Honza Silhan 2015-07-20 09:36:06 UTC
we should implement this along with bug 968006 once hawkey is integrated with librepo in libhif

Comment 13 Neal Gompa 2015-12-31 19:15:20 UTC
hawkey has been merged into libhif now, so is this something that can be implemented now?

Comment 14 Honza Silhan 2016-01-19 15:01:24 UTC
*** Bug 1299173 has been marked as a duplicate of this bug. ***

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

Comment 16 Christian Kujau 2018-01-10 10:26:32 UTC
Any update on this one? Just today's run of "dnf update" presented me with:

 [...]
 Upgrade  51 Packages
 Total download size: 183 M
 Is this ok [y/N]: y

How can I decide if it would be "OK" to continue w/o having read through the changelogs? Yes, there's the package-announce list, but searching for 51 package update emails on the list archive can be very time consuming. Having dnf to display the changelogs would be much better.

Something like yum-plugin-changelog[0] would do, but I like the apt-listchanges[1] solution even better:


===================================
  # apt-get dist-upgrade
  The following packages will be upgraded:
    hdparm (9.51+ds-1 => 9.53+ds-1)
    [...]
  26 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  Need to get 36.5 MB of archives.
  After this operation, 37.9 kB of additional disk space will be used.
  Do you want to continue? [Y/n] y
  
  [...downloading packages, and changelogs, and $PAGER opens...]
   
  apt-listchanges: Changelogs
  ---------------------------
  --- Changes for hdparm ---
  hdparm (9.53+ds-1) unstable; urgency=medium
  
   * New upstream version 9.53+ds
   * Update d/watch, version 4, use substitutions for package,
     version and extensions
   * Add -R option to d/hdparm-functions and hdparm.conf, Closes: #722426
   [...]
   
   [...press q to exit the pager...]
   apt-listchanges: Do you want to continue? [Y/n]
===================================


Please? :-)


[0] http://yum.baseurl.org/gitweb?p=yum-utils.git;a=tree;f=plugins/changelog
[1] https://tracker.debian.org/pkg/apt-listchanges

Comment 18 Fedora Update System 2018-11-22 18:57:11 UTC
libdnf-0.22.3-1.fc29 dnf-4.0.9-1.fc29 dnf-plugins-core-4.0.2-1.fc29 dnf-plugins-extras-4.0.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-17cbc3c616

Comment 19 Fedora Update System 2018-11-23 02:56:44 UTC
dnf-4.0.9-1.fc29, dnf-plugins-core-4.0.2-1.fc29, dnf-plugins-extras-4.0.0-1.fc29, libdnf-0.22.3-1.fc29 has been pushed to the Fedora 29 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-2018-17cbc3c616

Comment 20 Fedora Update System 2018-12-05 02:33:50 UTC
dnf-4.0.9-1.fc29, dnf-plugins-core-4.0.2-1.fc29, dnf-plugins-extras-4.0.0-1.fc29, libdnf-0.22.3-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.