Closed Bug 802769 Opened 14 years ago Closed 14 years ago

[socorro-crashstats] product order differs between Advanced Search page and global-navigation <select> product pulldown

Categories

(Socorro :: Webapp, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: rhelmer)

References

()

Details

Attachments

(1 file)

Attached image Screenshot —
We have a test, test_that_options_are_sorted_the_same, (https://github.com/mozilla/Socorro-Tests/blob/master/tests/test_smoke_tests.py#L36) that asserts that the products are sorted the same in the <select> dropdown as in the "Product" multi-select in Advanced Search. They're currently not, on crash-stats-new-dev; see screenshot
Summary: [socorro-crashstats] → [socorro-crashstats] product order differs between Advanced Search page and global-navigation <select> product pulldown
We have at least three similar services: Products CurrentVersions ProductVersions I don't really understand the difference between the latter two. CurrentVersions is complete but is kind of a pain to use, so I recently introduced an OrderedDict called "release" that is available to all templates that use the @base_data decorator. Is there a reason we shouldn't just use the same one everywhere? CurrentVersions is called on every single pageload (we need it to build the product/versions pulldowns in the base template) and is cached for one hour. Having a service like Products is false economy, if we already have "releases" data structure cached (you can do .keys() on it to get the products back in sorted order) I haven't looked at ProductVersions, if it can replace CurrentVersions that's fine and we should do so. In any case, I plan to just make /query use "releases" unless someone has a better idea :)
Assignee: nobody → rhelmer
Status: NEW → ASSIGNED
r? https://github.com/mozilla/socorro-crashstats/pull/172 This is the smallest fix I can think of - looks like products is used elsewhere. I think it could trivially be changed to use releases instead and remove the extra mware call to Products service, though.
ProductVersions is inheriting CurrentVersions, it was just a way for to get data formated as the /query page expected it. Maybe that logic should be moved to the query view. ProductVersions basically returns the exact same data than CurrentVersions but as a dict where keys are product names and values are lists of all versions of that product.
(In reply to Adrian Gaudebert [:adrian] from comment #3) > ProductVersions is inheriting CurrentVersions, it was just a way for to get > data formated as the /query page expected it. Maybe that logic should be > moved to the query view. > > ProductVersions basically returns the exact same data than CurrentVersions > but as a dict where keys are product names and values are lists of all > versions of that product. ah ok, that is basically what I have done with the "releases" OrderedDict - keys are the product name, but keeps all the other info like featured versions etc: https://github.com/mozilla/socorro-crashstats/blob/master/crashstats/crashstats/utils.py#L151
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
(In reply to Robert Helmer [:rhelmer] from comment #4) > ah ok, that is basically what I have done with the "releases" OrderedDict - > keys are the product name, but keeps all the other info like featured > versions etc: > > https://github.com/mozilla/socorro-crashstats/blob/master/crashstats/ > crashstats/utils.py#L151 I knew this kind of things would happen, we just need to remember to do some cleanup once we have passed secreview.
Verified FIXED; w00t! Passed tests.test_smoke_tests.TestSmokeTests test_that_options_are_sorted_the_same
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: