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

Exclude legacy extensions in the AMO whitelist #227

Merged

Conversation

crankycoder
Copy link
Contributor

The TAAR addon whitelist was including legacy addons by mistake. This filters the list further ensuring that an is_webextension flag exists and is true for each addon in the whitelist.

@codecov-io
Copy link

codecov-io commented May 10, 2018

Codecov Report

Merging #227 into master will increase coverage by 0.04%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #227      +/-   ##
==========================================
+ Coverage   56.85%   56.89%   +0.04%     
==========================================
  Files          46       46              
  Lines        2445     2450       +5     
==========================================
+ Hits         1390     1394       +4     
- Misses       1055     1056       +1
Impacted Files Coverage Δ
mozetl/taar/taar_lite_guidguid.py 66.17% <0%> (ø) ⬆️
mozetl/taar/taar_amowhitelist.py 87.71% <87.5%> (-0.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5bfd64...fe66275. Read the comment docs.

Copy link
Contributor

@mlopatka mlopatka left a comment

Choose a reason for hiding this comment

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

@acmiyaguchi These changes look fine for me. Can we get an R+ for merging it into the python_mozetl repo?

Copy link
Contributor

@mlopatka mlopatka left a comment

Choose a reason for hiding this comment

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

@acmiyaguchi this looks fine to me. Can you let me know if this is OK to merge in when you;ve had a chance please?

@mreid-moz mreid-moz requested review from fbertsch and removed request for acmiyaguchi May 16, 2018 14:38
@@ -64,12 +64,24 @@ def transform(self, json_data):

new_data = {}
for guid in json_data.keys():
Copy link
Contributor

Choose a reason for hiding this comment

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

You can probably change this to for guid, addon_data in json_data.items(): to be more succinct.

if len(current_version_files) == 0:
# Only allow webextensions
continue
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this else really needed? If we stumble upon the previous case, then we continue. I think we can just drop the else to reduce indentation as per our style guide (see "General practices").

# Only allow webextensions
continue

rating = addon_data['ratings']['average']
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's be consistent with the code above and use .get() whenever possible, eventually catching errors and failing gracefully.

Copy link
Contributor

@fbertsch fbertsch left a comment

Choose a reason for hiding this comment

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

@Dexterp37 has this review covered, but it might be nice to document here what the structure of the json_data read from s3 is.

@crankycoder crankycoder force-pushed the features/amowhitelist_exclude_legacy branch from ae521a4 to b18466a Compare May 16, 2018 15:43
@crankycoder
Copy link
Contributor Author

@fbertsch I've added a short comment regarding the JSON we're loading just above the fixture data.

Other than that - I believe I've addressed all changes requested by @Dexterp37

@mlopatka
Copy link
Contributor

can someone with write access merge this in please?

@Dexterp37 Dexterp37 merged commit 4cc6156 into mozilla:master May 17, 2018
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

5 participants