-
Notifications
You must be signed in to change notification settings - Fork 68
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-48344] Lightweight timestamp annotations #25
[JENKINS-48344] Lightweight timestamp annotations #25
Conversation
BTW this does not need #24. It could benefit from jenkinsci/jenkins#3662. |
|
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.
Oh and have not yet checked impact on
- per-step logs
- Blue Ocean
long buildStartTime = build.getStartTimeInMillis(); | ||
String html = text.toString(true); | ||
int start; | ||
if (html.startsWith("<span class=\"pipeline-new-node\" ")) { // cf. LogStorage.startStep |
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.
Unpleasant that this is necessary. Not sure if it is solvable upstream. You would probably expect that the MarkupText
is what is produced before this span
is added by FileLogStorage
.
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.
Overall approach looks good to me, just added some java.time suggestions. The Blue Ocean view seems kind of awkward, do you think there is any easy way to clean it up? CC @vivek to see what he thinks of how it looks in Blue Ocean.
src/main/java/hudson/plugins/timestamper/pipeline/GlobalDecorator.java
Outdated
Show resolved
Hide resolved
src/main/java/hudson/plugins/timestamper/pipeline/GlobalDecorator.java
Outdated
Show resolved
Hide resolved
src/main/java/hudson/plugins/timestamper/pipeline/GlobalAnnotator.java
Outdated
Show resolved
Hide resolved
<java.level>7</java.level> | ||
<revision>1.8.11</revision> | ||
<changelist>-SNAPSHOT</changelist> | ||
<jenkins.version>2.121.1</jenkins.version> |
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.
Quite a jump, although required for the JEP-210 updates. Here are stats for the plugin's usage by Jenkins core version: http://stats.jenkins.io/pluginversions/timestamper.html. According to those stats, 89.63% of users of timestamper-1.8.10 are on Jenkins 2.121.1 or newer, so this looks reasonable to me.
Only by having Blue Ocean implement a custom display hook, like it did for ANSI coloration. Since BO ignores |
…he middle of a line.
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.
@StevenGBrown Would you be able to take a look at this please?
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.
LGTM
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.
LGTM
I have requested comaintainership of this plugin. According to policy, there is a two-week waiting period. |
Possible casualty (untested): |
@jglick Can you indicate how to use the plugin in a Jenkinsfile via the "global option", as opposed to having to wrap blocks within each of the "steps"? I can't find any example of that, and have tried to get an answer from @StevenGBrown on https://wiki.jenkins.io/pages/viewpage.action?pageId=46334448 with no success. |
You do not—it is global configuration (whether specified in the UI or |
What is the default setting on the "all pipelines" config? Is it set by default? |
No, it is off by default, to minimize the behavioral change caused by merely updating the plugin. |
It seems to me that hitting Could this be a side-effect of this change? |
@alde quite possibly. I am unaware of that URL pattern or what it is supposed to do. |
With version 1.9 nothing I put in time={} has any effect anymore. I'll look at whether downgrading to 1.8 will have an effect. Anyhow, this may be an indication of a regression.
|
I see, there are some scripting URLs which apparently have no test coverage. As noted in #25 (comment) there is also a Java API which I think has no test coverage. Probably needs some follow-up work to write proper test cases for all these things and make any adjustments needed for them to work with the new architecture. |
@jglick I think this has had a pretty serious side-effect on folks using timestamped, where the consoleText url now has timestamps, whereas before the raw text api url was timestamps. I was using the consoleText for multi-line parsing for numerous elements, which has been broken by this change. Is there a way to get the raw console text without the timestamps from the API? |
Not currently. IIRC there is a filed RFE for it. |
A cheap workaround could be to set the format to the empty string (id est, |
Unfortunately that doesn't work, as the timestamps are now persisted in the on-disk log:
|
That should be fixed as of 1.11.1 (see JENKINS-60007). |
JENKINS-48344
Uses jenkinsci/workflow-job-plugin#105 (and its upstreams) to implement much cheaper timestamping for Pipeline builds. Produces
log
file output likewhich gets rendered like
No
ConsoleNote
s needed.