Feature proposal #8516
openChange version structure
Description
Currently build releases cannot be version checked by Joomla. This is because Joomla uses version_compare which cannot handle +build metadata. This prevents CB from moving away from its own plugin installer since we need to version check build releases.
One option is to change the version structure to a 4 digit structure as follows.
MAJOR.MINOR.PATCH.BUILD
So for example the following would be a build release.
3.0.0.1
While this will work it doesn't adhere to semver 2.0 and could cause potential issues later. Typically build metadata is done as follows.
MAJOR.MINOR.PATCH-BUILD
But this doesn't work for us since we want the build to have precedence over MAJOR.MINOR.PATCH and -BUILD behavior doesn't have precedence over stable. We're currently using the following.
MAJOR.MINOR.PATCH+build.BUILD
This doesn't work with version_compare at all since version_compare is not metadata aware. Typically you'd use the following if you want build precedence.
Current Stable: 1.0.0
Next Stable: 2.0.0
Build: 2.0.0-1
This doesn't work for us either since we'd need to know what the next stable is going to be and it might not be 2.0.0 and could be 2.0.1, etc.. Needs further testing and consideration as we need something version_compare compatible and something GIT taggable. With MAJOR.MINOR.PATCH-BUILD being the correct usage need to figure out how we want to best handle this.
Updated by krileon over 3 years ago
The below should be fine.
Current Stable: 1.0.0
Next Lowest Release: 1.0.1
Build: 1.0.1-1
This would mean next stable could be 1.0.1 or anything greater than that. This will allow 1.0.1-1 to have precedence over 1.0.0 in version comparisons. Probably need a text identifier in it though so the below should be compatible.
1.0.1-build.1
Updated by krileon over 3 years ago
version_compare has the precedence we need with the following.
Current Stable: 1.0.0
Build: 1.0.0-1
It does NOT if you add a prefixed type. Example as follows.
Build: 1.0.0-build.1
So using the MAJOR.MINOR.PATCH-BUILD structure will work for version comparison as it'll treat the -BUILD with precedence over MAJOR.MINOR.PATCH. Note +BUILD also works (e.g. 1.0.0+1), but the semver states dash should be used here.
Updated by beat almost 2 years ago
- Target version changed from CB 2.8 to CB 2.8.1
Updated by beat about 1 year ago
- Target version changed from CB 2.8.1 to CB 2.8.2
Updated by beat about 1 year ago
- Target version changed from CB 2.8.2 to CB 2.9.0
Updated by beat about 1 year ago
- Target version changed from CB 2.9.0 to CB 2.9.2