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: Update semver logic #4459

Merged
merged 1 commit into from Aug 19, 2022
Merged

fix: Update semver logic #4459

merged 1 commit into from Aug 19, 2022

Conversation

kschlarman
Copy link
Contributor

@kschlarman kschlarman commented Aug 19, 2022

Summary

Update compatibility logic to coerced versions to valid semver (e.g 4.17.1-runtime.7 -> 4.17.1).


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@kschlarman kschlarman changed the title Update semver logic chore: Update semver logic Aug 19, 2022
@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Aug 19, 2022

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@kschlarman kschlarman changed the title chore: Update semver logic chore: update semver logic Aug 19, 2022
@github-actions github-actions bot added the type: chore work needed to keep the product and development running smoothly label Aug 19, 2022
@kschlarman kschlarman changed the title chore: update semver logic chore: Update semver logic Aug 19, 2022
@kschlarman kschlarman changed the title chore: Update semver logic fix: Update semver logic Aug 19, 2022
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Aug 19, 2022
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

🚀

@kschlarman kschlarman merged commit 3b191c8 into main Aug 19, 2022
@kschlarman kschlarman deleted the update-semver-logic branch August 19, 2022 23:19
return versions.find(({ version }) => semver.satisfies(version, pinnedVersion)) || { version: pinnedVersion }
// invalid semver versions are coerced to valid ones (e.g 4.17.1-runtime.7 -> 4.17.1)
return (
versions.find(({ version }) => semver.satisfies(semver.coerce(version), pinnedVersion)) || {
Copy link
Member

@ascorbic ascorbic Aug 20, 2022

Choose a reason for hiding this comment

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

Suggested change
versions.find(({ version }) => semver.satisfies(semver.coerce(version), pinnedVersion)) || {
versions.find(({ version }) => semver.satisfies(version, pinnedVersion, { includePrerelease: true })) || {

This should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants