#10154 'Fedora Linux' breaks gnome-software
Closed: Fixed 2 years ago by jbley. Opened 2 years ago by mcrha.

I've been sent here from https://pagure.io/fedora-workstation/issue/237.

The https://admin.fedoraproject.org/pkgdb/api/collections/ returns versions like Fedora, but the rawhide (f35+) will use Fedora Linux. This can break the gnome-software, which reads, on rawhide, Fedora Linux.

I file this just as a confirmation that the https://admin.fedoraproject.org/pkgdb/api/collections/ will reflect this Fedora~>Fedora Linux change, though the f33 and f34 will not know about f35 if the collections will return Fedora Linux for it. In other words, the change is not backward compatible.

Or should the gnome-software read the OS name from elsewhere?


We can easily change our end to "Fedora Linux" for f35 and f36. That should solve the issue, right?

@adamwill oh look, changing names of things again. ;) Is this going to affect openqa/fedfind/etc?

The gnome-software in f33/f34 matches against Fedora. The gnome-software in rawhide matches against Fedora Linux.

@otaylor already asked me on IRC, it looks like those two will need two records, one for the old Fedora, one for the new - kind of transition period.

NAME and PRETTY_NAME are not meant to be used for decision-making, only display. You should be checking for ID=fedora in /etc/os-release.

Metadata Update from @mohanboddu:
- Issue tagged with: medium-gain, medium-trouble, ops

2 years ago

Metadata Update from @mohanboddu:
- Issue priority set to: Waiting on Assignee (was: Needs Review)

2 years ago

NAME and PRETTY_NAME are not meant to be used for decision-making, only display. You should be checking for ID=fedora in /etc/os-release.

Possibly, but https://admin.fedoraproject.org/pkgdb/api/collections/ doesn't have an ID, it has only name and it is Fedora at the moment (capital F).

Honestly this is a silly problem. Let's just change /etc/os-release back to how it was before....

It's a bit late to change it back now.

Would adding 'ID=Fedora' for rawhide/f35 fix this? then you can use that moving forward, and f34 and eariler can just key on Name like they have been?

It's a bit late to change it back now.

Would adding 'ID=Fedora' for rawhide/f35 fix this? then you can use that moving forward, and f34 and eariler can just key on Name like they have been?

os-release(5):

       ID=
           A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_" and "-") identifying the operating system, excluding any version information and suitable for processing by scripts
           or usage in generated filenames. If not set, defaults to "ID=linux". Example: "ID=fedora" or "ID=debian".

The value of ID= in /etc/os-release has to be lower-case. Can GNOME Software just do a case-insensitive comparison? Or as a short-term hack, take the ID value and just capitalize the first letter?

I guess I'm not sure what GNOME Software is trying to do here. Is it reading NAME= and then initiating a query against the pkgdb API with that as a parameter?

Would adding 'ID=Fedora' for rawhide/f35 fix this?

Adding it where? If you mean to the https://admin.fedoraproject.org/pkgdb/api/collections/, then it won't help the older software without being patched (to read the value from a different key).

The value of ID= in /etc/os-release has to be lower-case. Can GNOME Software just do a case-insensitive comparison? Or as a short-term hack, take the ID value and just capitalize the first letter?

I'm afraid you do not understand the problem.
1. the https://admin.fedoraproject.org/pkgdb/api/collections/ provides only NAME
2. hence the GNOME Software compares with the NAME
3. Rawhide/f35 changes the NAME to Fedora Linux, which doesn't match the NAME in the f34/f33, which is Fedora

