Skip to content

Commit

Permalink
reduce logging for receive result from Bamboo
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Krusche committed Oct 22, 2019
1 parent c990844 commit 91342cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void onResultNotifiedOld(ProgrammingExerciseParticipation participation)
*/
@Transactional
public Optional<Result> processNewProgrammingExerciseResult(@NotNull Participation participation, @NotNull Object requestBody) {
log.info("Received new build result (NEW) for participation " + participation.getId());
log.debug("Received new build result (NEW) for participation " + participation.getId());

if (!(participation instanceof ProgrammingExerciseParticipation))
throw new EntityNotFoundException("Participation with id " + participation.getId() + " is not a programming exercise participation!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public ResponseEntity<?> notifyResultOld(@PathVariable("planKey") String planKey
*/
@PostMapping(value = Constants.NEW_RESULT_RESOURCE_PATH)
public ResponseEntity<?> notifyNewProgrammingExerciseResult(@RequestHeader("Authorization") String token, @RequestBody Object requestBody) {
log.info("Received result notify (NEW)");
log.debug("Received result notify (NEW)");
if (token == null || !token.equals(CI_AUTHENTICATION_TOKEN)) {
log.info("Cancelling request with invalid token {}", token);
return forbidden(); // Only allow endpoint when using correct token
Expand All @@ -204,11 +204,11 @@ public ResponseEntity<?> notifyNewProgrammingExerciseResult(@RequestHeader("Auth
log.error("Exception encountered when trying to retrieve the plan key from a request a new programming exercise result: {}, {}", ex, requestBody);
return badRequest();
}
log.info("PlanKey for received notifyResultNew is {}", planKey);
log.info("Artemis received a new result from Bamboo for build plan {}", planKey);

// Try to retrieve the participation with the build plan key.
Optional<ProgrammingExerciseParticipation> optionalParticipation = getParticipationWithResults(planKey);
if (!optionalParticipation.isPresent()) {
if (optionalParticipation.isEmpty()) {
log.warn("Participation is missing for notifyResultNew (PlanKey: {}).", planKey);
return notFound();
}
Expand All @@ -231,7 +231,7 @@ public ResponseEntity<?> notifyNewProgrammingExerciseResult(@RequestHeader("Auth
ltiService.onNewBuildResult((ProgrammingExerciseStudentParticipation) participation);
}
}
log.info("ResultService succeeded for notifyResultNew (PlanKey: {}).", planKey);
log.info("The new result was for {} was saved successfully", planKey);
return ResponseEntity.ok().build();
}

Expand Down

0 comments on commit 91342cb

Please sign in to comment.