Set empty string as fallback for undefined version #12507
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #11289
Occurred changes and/or fixed issues
I was not able to reproduce the issue, Jetstack probably has fixed their undefined version, or another change in our code has fixed it, but to be safe I've added a fallback to make sure the app doesn't break anymore.
Technical notes summary
isPrerelease
gets called when user has enabled "Include Prerelease Versions" option from Preferences page. An empty string as a fallback will preventsemver.clean
to throw error as it expects to receive a string, as a resultisPrerelease
will returnfalse
. This eventually results in not showing the problematic app on the charts page.Areas or cases that should be tested
The repro steps doesn't work anymore. I think we can move on without testing this considering how small and safe the change is, and the undefined case being tested already in dev mode.
Areas which could experience regressions
Try enable/disable "Include Prerelease Versions" option from Preferences page, the functionality of the charts page should be the same as before.
Screenshot/Video
Checklist