voxpupuli / puppetboard

Web frontend for PuppetDB
https://pypi.org/project/puppetboard/
Apache License 2.0
708 stars 238 forks source link

Sorting of the kernelrelease fact could be better #731

Open gdubicki opened 1 year ago

gdubicki commented 1 year ago

The values of kernelrelease fact for my Centos 7 nodes sorted in descending order are now sorted as alphanumeric strings, so for example like this:

3.10.0-957.5.1.el7.x86_64
3.10.0-862.14.4.el7.x86_64
3.10.0-693.21.1.el7.x86_64
3.10.0-1160.76.1.el7.x86_64
3.10.0-1127.19.1.el7.x86_64
3.10.0-1062.9.1.el7.x86_64
3.10.0-1062.18.1.el7.x86_64
3.10.0-1062.1.2.el7.x86_64

...while I would expect them interpreted as package versions and shown from latest to oldest so like this:

3.10.0-1127.19.1.el7.x86_64
3.10.0-1160.76.1.el7.x86_64
3.10.0-1062.18.1.el7.x86_64
3.10.0-1062.9.1.el7.x86_64
3.10.0-1062.1.2.el7.x86_64
3.10.0-957.5.1.el7.x86_64
3.10.0-862.14.4.el7.x86_64
3.10.0-693.21.1.el7.x86_64
ArthurWuTW commented 2 months ago

I was first wondering if natural sort would solve this issue, so I gave it a try and screenshots show as follows: image image

I also do some refactorings: