-
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
fix: mark signal v0.2.4 as failed #831
Conversation
The ooni/probe-cli#1421 PR trimmed the endpoints and bumped signal's version to v0.2.5. So we need to ignore versions of signal lower than v0.2.5. I am wondering whether we should also use a time window because otherwise what happens when we reprocess measurements. If my analysis is correct, then we have an additional issue that there's another check in this codepath that seems to mark signal measurements as failed without any temporal constraints. This would also cause reprocessing to cause downstream issues. Part of ooni/probe#2636
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #831 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 1448 1448
Branches 116 116
=========================================
Hits 1448 1448
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fastpath/fastpath/core.py
Outdated
if ( | ||
parse_version(tv) <= parse_version("0.2.4") | ||
and parse_version(tv) > parse_version("0.2.3") | ||
and start_time >= datetime(2023, 11, 7) | ||
): | ||
# See https://github.com/ooni/probe/issues/2636 | ||
# See https://github.com/ooni/probe-cli/pull/1421 | ||
scores["accuracy"] = 0.0 | ||
return scores | ||
|
||
if parse_version(tv) <= parse_version("0.2.3") and start_time >= datetime( | ||
2023, 11, 7 | ||
): |
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.
I see we're using the same start_time
for both if
s. I understand the start_time
of 2023-11-07 comes from this issue ooni/probe#2627. We noticed that we were testing too many endpoints on 2023-11-28, according to ooni/probe#2636.
I think there are two options here:
if ( | |
parse_version(tv) <= parse_version("0.2.4") | |
and parse_version(tv) > parse_version("0.2.3") | |
and start_time >= datetime(2023, 11, 7) | |
): | |
# See https://github.com/ooni/probe/issues/2636 | |
# See https://github.com/ooni/probe-cli/pull/1421 | |
scores["accuracy"] = 0.0 | |
return scores | |
if parse_version(tv) <= parse_version("0.2.3") and start_time >= datetime( | |
2023, 11, 7 | |
): | |
if ( | |
parse_version(tv) <= parse_version("0.2.4") | |
and start_time >= datetime(2023, 11, 7) | |
): | |
# See https://github.com/ooni/probe/issues/2636 | |
# See https://github.com/ooni/probe-cli/pull/1421 |
- Or using 2023-11-28 as the cutoff date for the fist check and dropping the
and parse_version(tv) > parse_version("0.2.3")
line.
The former suggestion coalesces two cases that are related together. The second one keeps them separate but applies the same kind of checking patterns to the code.
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.
As discussed on slack it's probably better to be explicit and not collapse the two cases into one, so that it's more clear they are addressing specific different issues affecting different measurements.
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 with an optional diff to further simplify the logic.
fastpath/fastpath/core.py
Outdated
if parse_version(tv) <= parse_version("0.2.4") and parse_version( | ||
tv | ||
) > parse_version("0.2.3"): |
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.
if parse_version(tv) <= parse_version("0.2.4") and parse_version( | |
tv | |
) > parse_version("0.2.3"): | |
if parse_version(tv) == parse_version("0.2.4"): |
IIUC, we are saying that we're not sure about version 0.2.4 and we can just safely drop it, right? Then, in such a case, I suggest it's better to just check for equality here.
Fix changelog entry to avoid conflict with: https://github.com/ooni/backend/pull/793/files
* The integration test was using as a fixture measurement from before the incident (https://explorer.ooni.org/m/20210427000432.751743_AU_signal_490428d8ebc76e6b), but was expecting it to be marked as failed * The unit test was using a measurement that was from a newer version of probe (https://explorer.ooni.org/measurement/20221118T104419Z_signal_IT_30722_n1_Q02UUAiiHlVU0VE6), which should not be marked as failed either As part of #831 we improved the logic for scoring to be more precise and so these checks were now failing. We now use in both cases a correct "bad case" and in the unit test we also include the previous case as a "good case".
* Add correct fixture for bug 2627 * Correct the fixtures for scoring of bug 2627 * The integration test was using as a fixture measurement from before the incident (https://explorer.ooni.org/m/20210427000432.751743_AU_signal_490428d8ebc76e6b), but was expecting it to be marked as failed * The unit test was using a measurement that was from a newer version of probe (https://explorer.ooni.org/measurement/20221118T104419Z_signal_IT_30722_n1_Q02UUAiiHlVU0VE6), which should not be marked as failed either As part of #831 we improved the logic for scoring to be more precise and so these checks were now failing. We now use in both cases a correct "bad case" and in the unit test we also include the previous case as a "good case". * Apply path filters to fastpath and legacy API tests * Add clickhouse-driver to requirement.txt
The ooni/probe-cli#1421 PR trimmed the endpoints and bumped signal's version to v0.2.5.
So we need to ignore versions of signal lower than v0.2.5.
I am wondering whether we should also use a time window because otherwise what happens when we reprocess measurements. If my analysis is correct, then we have an additional issue that there's another check in this codepath that seems to mark signal measurements as failed without any temporal constraints. This would also cause reprocessing to cause downstream issues.
Part of ooni/probe#2636