Skip to content
Draft
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
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
show-headers:
description: "Show headers for each subsection in the summary (if not set, headers are hidden)"
required: false
enable-logging:
description: "If set, then logging of the Checks Output JSON parameters is enabled. By default, logging is disabled."
required: false
max-warning-annotations:
description: "Limit the number of warning annotations at specific lines. By default, all annotations are created."
required: false
Expand All @@ -42,6 +45,7 @@ runs:
GITHUB_API_URL: ${{ inputs.github-api-url }}
SKIP_ANNOTATIONS: ${{ inputs.skip-annotations }}
SHOW_HEADERS: ${{ inputs.show-headers }}
ENABLE_LOGGING: ${{ inputs.enable-logging }}
MAX_WARNING_ANNOTATIONS: ${{ inputs.max-warning-annotations }}
MAX_COVERAGE_ANNOTATIONS: ${{ inputs.max-coverage-annotations }}

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/edu/hm/hafner/grading/github/QualityMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;

import edu.hm.hafner.grading.AggregatedScore;
import edu.hm.hafner.grading.AutoGradingRunner;
import edu.hm.hafner.grading.GradingReport;
Expand Down Expand Up @@ -144,6 +150,18 @@ private void addComment(final AggregatedScore score, final String textSummary,

check.add(output);

if (!getEnv("ENABLE_LOGGING", log).isEmpty()) {
var mapper = JsonMapper.builder().configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS, true).build()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.INDENT_OUTPUT, true);
try {
log.logInfo("Output JSON parameters:%n%s", mapper.writeValueAsString(output));
}
catch (JsonProcessingException exception) {
// ignore
}
}

var checksResult = createChecksRun(log, check);

var prNumber = getEnv("PR_NUMBER", log);
Expand Down