Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

[bug 1129085] Infer version for Firefox Dev #479

Merged
merged 1 commit into from Feb 6, 2015
Merged

[bug 1129085] Infer version for Firefox Dev #479

merged 1 commit into from Feb 6, 2015

Conversation

willkg
Copy link
Member

@willkg willkg commented Feb 4, 2015

Previously, we'd only infer the version if the browser from the user
agent matched the product db_name. That doesn't work for Firefox Dev
Edition or Firefox 64.

This fixes that so that we can explicitly state which "browser" a
product is. Then it'll match up, we can appropriately infer the
product version from the user-agent specified browser version, and we
can go home at night and feel like we did a good job at work.

r?

@willkg
Copy link
Member Author

willkg commented Feb 4, 2015

Bah. forgot to add stuff to the admin again.

@willkg
Copy link
Member Author

willkg commented Feb 4, 2015

^^^ Ok. Complete for realz this time.

product = models.Product.objects.get(db_name=product_db_name)
# So instead, we do the first test to handle the Android
# case and the second test to handle the Firefox Dev and
# related cases.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove this comment and the commented out code below? Or perhaps I am confused.

Previously, we'd only infer the version if the browser from the user
agent matched the product db_name. That doesn't work for Firefox Dev
Edition or Firefox 64.

This fixes that so that we can explicitly state which "browser" a
product is. Then it'll match up, we can appropriately infer the
product version from the user-agent specified browser version, and we
can go home at night and feel like we did a good job at work.
@willkg
Copy link
Member Author

willkg commented Feb 6, 2015

^^^ That nixes the comment, the commented out code and also adds a defensive check to the if statement just in case product.browser is the empty string--we don't want to try to match that to anything.

for db_name, browser in data:
prod = orm.Product.objects.get(db_name=db_name)
prod.browser = browser
prod.save()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll need to add this to the django 1.7 pull request

@rlr
Copy link
Contributor

rlr commented Feb 6, 2015

☕ r+

willkg added a commit that referenced this pull request Feb 6, 2015
[bug 1129085] Infer version for Firefox Dev
@willkg willkg merged commit bc7b113 into mozilla:master Feb 6, 2015
@willkg
Copy link
Member Author

willkg commented Feb 6, 2015

5b5f9b9 [bug 1129085] Infer version for Firefox Dev

Thank you!

@willkg willkg deleted the 1129085-infer-version branch February 6, 2015 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants