-
-
Notifications
You must be signed in to change notification settings - Fork 140
[JENKINS-60862] Add hidden spans with node data to truncated logs so branch names can be displayed #150
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
Conversation
…branch names can be displayed
|
Implementation aside, I like the idea of being able to see the branch names that way. |
|
@kshultzCB Just to clarify, branch names already show up like that, they just don't always show up correctly when you are viewing truncated logs instead of the full logs. |
That's the thing I really like - that I don't have to load that entire mile-long full log to see the stage names. That would be a nice usability improvement. |
jglick
left a comment
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 do not like cloning console.jelly either but this seems like the most expedient fix for now.
|
This works fine, I'm happy with a single plugin change especially in the short to medium term. How hard would it be to switch to the other approach later? |
Taking this approach now shouldn't make it any harder to switch to any other approach later. Switching to injecting the spans into the log stream over in workflow-api would be relatively straightforward, we'd just move the logic over there, then remove it from this plugin and update the workflow-api dependency, so users wouldn't have to do anything special. |
|
FYI this change (specifically 6e3de24) seems to have broken |
|
#164? |
|
@jglick thanks, I wish I'd found that a few days ago! |
See JENKINS-60862.
I am opening this PR as a draft to get feedback on the overall approach and to see if anyone has any ideas on a better way to fix the issue.
When viewing truncated logs, this PR directly injects
<span>elements inside of a hidden<div>for all flow nodes containing the same data that would be added for theNewNodeConsoleNotefor that node if it was on screen, so thatNewNodeConsoleNote/script.jsalways has all of the data it needs to be able to display branch names.Here are screenshots showing the effect of the change:
Details
Details
This approach seems pretty awkward, and requires us to clone
console.jellyfrom core. One improvement we could make while keeping the same general approach would be to modifyFileLogStorage(and any other implementations ofLogStorage) to directly inject the same content into the log stream inside ofwriteHtmlToin theAnnotatedLargeTextoverride inoverallLogwhenever the offset is non-zero, so that we don't need to cloneconsole.jellyor modifyWorkflowRun. I just kept things simple for now and went with the one-plugin fix to get feedback on the overall idea.I'm not sure about adding an automated test for this. I will check if there is a way to see what CSS rules are enabled on a page using HtmlUnit in a way that supports CSS rules injected via JavaScript.