diff --git a/pom.xml b/pom.xml index 0650100a..c7a7e9ac 100644 --- a/pom.xml +++ b/pom.xml @@ -64,8 +64,8 @@ 999999-SNAPSHOT - 2.528 - 2.532 + 2.555 + 2.569 false jenkinsci/${project.artifactId}-plugin true @@ -75,7 +75,7 @@ io.jenkins.tools.bom bom-${jenkins.baseline}.x - 5577.vea_979d35b_b_ff + 6585.va_085f4d47c41 import pom diff --git a/src/main/java/org/jenkinsci/plugins/workflow/log/ConsoleAnnotators.java b/src/main/java/org/jenkinsci/plugins/workflow/log/ConsoleAnnotators.java index 1bcfd311..f883b06c 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/log/ConsoleAnnotators.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/log/ConsoleAnnotators.java @@ -46,16 +46,15 @@ import jenkins.model.Jenkins; import jenkins.security.CryptoConfidentialKey; import org.apache.commons.io.output.ByteArrayOutputStream; -import org.kohsuke.accmod.Restricted; -import org.kohsuke.accmod.restrictions.Beta; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.StaplerRequest2; import org.kohsuke.stapler.StaplerResponse2; /** * Some utility code extracted from {@link AnnotatedLargeText} which probably belongs in {@link ConsoleAnnotator} or {@link ConsoleAnnotationOutputStream}. + * @deprecated Use {@link AnnotatedLargeText#writeHtmlToFilter}. */ -@Restricted(Beta.class) +@Deprecated public class ConsoleAnnotators { private static final CryptoConfidentialKey PASSING_ANNOTATOR = new CryptoConfidentialKey(ConsoleAnnotators.class, "consoleAnnotator"); diff --git a/src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java b/src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java index 44a318fa..ab96bebe 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/log/FileLogStorage.java @@ -213,10 +213,10 @@ private void maybeFlush() { @Override public AnnotatedLargeText overallLog(@NonNull FlowExecutionOwner.Executable build, boolean complete) { maybeFlush(); return new AnnotatedLargeText(log, StandardCharsets.UTF_8, complete, build) { - @Override public long writeHtmlTo(long start, Writer w) throws IOException { + @Override + protected long writeHtmlToFilter(long start, Writer w, ConsoleAnnotationOutputStream caos) throws IOException { try (BufferedReader indexBR = index.isFile() ? Files.newBufferedReader(index.toPath(), StandardCharsets.UTF_8) : new BufferedReader(new NullReader(0))) { - ConsoleAnnotationOutputStream caos = new ConsoleAnnotationOutputStream<>(w, ConsoleAnnotators.createAnnotator(build), build, StandardCharsets.UTF_8); - long r = this.writeRawLogTo(start, new FilterOutputStream(caos) { + return super.writeRawLogTo(start, new FilterOutputStream(caos) { // To insert startStep/endStep annotations into the overall log, we need to simultaneously read index-log. // We use the standard LargeText.FileSession to get the raw log text (we need not think about ConsoleNote here), having seeked to the start position. // Then we read index-log in order, looking for transitions from one step to the next (or to or from non-step overall output). @@ -261,8 +261,6 @@ private void maybeFlush() { super.flush(); } }); - ConsoleAnnotators.setAnnotator(caos.getConsoleAnnotator()); - return r; } } };