-
Notifications
You must be signed in to change notification settings - Fork 0
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
TLC calculation #17
TLC calculation #17
Conversation
- previously the adapter always returned an error result due to a missing explicit return statement - added version validation to make sure to always have valid semantic version strings
adapter/src/main/kotlin/de/fraunhofer/iem/kpiCalculator/adapter/tools/tlc/model/TechnicalLag.kt
Outdated
Show resolved
Hide resolved
adapter/src/main/kotlin/de/fraunhofer/iem/kpiCalculator/adapter/tools/tlc/util/TimeHelper.kt
Outdated
Show resolved
Hide resolved
isDefault = isDefault, | ||
// this step harmonizes possibly weired version formats like 2.4 or 5 | ||
// those are parsed to 2.4.0 and 5.0.0 | ||
versionNumber = validateAndHarmonizeVersionString(versionNumber) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about 4.0.0.0 ? In some ecosystems, while not recommened, it's allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Version parsing pattern: 1.2.3-alpha+build
internal const val VERSION_REGEX: String = "^$CORE_VERSION$PRE_RELEASE?$BUILD?\$"
// Prefixed version parsing pattern: v1.2-alpha+build
internal const val LOOSE_VERSION_REGEX: String = "^v?$LOOSE_CORE_VERSION$PRE_RELEASE?$BUILD?\$"
the regex from the semver library we use (and the semver standard) doesn't allow that and will fail with an invalid version exception (which we should probably catch so we don't crash due to one library with weired format)
No description provided.