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

Improve get_tracker_lists #160

Open
boolean5 opened this issue Jul 17, 2020 · 1 comment
Open

Improve get_tracker_lists #160

boolean5 opened this issue Jul 17, 2020 · 1 comment

Comments

@boolean5
Copy link
Contributor

A couple of suggested improvements for get_tracker_lists:

  1. Raise a ValueError for invalid categories found in the configuration file, just like we do for tags.

  2. If the categories key of a configuration section exists but is empty, get_tracker_lists passes to get_domains_from_category_filters a category_filters list that is equal to [""].

    This results in the DisconnectParser raising a KeyError when get_domains_from_category_filters tries to get the domains with category "".

    To avoid this, we could either raise a ValueError when we encounter an empty categories key in get_tracker_lists or fall back to using the DEFAULT_DISCONNECT_LIST_CATEGORIES, just like when there is no categories key.

@boolean5
Copy link
Contributor Author

boolean5 commented Jul 27, 2020

Regarding (2), after discussing it with @englehardt and @say-yawn we decided to go with raising a ValueError, not only when the categories key exists and is empty, but also when it does not exist. We will get rid of the DEFAULT_DISCONNECT_LIST_CATEGORIES, which can be confusing, and require explicitly determining the categories in every configuration section.

For this, we will first need to adjust the configuration files in https://github.com/mozilla-services/shavar-list-creation-config/, as described in mozilla-services/shavar-list-creation-config#64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant