[JENKINS-58102] GlobalAnnotator does not annotate lines that are part of a multi-line color sequence #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See JENKINS-58102. Fixes a bug introduced in #25 that is only observable when
timestamperis used with Pipeline and the multi-line escape sequence support introduced in jenkinsci/ansicolor-plugin#137. The problem is thatGlobalAnnotatordoesn't account for the<span>elements introduced byansicolorwhen looking for timestamps to annotate. The fix is similar in approach to the existing code that accounts for the<span>elements introduced by Pipeline.I wrote a new test that exercises this use case. When the test is executed against Jenkins 2.145 and
ansicolor0.6.2 (with thesrc/mainchanges from this PR reverted), it fails with the following stack trace:When the test is executed against Jenkins 2.145 and
ansicolor0.6.2 (with thesrc/mainchanges in this PR), the test passes.Unfortunately, I couldn't useansicolor0.6.2 in this PR because it requires Jenkins 2.145 or later, and only 73% oftimestamperusers are on Jenkins 2.145 or later. Rather than drop support for 27% of the user base for the sake of one test, I compromised by usingansicolor0.5.3, whose minimum Jenkins version is 2.121.2. When run againstansicolor0.5.3, the new test isn't exercising the changes insrc/mainfrom this PR. However, it is exercising the bulk of the new logic introduced in #25, which is still a net improvement from the state of affairs before this PR.