From 4a0fa803ba633c13f5358052694b25b6381a0fe0 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Thu, 16 Jan 2025 10:02:53 +0100 Subject: [PATCH] Make persistRun transactional Signed-off-by: Andrea Lamparelli --- .../io/hyperfoil/tools/horreum/api/services/RunService.java | 2 ++ .../java/io/hyperfoil/tools/horreum/svc/RunServiceImpl.java | 1 + 2 files changed, 3 insertions(+) diff --git a/horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/services/RunService.java b/horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/services/RunService.java index 12953141a..898d35d4a 100644 --- a/horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/services/RunService.java +++ b/horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/services/RunService.java @@ -222,6 +222,7 @@ Response add(@QueryParam("test") String testNameOrId, @Parameter(name = "description", description = "Run description", example = "AWS runs"), }) + @Produces(MediaType.TEXT_PLAIN) @APIResponses(value = { @APIResponse(responseCode = "202", description = "The request has been accepted for processing. Returns a list of created run IDs if available, " + "or an empty list if processing is still ongoing. Label values and change detection processing " + @@ -242,6 +243,7 @@ Response addRunFromData(@QueryParam("start") String start, @Path("data") @Consumes(MediaType.MULTIPART_FORM_DATA) @Operation(description = "Upload a new Run with metadata", hidden = true) + @Produces(MediaType.TEXT_PLAIN) @APIResponses(value = { @APIResponse(responseCode = "202", description = "The request has been accepted for processing. Returns a list of created run IDs if available, " + "or an empty list if processing is still ongoing. Label values and change detection processing " + diff --git a/horreum-backend/src/main/java/io/hyperfoil/tools/horreum/svc/RunServiceImpl.java b/horreum-backend/src/main/java/io/hyperfoil/tools/horreum/svc/RunServiceImpl.java index f109ad74f..d137a2c04 100644 --- a/horreum-backend/src/main/java/io/hyperfoil/tools/horreum/svc/RunServiceImpl.java +++ b/horreum-backend/src/main/java/io/hyperfoil/tools/horreum/svc/RunServiceImpl.java @@ -535,6 +535,7 @@ Response addRunFromData(String start, String stop, String test, .build(); } + @Transactional void persistRun(ServiceMediator.RunUpload runUpload) { runUpload.roles.add("horreum.system"); roleManager.setRoles(String.join(",", runUpload.roles));