-
Notifications
You must be signed in to change notification settings - Fork 29
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
Filter list_measurement by versions #703
Conversation
1.0.64~pr703-116 deployed on -test |
7ad4eed
to
cdc4c35
Compare
e296330
to
cb2a372
Compare
cb2a372
to
6b7b4fc
Compare
api/ooniapi/measurements.py
Outdated
description: | | ||
Will be true for confirmed network anomalies (we found a blockpage, a middlebox was found, the IM app is blocked, etc.). | ||
Set "true" for confirmed network anomalies (we found a blockpage, a middlebox, etc.). | ||
Default: both true and false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can the default be true and false at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the value is not set it's handled as None and that generates an SQL query without filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining! I still think the docs are a bit confusing. Maybe there is a better way to express this concept? Such as "Default: we do not filter the results depending on their confirmed status".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -773,6 +773,34 @@ def test_list_measurements_ZZ(client): | |||
assert resp.status_code == 403 | |||
|
|||
|
|||
def test_list_measurements_filter_software_version_nomatch(client): | |||
# https://github.com/ooni/backend/issues/15 | |||
url = "measurements?since=2021-07-09&until=2021-07-10&software_version=9.9.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the functionality is advertised as a comma separated list, can all the tests here be using the comma separated version of the parameter rather than using just a scalar? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added new tests, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'd double check whether the issue URL you're using is correct, thanks!
🙏 🐳
Adds filters for software_version, test_version, engine_version to list measurements
https://ams-pg-test.ooni.org/apidocs/#/default/get_api_v1_measurements
Related to #615