Skip to content

Fix version count #5922

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix version count #5922

wants to merge 5 commits into from

Conversation

nworr
Copy link
Contributor

@nworr nworr commented Jul 7, 2025

add VersionTools:intVersionToHumanString method to convert int version to human readable string
example : 030506 means 3.5.6,

keep the intVersionToSortableString to allow sortable string ( "03.10.XX" > "03.09.YY" but 3.10 < 3.9), so update js to convert "sortable" string to a human string

Ticket : #5855

Funded by 3Liz

* Transform "101" into "1.1"
* Transform "0590" into "5.90"
* Transform "250208 into 25.2.8
* Transform "031400 into 3.14
Copy link
Member

Choose a reason for hiding this comment

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

I think indeed for humanLizmapTargetVersion, it makes sense to strip the patch number, because it's a about a "branch" number (and there will be never a patch number into this string).

But for lizmapDesktopRecommended or any other "precise version" (not talking about a branch), it would make sense to always have the patch number, even if .0.
Maybe adding a flag "strip patch number" ?

Copy link
Member

Choose a reason for hiding this comment

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

Or similar to the other function within this file dropBuildId, having dropPatchNumber ? (which obviously drops the build id). Just an idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I add an optionnal stripPatch boolean argument (default false)

Also, fixed blocking version : (3.8 - 0.1 = 3.7 but 3.15 - 0.1 = 3.05) so i use int version - 100

Copy link
Member

Choose a reason for hiding this comment

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

Good catch !

@nworr nworr force-pushed the fix-version-count branch from e3dbffe to 6c22493 Compare July 9, 2025 09:48
Copy link
Member

@Gustry Gustry left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for cleaning these versions logic !

@@ -90,4 +90,27 @@ public static function qgisVersionWithNameToInt(string $versionString): int

return intval(intval($version[0]) * 10000 + intval($version[1]) * 100 + intval($version[2]));
}

/**
* Transform int formatted version to a human readable string (remove useless 0),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Transform int formatted version to a human readable string (remove useless 0),
* Transform int formatted version to a human readable string (remove useless 0 if needed),

* Transform "101" into "1.1"
* Transform "0590" into "5.90"
* Transform "250208 into 25.2.8
* Transform "031400 into 3.14
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Transform "031400 into 3.14
* Transform "031400 into 3.14 if stripPatch is True
* Transform "031400 into 3.14.0 if stripPatch is False

nworr and others added 2 commits July 9, 2025 12:40
Code comment for previous version calculation

Co-authored-by: Étienne Trimaille <gustrimaille@yahoo.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants