Skip to content

Addons: always sort versions in descending order #11691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Oct 16, 2024

We were mixing ascending and descending when listing the versions, we now always sort in descending order. Even if the version fails to parse, we still sort it in descending order as fallback.

Closes #11689

We were mixing ascending and descending when listing the versions,
we now always sort in descending order. Even if the version
fails to parse, we still sort it in descending order as fallback.

Closes #11689
@stsewd stsewd requested a review from a team as a code owner October 16, 2024 17:29
@stsewd stsewd requested a review from humitos October 16, 2024 17:29
Comment on lines -43 to +44
"1.1",
"1.1.0",
"1.1",
Copy link
Member Author

@stsewd stsewd Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 1.1 and 1.1.0 are the same version, it falls back to sort them alphabetically in descending order now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a code comment :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, all tests are like this now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of comments that are incorrect after this change: Invalid versions are at the end sorted alphabetically.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are still sorted alphabetically, but in descending order.

@stsewd stsewd requested a review from ericholscher October 17, 2024 22:23
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@stsewd stsewd merged commit 9451d9c into main Oct 21, 2024
8 checks passed
@stsewd stsewd deleted the addons-consistent-ordering branch October 21, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addons: allow choosing ascending or descending order when listing versions
3 participants