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

Case archiving bug fixes #1332

Merged
merged 2 commits into from
Oct 24, 2024
Merged
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 @@ -3,7 +3,7 @@
import ca.on.oicr.gsi.prometheus.LatencyHistogram;
import ca.on.oicr.gsi.shesmu.plugin.*;
import ca.on.oicr.gsi.shesmu.plugin.action.*;
import ca.on.oicr.gsi.shesmu.plugin.json.JsonListBodyHandler;
import ca.on.oicr.gsi.shesmu.plugin.json.JsonBodyHandler;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down Expand Up @@ -198,7 +198,7 @@ public ActionState perform(

try (var timer = NabuRequestTime.start(baseUrl)) {
var response =
HTTP_CLIENT.send(request, new JsonListBodyHandler<>(MAPPER, NabuCaseArchiveDto.class));
HTTP_CLIENT.send(request, new JsonBodyHandler<>(MAPPER, NabuCaseArchiveDto.class));
if (response.statusCode() == 409) {
return ActionState.HALP;
} else if (response.statusCode() / 100 != 2) {
Expand All @@ -208,8 +208,8 @@ public ActionState perform(
} else if (response.statusCode() == 201) {
return ActionState.INFLIGHT;
} else if (response.statusCode() == 200) {
final var results = response.body().get().collect(Collectors.toList());
return actionStatusFromArchive(results.get(0));
final var results = response.body().get();
return actionStatusFromArchive(results);
} else {
return ActionState.UNKNOWN;
}
Expand Down Expand Up @@ -252,6 +252,7 @@ public ObjectNode toJson(ObjectMapper mapper) {
node.put("case_id", caseId);
node.put("requisition_id", requisitionId);
node.set("parameters", parameters);
errors.forEach(node.putArray("errors")::add);
limsIds.forEach(node.putArray("lims_ids")::add);
workflowRunIdsForOffsiteArchive.forEach(
node.putArray("workflow_run_ids_for_offsite_archive")::add);
Expand Down