Skip to content

Use semver package for semantic version comparison and precedence checking#425

Merged
jcreedcmu merged 3 commits intogithub:masterfrom
henrymercer:fix-semver-comparison
Jun 1, 2020
Merged

Use semver package for semantic version comparison and precedence checking#425
jcreedcmu merged 3 commits intogithub:masterfrom
henrymercer:fix-semver-comparison

Conversation

@henrymercer
Copy link
Copy Markdown
Contributor

This PR refactors the CLI distribution manager to use the semver package. This:

  • fixes an issue with precedence checking where versions with prereleases were not compared correctly with versions without prereleases (CLI version sorting potentially wrong #424)
  • simplifies defining what versions of the CLI are compatible with the extension
  • removes code implementing semver parsing and precedence checking

Other points to note:

  • Semantic versions are parsed using semver.parse rather than semver.coerce since semver.coerce strips build metadata.
  • Semantic versions are formatted using version.raw since this includes build metadata.
  • Release creation dates are now compared using the en-US locale to remove potential locale dependence of version comparison.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • @github/product-docs-dsp has been cc'd in all issues for UI or other user-facing changes made by this pull request.

Fixes #424

@jcreedcmu jcreedcmu closed this Jun 1, 2020
@jcreedcmu jcreedcmu reopened this Jun 1, 2020
@jcreedcmu jcreedcmu merged commit d924e9f into github:master Jun 1, 2020
@henrymercer henrymercer deleted the fix-semver-comparison branch June 1, 2020 20:02
@henrymercer henrymercer restored the fix-semver-comparison branch June 1, 2020 20:11
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.

CLI version sorting potentially wrong

2 participants