-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use valid Semver versions for pre-releases #5636
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fixes that I only noticed when reviewing the github diff.
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://8768-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-708%2Bgd736e4d-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8768?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://8764-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-708%2Bgd736e4daa-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8764?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://8767-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-708%2Bgd736e4daa-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8767?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/8gt4j9xoccjp3pt8/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35259741"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/vqnhpx5dl0620nrx/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35259741"}]}, "commit_sha": "888e87d1112a4f296a161b8e1599b1d4e1a4553c"} |
It seems like it can't compare some non-standard version we use properly, for example, |
I think we should change the formatting of those versions to be either
I think we can write an upgrade routine for older versions in the constructor. If the first three identifiers are "1.2.2" or less, we convert As for which of the two options to choose, it'd be great if we could have different versions on master and stable. Assuming the latest release is
|
I agree with Spekular. We should start sticking to semver, and we can write a preroutine to capture older formats and convert to what it should be in semver. |
Did some testing of the new CMake versioning logic:
Is there anything else to test? Otherwise this seems ready to merge as far as I can tell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only reviewed the C++ here - I'll leave the CMake to someone more familiar with it.
Probably out of scope here, but I'll mention it since you're rewriting the comparison logic: I don't really like part of the current comparison system, where a |
@DomClark Great review, thanks! I'll make sure to extend the tests as well when I fix this. (Note to self: every unresolved conversation is an actionable TODO)
Agreed on both counts. |
- Set CompareType's underlying type to int and revert change to ProjectVersion::compare's parameters - Add "None" and "All" as names elements of CompareType enum - Preserve hyphens in prerelease identifiers - Pad invalid (too short) versions to prevent crashes or nasty behavior - Compare numeric identifiers to non-numeric ones correctly - Don't interpret identifiers of form "-#" as numeric (where '#' is any number of digits) - Add tests to ensure fixes in this commit work and won't regress in the future
All outstanding comments should be fixed in the latest commit. @DomClark I'll request re-review from you to see if you approve of the fixes. |
|
Whoops, I used that online tool wrong. My points are still valid, but irrelevant as the example I chose passes the online tool. |
Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ looks good to me. I like the attention given to tests.
There a couple of places I've pointed out that make unnecessary copies - this isn't much of a problem with Qt containers, since their data is shared and refcounted behind the scenes, but is something to bear in mind, and would have more of an impact with standard library containers. If you consider this premature optimisation, feel free to ignore it - it's just as functional as it is.
Testing again with changes that I haven't pushed yet, everything seems to behave the same even if I remove the changes outside of VersionInfo.cmake.
|
Merge? |
I haven't tested it locally, but all of my concerns were addressed, so 👍 from me. |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes suggested by @PhysSong
* Fix ProjectVersion handling of pre-releases * Add workaround for old, non-standard version * Attempt to fix versioning * More consistent comments * Apply suggestions from code review - Set CompareType's underlying type to int and revert change to ProjectVersion::compare's parameters - Add "None" and "All" as names elements of CompareType enum - Preserve hyphens in prerelease identifiers - Pad invalid (too short) versions to prevent crashes or nasty behavior - Compare numeric identifiers to non-numeric ones correctly - Don't interpret identifiers of form "-#" as numeric (where '#' is any number of digits) - Add tests to ensure fixes in this commit work and won't regress in the future * CMAKE fixes from code review Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com> * Remove unnecessary changes to CMake logic * More const, more reference * Apply suggestions from code review Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
Reworks the way optional identifiers are handled to be more in line with Semver spec, adds a few new tests.
Our current versioning of
MAJOR.MINOR.PATCH.COMMITS
for builds from source is not a valid semantic version. I've added a workaround for versions up to 1.2.2.x to avoid breaking older comparisons, that converts them to 1.2.3-x. This is intentionally disabled for later versions as don't believe we should continue to use this versioning.In order for everything to work, this PR (or another PR merged first) needs to update the versioning used for builds.
x.y.z
withc
extra commits must be versionedx.y.z+1-c
1.2.2.42
becomes1.2.3-42
1.2.0-rc1
should have been1.2.0-rc.1
, which could then have commits appended,1.2.0-rc.1.42
For reference (source):
1.2.2-42 < 1.2.2 < 1.2.3-42 < 1.2.3-rc < 1.2.3-rc.9 < 1.2.3-rc.42 < 1.2.3