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

Strip build metadata from the software version #98

Merged

Conversation

Lordfirespeed
Copy link
Contributor

Pre-release metadata in the SemVer was previously being stripped, i.e.

0.2.2-alpha.1 -> 0.2.2

But not build metadata. That means that with the following SemVer version (with build, but not pre-release metadata):

0.2.2+adf02906036cfbd946752d58dc620817b135a0ce

tcli tries to parseInt each 'part' of the version, which leads to the following:

Unhandled exception. System.FormatException: The input string '2+adf02906036cfbd946752d58dc620817b135a0ce' was not in a correct format.
   at System.Number.ThrowFormatException[TChar](ReadOnlySpan`1 value)
   at System.Int32.Parse(String s)
   at ThunderstoreCLI.Utils.MiscUtils.<>c.<GetCurrentVersion>b__0_0(String part)
   at System.Linq.Enumerable.SelectArrayIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at ThunderstoreCLI.Utils.MiscUtils.GetCurrentVersion()
   at ThunderstoreCLI.UpdateChecker.CheckForUpdates()
   at ThunderstoreCLI.UpdateChecker.WriteUpdateNotification(Task`1 checkTask)
   at ThunderstoreCLI.Program.Main(String[] args)
Aborted (core dumped)

This PR ensures that build metadata is also stripped before splitting the version into parts.

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c18cd03) 5.47% compared to head (f54eaba) 5.47%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master     #98   +/-   ##
======================================
  Coverage    5.47%   5.47%           
======================================
  Files          42      42           
  Lines        2413    2413           
  Branches      237     237           
======================================
  Hits          132     132           
  Misses       2278    2278           
  Partials        3       3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Lordfirespeed
Copy link
Contributor Author

The tests passed on macos but not Ubuntu ? What?

@Lordfirespeed Lordfirespeed mentioned this pull request Dec 8, 2023
Copy link
Member

@MythicManiac MythicManiac left a comment

Choose a reason for hiding this comment

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

Looks like it got fixed by rerunning

@MythicManiac MythicManiac merged commit 10b73c8 into thunderstore-io:master Dec 10, 2023
6 checks passed
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.

2 participants