metanorma / metanorma-docker

Docker container for running the Metanorma toolchain
https://www.metanorma.com
5 stars 3 forks source link

Docker tag version must respect semver.org spec #151

Closed CAMOBAP closed 2 years ago

CAMOBAP commented 2 years ago

Intro

docker/metadata-action step force us to use semver.org. If we pass version which doesn't conform to semver.org spec if will 'silently fail' like this:

Warning: v1.5.15pre1 is not a valid semver. More info: https://semver.org/
Warning: v1.5.15pre1 is not a valid semver. More info: https://semver.org/
Warning: v1.5.15pre1 is not a valid semver. More info: https://semver.org/
Warning: No Docker image version has been generated. Check tags input.
Warning: No Docker tag has been generated. Check tags input.

Proposed solution

A script which will be used for such conversion was added to metanorma-build-scripts collection https://github.com/metanorma/metanorma-build-scripts/blob/main/gemver-to-semver.rb

For now it supports chocolatey and semver flags

Other possible solutions

ronaldtse commented 2 years ago

Thank you @CAMOBAP for the investigation, let’s migrate to a semver format.

On the semver site it says:

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. … Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z.–.

So we can use “alpha” or “pre” too.

FYI @opoudjis

ronaldtse commented 2 years ago

@CAMOBAP I'm totally fine with this. I believe @opoudjis will also update gem versioning for prerelease versions in a format consistent with semver, in https://github.com/metanorma/metanorma-cli/issues/276.

@opoudjis says that encoding 1.1.1-alpha in gemspec turns version into 1.1.1.pre.alpha in gem version, it is being transformed into "pre".

opoudjis commented 2 years ago

@CAMOBAP @ronaldtse Note: I cannot keep up with notifications. If you need me to know of something and action it within the month, paste the ticket to Skype, or put it on the Metanorma board under Urgent or Triage.

CAMOBAP commented 2 years ago

@ronaldtse @opoudjis thanks for the feedback

Anyway, I propose to merge this PR just in case to properly handle/convert the version, how do you think?

ronaldtse commented 2 years ago

Please merge. Thanks!