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

fix: mark signal v0.2.4 as failed #831

Merged
merged 8 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fastpath/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
fastpath (0.85) unstable; urgency=medium

* Mark signal measurements as failed
* Disable torsf test via check-in

-- Arturo Filastò <[email protected]> Mon, 25 Mar 2024 12:14:54 +0100

fastpath (0.84) unstable; urgency=medium

* Support ooni_run_link_id
Expand Down
44 changes: 30 additions & 14 deletions fastpath/fastpath/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,32 +1353,48 @@ def score_signal(msm: dict) -> dict:
try:
# https://github.com/ooni/probe/issues/2344
tv = g_or(msm, "test_version", "0.0.0")
if parse_version(tv) <= parse_version("0.2.3"):

msmt_start_time = msm.get("measurement_start_time")
if msmt_start_time is None:
scores["accuracy"] = 0.0
return scores
start_time = datetime.strptime(msmt_start_time, "%Y-%m-%d %H:%M:%S")

if parse_version(tv) <= parse_version("0.2.4") and parse_version(
tv
) > parse_version("0.2.3"):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
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.

# the breakage here is affecting just v0.2.4 of the test
# 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
):
# https://github.com/ooni/probe/issues/2627
scores["accuracy"] = 0.0
return scores

if parse_version(tv) < parse_version("0.2.2"):
start_time = msm.get("measurement_start_time")
if start_time is None:
scores["accuracy"] = 0.0
else:
start_time = datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S")
if start_time >= datetime(2022, 10, 19):
scores["accuracy"] = 0.0
if parse_version(tv) < parse_version("0.2.2") and start_time >= datetime(
2022, 10, 19
):
scores["accuracy"] = 0.0
return scores

# https://github.com/ooni/backend/issues/679
# engine_version < 3.17.2 and measurement_start_time > 2023-05-02
annot = g_or(msm, "annotations", {})
ev = g_or(annot, "engine_version", "0.0.0")
if parse_version(ev) < parse_version("3.17.2"):
st = g_or(msm, "measurement_start_time", "2023-05-05 00:00:00")
start_time = datetime.strptime(st, "%Y-%m-%d %H:%M:%S")
if start_time >= datetime(2023, 5, 2):
scores["accuracy"] = 0.0
if parse_version(ev) < parse_version("3.17.2") and start_time >= datetime(
2023, 5, 2
):
scores["accuracy"] = 0.0
return scores

except Exception:
scores["accuracy"] = 0.0
return scores

st = tk.get("signal_backend_status")
if st == "ok":
Expand Down
Loading