I may patch f33/f34 gnome-software with added upgrade banner image (to match the f35 default background image) some time soon, thus I can add a patch for this too (once the https://admin.fedoraproject.org/pkgdb/api/collections/ is updated, if it's going to be updated), but that will be only a cosmetic thing, the background is not needed to offer the upgrade, thus the users without updating gnome-software won't get offered the upgrade.

ok, so how about we keep the "name": "Fedora" entries, and add duplicate "name": "Fedora Linux" ones?
Then, the new versions work and the old versions work. After f34 goes end of life, we drop the Fedora ones and only keep the Fedora Linux ones moving forward?

Or did I miss something here?

How does json-glib decouple the duplicates? The gnome-software uses name = json_object_get_string_member (collection, "name"); . Does the first win, or the second, or unpredictable one?

I'd like to keep the old code working without changes, but if the new collection will be to use "id" : "fedora" together with (current) "name": "Fedora Linux", then it will work for me, though with required patching on the gnome-software side in all versions.

I'm going to add the f35 background image to the gnome-software in f34 and f33. To make things easier, I'll patch the Fedora packages to recognize also the "Fedora Linux" name from the collections/. That way you can keep untouched the collections/ for now.

It still makes sense to add the "id": "fedora" into the collections/ and patch the gnome-software upstream to know about it. Hence I keep this open until it's done.

Hmm, when did the collections/ change? I did not notice it here.

It currently claims "name": "Fedora" for f35 and rawhide... That's good only partially, for the old Fedoras, the f35+ will not notice the upgrades, because Fedora Linux (on f35) != Fedora (in the collections/). It's fine as long as f35+ is patched somehow (possibly to use the id either primarily or as a fallback).

In any case, I've updates almost ready for f33 and f34, as mentioned at the beginning of my previous comment.

@mchua Whats the status here now? Waiting for this to land upstream still?

I guess the nick is a typo and you meant me.

I do not think there is anything to land upstream, it's not upstream's problem.

I do not have a Fedora 35 yet, I've only an up-to-date (as of now) rawhide machine, which says:
cat /etc/os-release | grep NAME ---> NAME="Fedora Linux". The f33 and f34 return NAME=Fedora.

The https://admin.fedoraproject.org/pkgdb/api/collections/ returns for f35 and f36 name: "Fedora". There is no id returned by this page.

Thus the situation is still the same. The two names should match, but they do not since the move to Fedora Linux.

I can summarize/repeat the options:

  • patch gnome-software downstream to know of Fedora Linux on the f33 and f34 - requires users to update the package to know about the change
  • patch the collections page to duplicate the entries for the transition period, to claim f35 as Fedora and f36 as Fedora and Fedora Linux, then f37+ can be Fedora Linux only - that will work without any change on the users' machines
  • patch the collections to provide also id and then patch also gnome-software to use that instead of the OS name - requires patching everywhere, but can be change-proof in the future

My opinion: I do not like option 1; option 2 is better for users; option 3 can be done for f35+ only, no need to bother f33/f34 users, but requires changes on both sides.

I guess the nick is a typo and you meant me.

Yeah, sorry about that. ;(

...snip...

  • patch gnome-software downstream to know of Fedora Linux on the f33 and f34 - requires users to update the package to know about the change
  • patch the collections page to duplicate the entries for the transition period, to claim f35 as Fedora and f36 as Fedora and Fedora Linux, then f37+ can be Fedora Linux only - that will work without any change on the users' machines
  • patch the collections to provide also id and then patch also gnome-software to use that instead of the OS name - requires patching everywhere, but can be change-proof in the future

My opinion: I do not like option 1; option 2 is better for users; option 3 can be done for f35+ only, no need to bother f33/f34 users, but requires changes on both sides.

I guess option 2 seems the way to go for me. However, this change (Fedora to Fedora Linux) is a f35 change, so we will need to duplicate it also I think.

Here's a PR:
https://pagure.io/fedora-infra/ansible/pull-request/813
that I think will do this.

this change (Fedora to Fedora Linux) is a f35 change, so we will need to duplicate it also I think.

It depends what will be change. I though of that in the current state context, which means there is noFedora Linux in the collections, thus

  • f33 says Fedora, can upgrade to f34 and f35 - both currently identify as Fedora
  • f34 says Fedora, can upgrade to f35 and f36 - both currently identify as Fedora
  • f35 says Fedora Linux, can upgrade to f36 and f37 - need to add duplicate for f36 with Fedora Linuxand start to name f37 as Fedora Linux
  • f36 says Fedora Linux, can upgrade to f37 and f38 - both will be Fedora Linux

On the other hand, if the main "source" in the collections should match the /etc/os-release NAME, then the f35 should be as Fedora Linux and have a duplicate with Fedora.

ok. @sgallagh acked that PR and I pushed it. I think that's all we have to do here?

(The playbook to deploy is running, but will be a while, once thats done you can check the file if you like)

Please reopen if I missed anything.

Metadata Update from @kevin:
- Issue close_status updated to: Duplicate
- Issue status updated to: Closed (was: Open)

2 years ago

Metadata Update from @kevin:
- Issue status updated to: Open (was: Closed)

2 years ago

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Issue status updated to: Open (was: Closed)

2 years ago

Metadata Update from @jbley:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata
Boards 1
ops Status: Backlog