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: make v character in version tags optional #423

Merged
merged 4 commits into from
Aug 4, 2022

Conversation

webbertakken
Copy link
Member

@webbertakken webbertakken commented Aug 2, 2022

Changes

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

@github-actions
Copy link

github-actions bot commented Aug 2, 2022

Cat Gif

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2022

Codecov Report

Merging #423 (68d97d4) into main (c068855) will increase coverage by 0.16%.
The diff coverage is 100.00%.

❗ Current head 68d97d4 differs from pull request most recent head 0fa866c. Consider uploading reports for the commit 0fa866c to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #423      +/-   ##
==========================================
+ Coverage   52.36%   52.52%   +0.16%     
==========================================
  Files          65       66       +1     
  Lines        2049     2056       +7     
  Branches      353      353              
==========================================
+ Hits         1073     1080       +7     
  Misses        972      972              
  Partials        4        4              
Impacted Files Coverage Δ
src/model/__data__/versions.ts 100.00% <100.00%> (ø)
src/model/versioning.ts 94.06% <100.00%> (+0.10%) ⬆️

@abigailwillow
Copy link

I have tested this and while it did correctly identify the existing tag, it did not auto-increment the patch version.

@webbertakken
Copy link
Member Author

I have tested this and while it did correctly identify the existing tag, it did not auto-increment the patch version.

It looks like it's actually using your 0.1.0 tag

image

Please try to create a tag that's higher, like v0.2 or 0.2 to rule out flakiness.

@abigailwillow
Copy link

abigailwillow commented Aug 3, 2022

Please try to create a tag that's higher, like v0.2 or 0.2 to rule out flakiness.

You're right, the previously generated 0.1.0 tag was messing with the versioning. However this does make me worry whether this would happen again if the versioning generated a new version with a patch number of 0.

@abigailwillow
Copy link

Nevermind! I've verified that versioning also works after generating a tag with patch number 0. I'm not sure why it worked for the 0.2.0 tag that it generated but not for the 0.1.0 tag that it previously generated. But it does work!

@abigailwillow
Copy link

Little update; I've worked out why it worked for 0.2.0 but not for 0.1.0.

My manually assigned 0.1 tag was on a commit that was made earlier than the generated 0.1.0 tag. When I assigned 0.2 the 0.2.0 tag was also assigned to that same commit.

This may be an issue when the system generates a tag with patch number 0 that is not on the same commit as the commit with the manually assigned tag, however I am not sure if that is possible in the first place.

@webbertakken
Copy link
Member Author

We're working on a best effort basis here. Edge cases that may never even happen can always be covered in next interactions.

Based on your findings it looks like we should be good with this change.

I will add tests when I have time to make sure this doesn't accidentally break.

@webbertakken
Copy link
Member Author

Added tests for the regex. The tests are actually running grep to make sure it works using grep -E. These tests work on Windows (local) and Ubuntu (GitHub workflow). Accepted values as tags that are usable for our automated versioning strategy (when versioning: Semantic which is the default if versioning parameter is not set as well).

Accepted values are partial tags and any completely valid semantic version tag, as well as all variants prepended with a v.

image
image

Not accepting some weirder cases out of the incorrect semantic versions list, even if they are prepended with a v.

image

@webbertakken webbertakken merged commit db2d8b6 into main Aug 4, 2022
@webbertakken webbertakken deleted the fix-versioning-bug branch August 4, 2022 00:09
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.

4 participants