[JENKINS-30088] Clean up step display in logs #215
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@@ -656,7 +657,7 @@ public int hashCode() { | |||
} | |||
node.addAction(new TimingAction()); | |||
|
|||
logNodeMessage(node, "Running: " + node.getDisplayName()); | |||
logNodeMessage(node); |
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.
Hm? Seems it deletes the "Running" text prefix. +1 from me for annotated logs, but I'm not sure how good it will appear in plain text
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.
Yeah, I see the "Running:" prefix at the beginning of each metadata line as a way to easily identify metadata logs, but it is redundant now since we have the "[Workflow]" prefix, and it is quite obvious that a step is "Running" when you see something like [Workflow] node {
or [Workflow] echo
.
The plain text version would be something like this (where is still easy to identify the metadata log lines IMO):
Started by user anonymous
[Workflow] Allocate node : Start
Running on master in /home/amuniz/workspace-cloudbees/workflow-plugin/aggregator/work/jobs/test/workspace
[Workflow] node {
[Workflow] echo
Hi!
[Workflow] git
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/amuniz/maven-helloworld.git # timeout=10
Fetching upstream changes from https://github.com/amuniz/maven-helloworld.git
> git --version # timeout=10
> git fetch --tags --progress https://github.com/amuniz/maven-helloworld.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 197d621fea6a797cbb4a158df573580a83fd8b4f (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 197d621fea6a797cbb4a158df573580a83fd8b4f
> git rev-list 197d621fea6a797cbb4a158df573580a83fd8b4f # timeout=10
[Workflow] stage: After Git Clone
Entering stage After Git Clone
Proceeding
[Workflow] echo
Bye!
[Workflow] sh
[workspace] Running shell script
mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building example 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ example ---
...
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.
Yes, it's much better
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.
Looks great ... a lot less noise.
@amuniz Have you considered something like that?
|
@recena I followed the proposal described in JENKINS-30088. I personally like the current format, since there is a fixed length prefix that allows to easily identify metadata related log lines. |
disclaimer: I have not read the dull PR just skimmed though a few comments and the unit tests. So a big thing is that the logs are cluttered and contain redundant (to me) information and miss some vital information.
So if you have
|
Both log lines were there before, I just replaced
Right. This a general log representation where every node with an execution body is represented as
Then the logging inside |
So i think then i am saying the jira is off the mark. To focus on the dsl the cruft should be removed so you have dsly stuff, stuff that is important in the context of the step and the outputs if any of the step. If you leave the clutter in then the dslish does not have as much use. If you use the dsl when it is not the dsl (retry loops) then this makes thing far worse for understandability. |
StepDescriptor d = getDescriptor(); | ||
boolean isBody = getStartNode().isBody(); | ||
if (isBody) { | ||
return "} //" + (d != null ? d.getFunctionName() : getStartNode().getStepName()); |
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.
Is there an opening curly brace somewhere else?
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.
Ah, I see it below ... ignore :)
🐝 insofar as I get it .... kinda skimmed through it. |
🐝 |
I think we do, if possible, but at least for the case of |
@@ -163,6 +177,19 @@ public BallColor getIconColor() { | |||
protected abstract String getTypeDisplayName(); | |||
|
|||
/** | |||
* Gets the function name for this type of node. | |||
* | |||
* Note that this method should be abstract (suppossed to be implemented in all subclasses), but keeping |
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.
typo
Minor comments but 🐝 if you want to stop here. As noted earlier, we can improve the display of block steps later. |
BTW please include a note in |
@jglick I fixed some things. I can improve the use console note CSS later (and once I know how). |
🐝 go for it @amuniz |
@reviewbybees done |
This pull request has completed our internal processes and we now respectfully request the maintainers of this repository to consider our proposal contained within this pull request for merging. |
* @return the text human-readable representation of the step function name | ||
* or {@link FlowNode#getDisplayName()} by default (if not overriden in subclasses) | ||
*/ | ||
protected /* abstract */ String getTypeFunctionName() { |
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.
Still seems like a poor name choice, since it is only a function name in the case of StepAtomNode
s.
[JENKINS-30088] Clean up step display in logs
JENKINS-30088
Note that the first point described in the JIRA issue is fixed in #211 which is more focused on the Snippet Generator clean up.
A screenshot showing how the logs are printed given the following script:
I'm not an UX expert, so any comment on how metadata log lines and the rest of the build log could live better together will be welcome!
@reviewbybees