Use class method 'sort' to get last_version_for_major
What does this MR do and why?
Describe in detail what your merge request does and why.
Content
Fix ReleaseTools::Versions.last_version_for_major
- Revert !4124 (merged)
- Sort returned versions from version.gitlab.com by
Gem::Versionto make sure the latest version is always on top - Actualize the VCR file
versions/list.ymlto include the actual situation when the first version in the list is not the latest one
Ref: gitlab-com/gl-infra/delivery#21073 (closed)
Test
Before
The wrong last version is returned
[1] pry(main)> ReleaseTools::Versions.last_version_for_major(17)
=> "17.9.7"
After
The right last version is returned
[5] pry(main)> ReleaseTools::Versions.last_version_for_major(17)
=> "17.11.1"
[6] pry(main)> ReleaseTools::Versions.last_version_for_major(18)
=> nil
Edited by Dat Tang