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

Adds ooni_run_link_id to annotations #620

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public OONIRunSuite getTestSuite(Context context) {
for (String url : nettest.getInputs())
Url.checkExistingUrl(url);
}
test.setOoniRunLinkId(runId);
test.setInputs(nettest.getInputs());
return test;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public void setOrigin(String origin) {
annotations.origin = origin;
}

public void setOoniRunLinkId(Long ooniRunLinkId) {
annotations.ooniRunLinkId = String.valueOf(ooniRunLinkId);
}

private class OONIMKTaskConfigAdapter implements OONIMKTaskConfig {
private String serialized;
private Settings settings;
Expand All @@ -103,6 +107,9 @@ public static class Annotations {
@SerializedName("origin")
public String origin;

@SerializedName("ooni_run_link_id")
public String ooniRunLinkId;

public Annotations(Context c) {
this.network_type = ReachabilityManager.getNetworkType(c);
this.flavor = BuildConfig.FLAVOR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public abstract class AbstractTest implements Serializable {
private final int urlResId;
private final int runtime;
private List<String> inputs;
private Long ooniRunLinkId;
private Integer max_runtime;
private Network network;

Expand Down Expand Up @@ -81,6 +82,9 @@ void run(Context c, PreferenceManager pm, AppLogger logger, Gson gson, Settings
settings.inputs = inputs;
settings.setMaxRuntime(max_runtime);
settings.setOrigin(origin);
if (ooniRunLinkId != null && ooniRunLinkId > 0) {
settings.setOoniRunLinkId(ooniRunLinkId);
}
measurements = new SparseArray<>();

ThirdPartyServices.addLogExtra("settings", ((Application) c.getApplicationContext()).getGson().toJson(settings));
Expand Down Expand Up @@ -349,7 +353,11 @@ public void setInputs(List<String> inputs) {
this.inputs = inputs;
}

public Integer getMax_runtime() {
public void setOoniRunLinkId(Long ooniRunLinkId) {
this.ooniRunLinkId = ooniRunLinkId;
}

public Integer getMax_runtime() {
return max_runtime;
}

Expand Down
Loading