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

fix: Remove multiple SemVer incompatibilities in tagFormat #3309

Closed
wants to merge 6 commits into from

Conversation

AndriyGo
Copy link

@AndriyGo AndriyGo commented May 17, 2024

Current implementation is non SemVer compliant in many cases. For example:

This PR addresses this issue by making sure that when analysing tags, and when publishing them, SemVer compliance is mostly followed.

Mostly because there is 1 notable exception – any prefix is allowed preceding the ${version}. So, even though pre-1.1.1 is not strictly SemVer compliant – it is allowed.

I would summarise this PR with the following table:

+-------------+------------------+-------------------+--------------+
|     tag     |    tagFormat     | version (Current) | version (PR) |
+-------------+------------------+-------------------+--------------+
| v1.1.0      | v${version}      | 1.1.0             | 1.1.0        |
| v1.1.0+abcd | v${version}      | -                 | 1.1.0        |
| v1.1.0+(3)  | v${version}      | -                 | -            |
| v1.1.0a+bcd | v${version}      | -                 | -            |
| v1.1.0a     | v${version}      | -                 | -            |
| ----------- | ---------------- | ----------------- | ------------ |
| v1.1.0      | v${version}+abcd | -                 | 1.1.0        |
| v1.1.0+abcd | v${version}+abcd | 1.1.0             | 1.1.0        |
| v1.1.0+(3)  | v${version}+abcd | -                 | -            |
| v1.1.0a+bcd | v${version}+abcd | -                 | -            |
| v1.1.0a     | v${version}+abcd | -                 | -            |
| ----------- | ---------------- | ----------------- | ------------ |
| v1.1.0      | v${version}+(3)  | -                 | error        |
| v1.1.0+abcd | v${version}+(3)  | -                 | error        |
| v1.1.0+(3)  | v${version}+(3)  | 1.1.0             | error        |
| v1.1.0a+bcd | v${version}+(3)  | -                 | error        |
| v1.1.0a     | v${version}+(3)  | -                 | error        |
| ----------- | ---------------- | ----------------- | ------------ |
| v1.1.0      | v${version}a     | -                 | error        |
| v1.1.0+abcd | v${version}a     | -                 | error        |
| v1.1.0+(3)  | v${version}a     | -                 | error        |
| v1.1.0a+bcd | v${version}a     | -                 | error        |
| v1.1.0a     | v${version}a     | 1.1.0             | error        |
+-------------+------------------+-------------------+--------------+

@travi please have a look. Apart from containing build meta – this PR does improve tag processing in various other ways making it more compatible with SemVer

@AndriyGo AndriyGo changed the title fix: Support passing build metadata fix: Multiple SemVer incompatibilities in tagFormat May 18, 2024
@AndriyGo AndriyGo changed the title fix: Multiple SemVer incompatibilities in tagFormat fix: Remove multiple SemVer incompatibilities in tagFormat May 18, 2024
@travi
Copy link
Member

travi commented May 22, 2024

closing as mentioned in #3308 (comment)

@travi travi closed this May 22, 2024
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.

None yet

2 participants