Skip to content

Commit

Permalink
Fix references to observation_id
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Sep 10, 2024
1 parent 64506ec commit 79161db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
16 changes: 8 additions & 8 deletions oonipipeline/src/oonipipeline/analysis/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def make_signal_experiment_result(
outcome_meta["why"] = "dns failure"
outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.hostname}",
category="dns",
Expand Down Expand Up @@ -112,7 +112,7 @@ def make_signal_experiment_result(

outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.hostname}",
category="dns",
Expand All @@ -127,7 +127,7 @@ def make_signal_experiment_result(
else:
outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.hostname}",
category="dns",
Expand All @@ -152,7 +152,7 @@ def make_signal_experiment_result(

outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.ip}:{web_o.port}",
category="tcp",
Expand All @@ -168,7 +168,7 @@ def make_signal_experiment_result(
elif not dns_blocked and web_o.tcp_success:
outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.ip}:{web_o.port}",
category="tcp",
Expand Down Expand Up @@ -197,7 +197,7 @@ def make_signal_experiment_result(

outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.hostname}",
category="tls",
Expand Down Expand Up @@ -225,7 +225,7 @@ def make_signal_experiment_result(

outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.hostname}",
category="tls",
Expand All @@ -240,7 +240,7 @@ def make_signal_experiment_result(
elif not dns_blocked and not tcp_blocked and web_o.tls_cipher_suite is not None:
outcomes.append(
Outcome(
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
scope=BlockingScope.UNKNOWN,
subject=f"{web_o.hostname}",
category="tls",
Expand Down
2 changes: 1 addition & 1 deletion oonipipeline/src/oonipipeline/analysis/web_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def make_web_analysis(
website_analysis = WebAnalysis(
measurement_meta=web_o.measurement_meta,
probe_meta=web_o.probe_meta,
observation_id=web_o.observation_id,
observation_id=f"{web_o.measurement_meta.measurement_uid}_{web_o.observation_idx}",
created_at=created_at,
analysis_id=f"{web_o.measurement_meta.measurement_uid}_{idx}",
target_domain_name=domain_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def make_analysis_in_a_day(params: MakeAnalysisParams) -> dict:
)

except:
web_obs_ids = ",".join(map(lambda wo: wo.observation_id, web_obs))
web_obs_ids = ",".join(
map(lambda wo: wo.measurement_meta.measurement_uid, web_obs)
)
log.error(
f"failed to generate analysis for {web_obs_ids}", exc_info=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def make_web_control_observations(
web_ctrl_obs.append(obs)

for idx, obs in enumerate(web_ctrl_obs):
obs.observation_id = f"{obs.measurement_meta.measurement_uid}_{idx}"
obs.observation_idx = idx

return web_ctrl_obs

Expand Down

0 comments on commit 79161db

Please sign in to comment.