Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ac7e81f
feat:semantic versioning
Jul 30, 2020
ee29674
semver updated
Jul 30, 2020
4a5e75d
more validation for invalid cases added
Aug 5, 2020
01ed4da
feat: Semantic Version
oakbani Aug 21, 2020
796af4d
GE and LE with test cases
Aug 24, 2020
f318995
Update test_condition.py
Aug 24, 2020
e016cd8
added ge le
msohailhussain Aug 24, 2020
857e8de
PR comments resolved
Aug 25, 2020
5f793a3
comments resolved
Aug 25, 2020
cfb12df
Update condition.py
Aug 25, 2020
379d637
Merge branch 'uzair/semver' into amna/semver
oakbani Aug 26, 2020
1c37fbf
invalid test case for semver and comment fixed
Aug 26, 2020
dcd391f
Update test_condition.py
Aug 26, 2020
2affb9d
Update test_condition.py
Aug 26, 2020
032d9c1
Merge branch 'uzair/semver' into amna/semver
oakbani Aug 26, 2020
8577f7c
compare implemetation and invalid testcase fixed
Aug 26, 2020
32bed45
Merge branch 'uzair/semver' into amna/semver
oakbani Aug 27, 2020
426d2b7
Revert "compare implemetation and invalid testcase fixed"
oakbani Aug 27, 2020
ac8113e
passes fsc at this point
oakbani Aug 27, 2020
84f6c26
fix:lint
oakbani Aug 27, 2020
ca7984a
remove: additional lint fixes
oakbani Aug 27, 2020
9256e6a
additional removal
oakbani Aug 27, 2020
15fa71b
further removal
oakbani Aug 27, 2020
8414a92
address most comments
oakbani Aug 28, 2020
78ce524
reorganize
oakbani Aug 28, 2020
aa1fbaf
tests: revised all unit tests
oakbani Aug 31, 2020
c8c0e75
Merge branch 'master' into amna/semver
oakbani Sep 2, 2020
907fcf2
address comments
oakbani Sep 2, 2020
8b4567c
add further checks
oakbani Sep 3, 2020
8856665
comments resolved
Sep 9, 2020
7ed20f0
comments resolved
Sep 9, 2020
4f2c05e
Update test_condition.py
Sep 14, 2020
4070805
Revert "Update test_condition.py"
Sep 14, 2020
4c471bd
Update test_condition.py
Sep 14, 2020
68708d9
Update test_condition.py
Sep 16, 2020
09533b1
Merge branch 'master' into amna/semver
msohailhussain Sep 16, 2020
ad17c02
testcase fixed
Sep 17, 2020
93cbb2a
Update condition.py
Sep 17, 2020
25ab44d
fix condition
oakbani Sep 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions optimizely/helpers/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ def is_pre_release(self, target):
"""
return SemverType.IS_PRE_RELEASE in target
Copy link
Contributor

Choose a reason for hiding this comment

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

What if version includes multiple "-"?

Can you share some sample pre-release versions here? Also, will be good to put same information in docstring itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

version having multiple "-" should be invalid right? We haven't dealt with this here. @thomaszurkan-optimizely


def is_patch_pre_release(self, idx, idx_value):
return idx == SemverType.PATCH_INDEX and idx_value in SemverType.IS_PATCH_PRE_RELEASE

def is_build(self, target):
""" Method to check if the given version contains "+"
Copy link
Contributor

Choose a reason for hiding this comment

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

Again. Similar to the comment above. This should be Method to check given version is a build version. Criteria for build version includes:


Expand Down Expand Up @@ -499,14 +496,14 @@ def split_semantic_version(self, target):
target_suffix = ""
target_parts = []

""" remove spaces from target version string """
# remove spaces from target version string

if self.has_white_space(target):
self.logger.warning(Errors.INVALID_ATTRIBUTE_FORMAT)
return None

# check for pre release e.g. 1.0.0-alpha where 'alpha' is a pre release
# otherwise check for build e.g. 1.0.0+001 where 001 is a build metadata"""
# otherwise check for build e.g. 1.0.0+001 where 001 is a build metadata

if self.is_pre_release(target):
target_parts = target.split(SemverType.IS_PRE_RELEASE)
Expand Down
Loading