-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JENKINS-60999: Add support for a new parameter tailMaxCount for BUILD_LOG_REGEX token #41
Conversation
return defaultValue; | ||
} | ||
return buffer.toString(); | ||
if (maxTailMatches > 0 && matchResults.size() > maxTailMatches) { | ||
matchResults = matchResults.subList(matchResults.size() - maxTailMatches, matchResults.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if it is in the middle of a <pre></pre>
and cuts off? See the insidePre checks above. I think we would want to make sure that a </pre>
gets added at the end if one is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out, let me look into the right handling for this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed your concern, please let me know if you have any other feedback.
return buffer.toString(); | ||
if (maxTailMatches > 0 && matchResults.size() > maxTailMatches) { | ||
int tailStartLocation; | ||
if (asHtml) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slide I was considering to handle this like how the truncated lines are handled in the else case, but this will become unreliable if there are pre blocks in the log output itself, so decided to not do it. Please let me know if you think otherwise.
Included a fix (and test cases) for a edge case scenario of using
greedy=false
with defaultmaxCount
. Also added missing documentation forgreedy
.