-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(releases): Consistently sort by build number & code in semver #102711
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
Draft
srest2021
wants to merge
38
commits into
master
Choose a base branch
from
srest2021/REPLAY-803
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
b3cd378
add build number sorting
srest2021 0eb0eca
ensure semver order test fails without build number ordering
srest2021 afac5b0
add compare_version test
srest2021 e479720
clean up test
srest2021 185a8a1
remove annotation
srest2021 b78407a
add lexicographic sort on build_code
srest2021 e9166d9
Merge branch 'master' into srest2021/REPLAY-803
srest2021 3096e53
make sure build code test doesnt pass by coincidence
srest2021 2ac040b
Merge branch 'master' into srest2021/REPLAY-803
srest2021 e3a53a7
add build_number_case annotation
srest2021 8328882
rename case column
srest2021 d3b19a0
rename case column
srest2021 4f987e8
fix
srest2021 ce127dc
missed some renaming
srest2021 2d46a94
Merge branch 'master' into srest2021/REPLAY-803
srest2021 8d23660
fix typing
srest2021 354b7f2
add feature flag
srest2021 63b9dab
dont need to update ordering in this file
srest2021 b381471
more tests
srest2021 f35d7b0
more tests
srest2021 83a2701
cleaning up
srest2021 cc73245
more tests & clean up feature flag checks
srest2021 ffdaf0d
remove unnecessary sorting in backend.py; update filter aliases
srest2021 7c2ce34
Merge branch 'master' into srest2021/REPLAY-803
srest2021 22ae3bf
fix flaky test
srest2021 30cc2d9
fix typing
srest2021 d07da24
small naming change
srest2021 960111e
update utils
srest2021 ba16113
fix failing test
srest2021 de556e9
Merge branch 'master' into srest2021/REPLAY-803
srest2021 3486a98
fix typing again
srest2021 496d672
Merge branch 'master' into srest2021/REPLAY-803
srest2021 205504e
revert filter changes
srest2021 22984f1
oops
srest2021 c77a856
revert backend.py changes
srest2021 0c479bc
latest adopted release test
srest2021 2751910
fix comment
srest2021 f7cb5dc
more test coverage for latest adopted release
srest2021 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,33 +246,70 @@ def test_release_list_order_by_build_number(self) -> None: | |
| response = self.get_success_response(self.organization.slug, sort="build") | ||
| self.assert_expected_versions(response, [release_1, release_3, release_2]) | ||
|
|
||
| def test_release_list_order_by_semver(self) -> None: | ||
| self.login_as(user=self.user) | ||
| def _test_release_list_order_by_semver_helper(self, with_build_code: bool) -> None: | ||
| release_1 = self.create_release(version="test@2.2") | ||
| release_2 = self.create_release(version="test@10.0+122") | ||
| release_2 = self.create_release(version="test@10.0+1000") | ||
| release_3 = self.create_release(version="test@2.2-alpha") | ||
| release_4 = self.create_release(version="test@2.2.3") | ||
| release_5 = self.create_release(version="test@2.20.3") | ||
| release_6 = self.create_release(version="test@2.20.3.3") | ||
| release_7 = self.create_release(version="test@10.0+123") | ||
| release_7 = self.create_release(version="test@10.0+998") | ||
| release_8 = self.create_release(version="test@some_thing") | ||
| release_9 = self.create_release(version="random_junk") | ||
| release_10 = self.create_release(version="test@10.0+x22") | ||
| release_11 = self.create_release(version="test@10.0+a23") | ||
| release_12 = self.create_release(version="test@10.0") | ||
| release_13 = self.create_release(version="test@10.0-abc") | ||
| release_14 = self.create_release(version="test@10.0+999") | ||
|
|
||
| response = self.get_success_response(self.organization.slug, sort="semver") | ||
| self.assert_expected_versions( | ||
| response, | ||
| [ | ||
| release_7, | ||
| release_2, | ||
| release_6, | ||
| release_5, | ||
| release_4, | ||
| release_1, | ||
| release_3, | ||
| release_9, | ||
| release_8, | ||
| ], | ||
| ) | ||
|
|
||
| if with_build_code: | ||
| expected_order = [ | ||
| release_10, # test@10.0+x22 | ||
| release_11, # test@10.0+a23 | ||
| release_2, # test@10.0+1000 | ||
| release_14, # test@10.0+999 | ||
| release_7, # test@10.0+998 | ||
| release_12, # test@10.0 | ||
| release_13, # test@10.0-abc | ||
| release_6, # test@2.20.3.3 | ||
| release_5, # test@2.20.3 | ||
| release_4, # test@2.2.3 | ||
| release_1, # test@2.2 | ||
| release_3, # test@2.2-alpha | ||
| release_9, # random_junk | ||
| release_8, # test@some_thing | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This order now matches what we see in |
||
| ] | ||
| else: | ||
| # without build code ordering, tiebreaker is date_added | ||
| expected_order = [ | ||
| release_14, # test@10.0+999 | ||
| release_12, # test@10.0 | ||
| release_11, # test@10.0+a23 | ||
| release_10, # test@10.0+x22 | ||
| release_7, # test@10.0+998 | ||
| release_2, # test@10.0+1000 | ||
| release_13, # test@10.0-abc | ||
| release_6, # test@2.20.3.3 | ||
| release_5, # test@2.20.3 | ||
| release_4, # test@2.2.3 | ||
| release_1, # test@2.2 | ||
| release_3, # test@2.2-alpha | ||
| release_9, # random_junk | ||
| release_8, # test@some_thing | ||
| ] | ||
|
|
||
| self.assert_expected_versions(response, expected_order) | ||
|
|
||
| def test_release_list_order_by_semver(self) -> None: | ||
| self.login_as(user=self.user) | ||
| self._test_release_list_order_by_semver_helper(with_build_code=False) | ||
|
|
||
| def test_release_list_order_by_semver_with_build_code(self) -> None: | ||
| self.login_as(user=self.user) | ||
| with self.feature("organizations:semver-ordering-with-build-code"): | ||
| self._test_release_list_order_by_semver_helper(with_build_code=True) | ||
|
|
||
| def test_query_filter(self) -> None: | ||
| user = self.create_user(is_staff=False, is_superuser=False) | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Switch the order in which release_2 and release_7 are created so the build_number sorting doesn't coincidentally pass due to insertion order.