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: prefer prerelease tags when determining latest #1812

Merged
merged 3 commits into from Feb 18, 2021

Conversation

sumwatshade
Copy link
Collaborator

What Changed

Have the comparator prefer tags with a prerelease branch name within it to make sure the calculated next version is the latest from that branch.

Why

Semver will consider 1.4.0-beta.0 to have higher precedence to 1.4.0-alpha.6 due to how it evaluates the two channels. In this case, we are likely developing against alpha only, and thus want to bump it's version to 1.4.0-alpha.7, but the prerelease will determine the next version to be 1.4.0-alpha.0.

Todo:

  • Add tests
  • Add docs (N/A for bugfix?)

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

@adierkens adierkens added the patch Increment the patch version when merged label Feb 17, 2021

expect(await gh.getTagNotInBaseBranch("alpha")).toBe("1.4.1-alpha.1");

expect(await gh.getTagNotInBaseBranch("beta")).toBe("1.4.1-beta.2");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is 🔥

@hipstersmoothie
Copy link
Collaborator

The cli file is for testing and should be removed from this PR, should probably git ignore it too

Copy link
Collaborator

@hipstersmoothie hipstersmoothie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Just need to investigate what test is failing

@sumwatshade
Copy link
Collaborator Author

@hipstersmoothie I anticipate the issues are due to some logic coming from a forked PR?

@sumwatshade
Copy link
Collaborator Author

Ah got it, just needed to update my fork with latest, should have another push soon

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #1812 (46ea98f) into main (8d90c41) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1812      +/-   ##
==========================================
+ Coverage   80.16%   80.18%   +0.01%     
==========================================
  Files          64       64              
  Lines        4997     5001       +4     
  Branches     1154     1155       +1     
==========================================
+ Hits         4006     4010       +4     
  Misses        672      672              
  Partials      319      319              
Impacted Files Coverage Δ
packages/core/src/git.ts 87.95% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d90c41...46ea98f. Read the comment docs.

@hipstersmoothie hipstersmoothie merged commit 1a26fdd into intuit:main Feb 18, 2021
@adierkens
Copy link
Collaborator

🚀 PR was released in v10.16.6 🚀

@adierkens adierkens added the released This issue/pull request has been released. label Feb 18, 2021
@sumwatshade sumwatshade deleted the fix-prefer-prerelease-tags branch September 16, 2021 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants