Skip to content
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

Small optimization to not compute the highest version when it isn't displayed #6360

Merged
merged 2 commits into from Nov 14, 2019

Conversation

ericholscher
Copy link
Member

@ericholscher ericholscher commented Nov 7, 2019

We added a setting about whether to show this to the user or not,
but always calculated the data regardless of the setting.

@humitos does this break your extension, or is it respecting this setting also?

@ericholscher ericholscher requested review from humitos and stsewd Nov 7, 2019
stsewd
stsewd approved these changes Nov 7, 2019
Copy link
Member

@stsewd stsewd left a comment

Tests need to be updated self.pip.show_version_warning = True.

ericholscher and others added 2 commits Nov 13, 2019
…isplayed

We added a setting about whether to show this to the user or not,
but always calculated the data regardless of the setting.
@stsewd stsewd force-pushed the dont-compute-highest-if-not-shown branch from 8300f63 to 6acceea Compare Nov 13, 2019
@@ -152,7 +171,7 @@ def test_highest_version_from_lower(self):
self.assertDictEqual(valid_data, returned_data)

def test_highest_version_from_latest(self):
Version.objects.create_latest(project=self.pip, built=True)
self.pip.versions.filter(slug=LATEST).update(built=True)
Copy link
Member

@stsewd stsewd Nov 13, 2019

Choose a reason for hiding this comment

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

latest is created when we call pip.save() in the setup method

@stsewd
Copy link
Member

@stsewd stsewd commented Nov 13, 2019

Tests should be passing now

@humitos
Copy link
Member

@humitos humitos commented Nov 14, 2019

@humitos does this break your extension, or is it respecting this setting also?

It should not affect it. The extension does not use the footer API, it uses the versions endpoint directly /api/versions/

@stsewd stsewd merged commit 14cee97 into master Nov 14, 2019
3 checks passed
@stsewd stsewd deleted the dont-compute-highest-if-not-shown branch Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants