-
Notifications
You must be signed in to change notification settings - Fork 32
feature: add semantic version types and test #386
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
Conversation
Pull Request Test Coverage Report for Build 1485
💛 - Coveralls |
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/audience/match/MatchType.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
...api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersionAttributeMatch.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersion.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersion.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersion.java
Outdated
Show resolved
Hide resolved
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.
One nit
return 0; | ||
} | ||
|
||
public static class SemanticVersionExtension { |
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.
Look good. One nit. Why the inner static methods? They could be part of the semantic version and collapse some logic. so, isBuild() {self.version.contains... would be against semantic version, isPreRelease, and split would just use self.version. Perhaps there is something I'm missing?
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.
Still a little nit:
Sorry to be a pain, but, I also meant that you would not need to pass in a string variable in isPreRelease, isBuild, or splitSemanticVersion. You would just split on the semantic version itself (implied self.version). Does that make sense? All you have to do is remove the parameter so it uses the property. Thanks!
return 0; | ||
} | ||
|
||
String[] targetedVersionParts = splitSemanticVersion(targetedVersion.version); |
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.
this would change to targetVersion.splitSemanticVersion() and self.splitSemanticVersion().
} | ||
|
||
private boolean isPreRelease(String semanticVersion) { | ||
return semanticVersion.contains(PRE_RELEASE_SEPERATOR); |
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.
remove string in isPreRelease and use as semver.isPreRelease. the scope can be public or protected. thanks!
Summary
Test plan
Added unit tests