Add node labels to Jenkins Pipelines traces#212
Merged
Conversation
added 2 commits
June 9, 2021 13:09
drodriguezhdez
force-pushed
the
drodriguezhdez/add_labels
branch
from
June 9, 2021 15:47
ff7e01a to
bcc573d
Compare
AdrianLC
reviewed
Jun 11, 2021
|
|
||
| // We want to avoid using Json libraries cause | ||
| // may cause incompatibilities on different Jenkins versions. | ||
| final StringBuilder sb = new StringBuilder(); |
There was a problem hiding this comment.
can there be quotes in Jenkins labels?
Collaborator
Author
There was a problem hiding this comment.
If you mean double quotes: no, Jenkins removes the double quotes (") when you configure the labels for the worker. Other characters are allowed (', $, %, etc..)
A valid label array could be:
["arch01","worker","''''asd''''","·$··$·$","asdasdasd"]
| final BuildPipelineNode executableChildNode = searchExecutableChildNode(node); | ||
| if(executableChildNode != null) { | ||
| node.setPropagatedNodeName(executableChildNode.getNodeName()); | ||
| node.setPropagatedNodeLabels(executableChildNode.getNodeLabels()); |
There was a problem hiding this comment.
are you propagating it from job spans to stage/pipeline? I guess that's accurate for Jenkins?
Collaborator
Author
There was a problem hiding this comment.
Yes, the worker information only is available in an actual executable child node, which is a job.
AdrianLC
previously approved these changes
Jun 14, 2021
hithwen
approved these changes
Jun 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements for Contributing to this repository
What does this PR do?
This PR adds the Node Labels to the Jenkins Pipelines traces using the tag
ci.node.labels.Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.