-
-
Notifications
You must be signed in to change notification settings - Fork 141
Write NewNodeConsoleNote to per-step logs instead of overall log #371
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ | |
| * @see LogStorage#startStep | ||
| */ | ||
| @Restricted(NoExternalUse.class) | ||
| public class NewNodeConsoleNote extends ConsoleNote<WorkflowRun> { | ||
| public class NewNodeConsoleNote extends ConsoleNote { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue is kind of interesting. I am not sure if it has been reported previously, but any console notes that rely on a Perhaps There do not seem to be many implementations that would trigger the issue, see here and here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, does this have anything to do with jenkinsci/jenkins#3662?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only tangentially I think, in that the whole API seems wrong. The problem as I see it is that when you create a Looking at actual usage, I think the context parameters in all associated classes should have just been hard-coded to be As far as what we can do compatibly, we could at least catch |
||
|
|
||
| private static final Logger LOGGER = Logger.getLogger(NewNodeConsoleNote.class.getName()); | ||
|
|
||
|
|
@@ -98,7 +98,7 @@ private NewNodeConsoleNote(FlowNode node) { | |
| } | ||
|
|
||
| @Override | ||
| public ConsoleAnnotator<?> annotate(WorkflowRun context, MarkupText text, int charPos) { | ||
| public ConsoleAnnotator<?> annotate(Object context, MarkupText text, int charPos) { | ||
| try { | ||
| StringBuilder startTag = startTagFor(context, id, start, enclosing); | ||
| text.addMarkup(0, text.length(), startTag.toString(), "</span>"); | ||
|
|
@@ -109,15 +109,20 @@ public ConsoleAnnotator<?> annotate(WorkflowRun context, MarkupText text, int ch | |
| } | ||
|
|
||
| @Restricted(NoExternalUse.class) | ||
| public static StringBuilder startTagFor(@NonNull WorkflowRun context, @NonNull String id, @CheckForNull String start, @CheckForNull String enclosing) { | ||
| public static StringBuilder startTagFor(@NonNull Object context, @NonNull String id, @CheckForNull String start, @CheckForNull String enclosing) { | ||
| StringBuilder startTag = new StringBuilder("<span class=\"pipeline-new-node\" nodeId=\"").append(id); | ||
| if (start != null) { | ||
| startTag.append("\" startId=\"").append(start); | ||
| } | ||
| if (enclosing != null) { | ||
| startTag.append("\" enclosingId=\"").append(enclosing); | ||
| } | ||
| FlowExecution execution = context.getExecution(); | ||
| FlowExecution execution = null; | ||
| if (context instanceof WorkflowRun) { | ||
| execution = ((WorkflowRun) context).getExecution(); | ||
| } else if (context instanceof FlowNode) { | ||
| execution = ((FlowNode) context).getExecution(); | ||
| } | ||
| if (execution != null) { | ||
| try { | ||
| FlowNode node = execution.getNode(id); | ||
|
|
||
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.
Should be fixable, but I am not going to bother looking into it unless I really want to get this merged.