GNOME Bugzilla – Bug 774171
Only offers one OS upgrade when multiple are available, always offers the last one in the list regardless of version
Last modified: 2017-10-13 22:21:53 UTC
When multiple possible upgrades are available for the system, Software only offers one. And which one it is isn't decided by any kind of sensible heuristic, but purely based on the order of the list the plugin provides. To reproduce: 1. Install Fedora 23 2. Edit fedora.json and mark Fedora 25 as 'Active' (Fedora 24 should already be Active) 3. Log out and back in to empty caches 4. Run Software and do a refresh on the Updates screen 5. Note that only Fedora 24 is shown 6. Edit fedora.json and move Fedora 25 down so it's under Fedora 24 7. Log out and back in again 8. Refresh Updates again 9. Now see that only Fedora 25 is shown I've poked around in the code and this is my understanding of the behaviour. gs-shell-updates.c `gs_shell_updates_load` asks (via several intermediate plugin loader steps) the plugin for the result of `gs_plugin_add_distro_upgrades` (which is a `gs_app_list` of 'gs_app' instances, each representing a single available OS release), then it feeds that list to `gs_shell_updates_get_upgrades_cb`, which just takes the first entry from the list and feeds that into the 'upgrade_banner' bits, which are all set up to assume precisely *one* upgrade banner. So we know that it's definitely only ever going to offer one upgrade. That seems fairly clear. As for the ordering, well...as mentioned, the list of available upgrades is a `gs_app_list`. `gs_plugin_add_distro_upgrades` from the Fedora just takes the list of releases from the fedora.json file - which itself is a download of https://admin.fedoraproject.org/pkgdb/api/collections/ - and iterates over the 'collections' (releases) in that file, adding each one that meets its conditions to the list by calling `gs_app_list_add`. The order of the entries in fedora.json is basically random - they're grouped by status, but within the status groups the order is not sensible, e.g. 26 comes before 25 and the recent stable releases go 20, 19, 23, 22, 21, 24. So we can't rely on that list being in a sensible order. Now I'm no C expert, but as best as I can tell, a `gs_app_list` is just a structure which provides both an array and a hash of pointers to the same bunch of 'app' objects; the hash keys are the app ids. But we're not even using the hash, here, just the array. When you call `gs_app_list_add` it just stuffs the pointer onto the end of the array. `gs_shell_updates_get_upgrades_cb` just asks for `gs_app_list_index (list, 0)`, which is the first item in the array. So I'm pretty sure we just wind up taking whichever is the first release listed in fedora.json that meets all of the requirements of `gs_plugin_add_distro_upgrades`. There is a fun postscript here, which is that the GNOME 3.20 behaviour - which is important, here, because 3.20 is what's in Fedora 23, and we're about to release Fedora 25 - is almost the same, only backwards. The 'app list' stuff was rejigged somewhere between 3.20 and 3.22. In 3.20, the list is just a GList, and gs-app-list.c doesn't exist. When adding the 'app' for a release to the list, `gs_plugin_add_distro_upgrades` calls `gs_plugin_add_app` (from `gs-plugin.c`), which does this: *list = g_list_prepend (*list, g_object_ref (app)); so it stuffs the entry onto the *start* of the list, not the end, as 3.22 does with its array. So that means that in 3.20 (and hence Fedora 23), Software will offer the *LAST* release listed in fedora.json that meets all of the requirements of `gs_plugin_add_distro_upgrades`, rather than the *first*. Either way, the upshot of this is that right now we have literally no way of knowing whether, when Fedora 25 is released, Software will offer Fedora 23 users an upgrade to 24 or 25. It simply depends on where Fedora 25 happens to show up in the 'collections' list in https://admin.fedoraproject.org/pkgdb/api/collections/ . If it shows up *after* Fedora 24 in that list, Software will start showing Fedora 25 as the available upgrade for Fedora 23 users. If it shows up *before* Fedora 24, Software will keep offering Fedora 24 as the available upgrade. The interesting question here is, what is our *intended* behaviour? Clearly depending on the order of a list whose order is random is silly, but given that we'll change the behaviour, what do we change it to? Do we want to offer multiple upgrades when multiple higher non-EOL releases are available? If we only offer one, do we always offer the latest release available? Or do we always offer N+1?
For bonus points, think about this feature being added to RHEL. When RHEL 12 comes out, what upgrades should RHEL 8 installs be showing? ;)
Thanks, should be fixed in https://git.gnome.org/browse/gnome-software/commit/?id=79e0e64c8985860def644225c92d80200cd9aef9 and https://git.gnome.org/browse/gnome-software/commit/?id=29c31add4c8f5a54d8689e39740a08071af30b29
Thanks for that. The EOL case is really a tricky one. Offering upgrades to a later EOL release is probably a valid approach, though I worry about them remaining available (very few Fedora mirrors carry the 'archive' bundle, and some of those that do kinda mess it up). I think it might be a good idea to include a warning if the only upgrade possible is to an EOL release, explicitly stating that both the release the user is upgrading from and the release they're upgrading to are EOL, and this is very much a best-effort situation and it may not end well. I'd guess other distributions would also consider that to be appropriate.
BTW, since F23 is still under maintenance for another month and F24 and F25 will both have this problem when F26 and F27 (respectively) become available, can we think about patching those downstream packages to do what we want, rather than only fixing upstream? Fixing upstream means the fix will make it to F26 and later and *may* make it to F25, I guess, but it may not, and very likely won't make it to F24.
Ah, you're way ahead of me - I didn't check the downstream bug! Sorry. I assume F24 and F25 updates are coming too.
(In reply to Adam Williamson from comment #3) > Thanks for that. > > The EOL case is really a tricky one. Offering upgrades to a later EOL > release is probably a valid approach, though I worry about them remaining > available (very few Fedora mirrors carry the 'archive' bundle, and some of > those that do kinda mess it up). I talked to Peter Robinson and he said that mirrormanager redirects EOL releases to archive mirrors and that upgrading to EOL releases should just work and rpms should all be downloadable. I guess it's the only sane things to do here since we can't really test upgrading to anything newer than F25 before F23 goes EOL. > I think it might be a good idea to include > a warning if the only upgrade possible is to an EOL release, explicitly > stating that both the release the user is upgrading from and the release > they're upgrading to are EOL, and this is very much a best-effort situation > and it may not end well. I'd guess other distributions would also consider > that to be appropriate. Yep, that might be a good idea. Do you have any suggestions for wording here?
(In reply to Adam Williamson from comment #5) > Ah, you're way ahead of me - I didn't check the downstream bug! Sorry. I > assume F24 and F25 updates are coming too. Yes, there's already https://bodhi.fedoraproject.org/updates/FEDORA-2016-a5c4b0bbcc for F24 and the F25 update is coming when we cut a new gnome-software release upstream. I just haven't been able to edit the F24 update and link to the bugzilla ticket since it's been locked for the ongoing push for a few days now.
"I talked to Peter Robinson and he said that mirrormanager redirects EOL releases to archive mirrors and that upgrading to EOL releases should just work and rpms should all be downloadable." In *theory* this is true. In practice, as I said, only a couple of mirrors carry the archive stuff and I've seen it go wonky sometimes, it's just slightly less reliable than current releases. Just another reason to have a warning. Wording, maybe something like: "Warning! The release you're upgrading from [and the release you're upgrading to] [is/are] no longer supported. This type of upgrade is less commonly tested and more likely to have some problems. Before trying to upgrade, we highly recommend you back up any important data this system contains in such a way that you will be able to access it even if a problem with the upgrade makes it impossible to use the system normally. For more information on [distribution]'s support policies, please see [distribution-link]. Something like that?
https://bugzilla.redhat.com/show_bug.cgi?id=1494061 is a report of this seemingly not working correctly for F25 -> F27 (Software offers only F26, not F27, even with the gsettings boolean for showing development versions flipped).