-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix mike
version sorting
#171
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
For the same major and minor, pre-releases were sorted as newer than stable releases, but this is not correct. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
There are 2 main reasons for this: 1. Parsing the mike versions is less future proof, as if more fields are added to the JSON in the future, we'll remove them from the output, making the sorting more bug prone and more costly to maintain. 2. Avoiding the extra wrapping in `sort_mike_versions()` makes it easier to test, as otherwise we need to do the extra wrapping in tests, wrapping that is really not related to sorting so it adds noise to the tests. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
We are going to add more wrapped test cases, so it is better to use a more explicit name. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
github-actions
bot
added
the
part:tests
Affects the unit, integration and performance (benchmarks) tests
label
Nov 3, 2023
llucax
added
type:bug
Something isn't working
part:ci
Affects the GitHub workflow and other parts for running CI
part:mkdocs
Affects the configuration of mkdocs
part:tooling
Affects the development tooling (CI, deployment, dependency management, etc.)
labels
Nov 3, 2023
matthias-wende-frequenz
approved these changes
Nov 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
part:ci
Affects the GitHub workflow and other parts for running CI
part:mkdocs
Affects the configuration of mkdocs
part:tests
Affects the unit, integration and performance (benchmarks) tests
part:tooling
Affects the development tooling (CI, deployment, dependency management, etc.)
type:bug
Something isn't working
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the same major and minor, pre-releases were sorted as newer than stable releases, but this is not correct. This PR fixes that.
It also makes the sorting of the
versions.json
file more robust, as it doesn't parse and re-serialize the version object, but instead only uses theversion
field for sorting, and the rest of the fields are dumping verbatim without any rewriting.This means that if new versions of
mike
add more fields to the JSON, we won't need to update the sorting code, as it will just work.