Skip to content
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

improvements to the inference of the version from the tag #616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jinxidoru
Copy link

The current implementation of cpm_get_version_from_git_tag() has some odd behavior in scenarios that do not perfectly match the expected v#.#.# format. This change attempts to better clarify and slightly expand the functionality. The motivating event for this change was when I attempted to bring in avro, which uses a tag format that looks like this: "release-1.12.0". The current implementation was not properly parsing out the 1.12.0 version.

This change creates two scenarios. In the first, we check for the appearance of "v" followed by a number anywhere in the tag. If that is encountered, then we treat that number and any number or dot following it as the version number. This could be made more restrictive by requiring that a dot also appear, though this limitation does not exist in the current version and could break current situations. This case is meant to mimic the current approach.

The second case is less restrictive and simply looks for numbers followed by a dot and more numbers anywhere in the string. This will handle any case where the version number appears mid string. I think the current regex was meant to handle this scenario, but it was not actually working correctly.

Let me know what your thoughts are. I'm happy to walk through some of the issues I was encountering as I diagnosed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant