Bug 387041 - "Reason" and "Change Log" are identical
Summary: "Reason" and "Change Log" are identical
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
Depends on:
Reported: 2017-11-17 16:28 UTC by Nate Graham
Modified: 2018-01-14 20:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.12.0
Sentry Crash Report:

"Reason:" and "Change Log" are nearly identical (232.87 KB, image/png)
2017-11-17 16:28 UTC, Nate Graham
Arch (128.59 KB, image/png)
2017-11-19 23:11 UTC, Aleix Pol

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2017-11-17 16:28:40 UTC
Created attachment 108922 [details]
"Reason:" and "Change Log" are nearly identical

[Discover from git master on KDE Neon]

See attached screenshot. In KDE Neon, with Ubuntu packaging, the Reason and Change Log fields both get populated, but are identical save for a few formatting differences. We probably don't need both in this case, but I'm not sure how we would go about detecting this in a sane and accurate manner.
Comment 1 Aleix Pol 2017-11-19 23:11:20 UTC
Created attachment 108971 [details]

This text is provided by the distribution, there's not much we can do from Discover besides hiding either.

This is what it looks like on ArchLinux.
Comment 2 Nate Graham 2017-11-19 23:18:36 UTC
Hmm, so this is probably Ubuntu or Debian's fault, then.
Comment 3 Nate Graham 2017-11-19 23:36:29 UTC
Is anybody using Debian and able to confirm whether this is true for Debian packages, too? Or is it just Ubuntu packaging?
Comment 4 Nate Graham 2017-12-11 05:29:27 UTC
I spoke to an Ubuntu developer who said that their .deb packages don't include a "Reason" field, so this must be coming from PackageKit. Digging a bit, it seems that PackageKit is synthesizing the Reason and Updates fields from the original Change Log field, but not dropping the now-duplicate Change Log field. I've filed https://github.com/hughsie/PackageKit/issues/227

I'm not going to close this yet since that bug may wind up as a WONTFIX, in which case sadly our only option is to explicitly suppress the Change Log field when the PackageKit backend is using .deb packages.
Comment 5 Aleix Pol 2017-12-11 13:24:08 UTC
Indeed, it seems like we should modify the information we show. Nate, since you looked into it, any good ideas? :)
Comment 6 Nate Graham 2017-12-11 15:15:57 UTC
I'll keep trying to make our case upstream, but if that's a dead end then it looks like we may have no choice but to add some custom logic to suppress either Change Log or else Reason and Updates for Debian-based systems. My very minor preference would be to keep Reason and Updates since the data is a bit better structured there (which is probably why PackageKit creates them).
Comment 7 Nate Graham 2017-12-12 00:14:10 UTC
Conclusion upstream is that we'll need to do this ourselves. I'll try to put something together.
Comment 8 Nate Graham 2018-01-14 05:51:12 UTC
I've submitted a patch based on advice and comments from PackageKit developers. Basically, the ChangeLog field is the raw data used to synthesize the Updates and UpdateText fields. So if we show those, we don't need to also show the text in the ChangeLog field.


...At least, this is true in Debian-based distros. It would be great to get some testing in a few non-Debian-based distros to make sure it doesn't regress anything for anybody.
Comment 9 Nate Graham 2018-01-14 20:25:22 UTC
Git commit fad964d9a0b92fbcf51d5fcbfc4de52d55b86437 by Nathaniel Graham.
Committed on 14/01/2018 at 20:25.
Pushed by ngraham into branch 'master'.

Remove redundant changeLog field

FIXED-IN: 5.12.0

For Debian packages, PackageKit manufactures the `updateText` and `updates` fields from the package's changelog. PackageKit gives us the `updateText` and `updates` fields, but also includes the original text used to synthesize them in a field called `changeLog`.

So we should only display `updateText` and `updates`, since `changeLog` is just the the raw information used to synthesize them, and if we show it too, there's duplicate information.

For more information about this, see https://github.com/hughsie/PackageKit/issues/227

Test Plan:
**This change needs testing from people who are not using Debian-based distros to make sure it didn't break anything for them!**

I tested in KDE Neon, a Debian-based distro. Before:


Other entries still show up and are not affected.

Reviewers: apol, #discover_software_store

Reviewed By: apol, #discover_software_store

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9850

M  +0    -1    libdiscover/backends/PackageKitBackend/PackageKitResource.cpp