Skip to content
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

Merged
merged 4 commits into from
Feb 18, 2020

Conversation

haridsv
Copy link
Contributor

@haridsv haridsv commented Feb 6, 2020

Included a fix (and test cases) for a edge case scenario of using greedy=false with default maxCount. Also added missing documentation for greedy.

@haridsv haridsv requested a review from slide February 6, 2020 16:51
return defaultValue;
}
return buffer.toString();
if (maxTailMatches > 0 && matchResults.size() > maxTailMatches) {
matchResults = matchResults.subList(matchResults.size() - maxTailMatches, matchResults.size());
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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) {
Copy link
Contributor Author

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.

@slide slide merged commit a44c8fc into jenkinsci:master Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants