Is there a way to ignore nested node commands?

49 views
Skip to first unread message

Michael Carter

unread,
Feb 4, 2021, 10:55:37 AM2/4/21
to Jenkins Developers
Not sure if this is the right place for this type of question... but

node {
   node('agent'){ 
   }
}

Any way to block the nested node.  Keep getting these developers writing loops with these nested nodes and wonder why their job with 4 levels of nesting is not running on an executor of 3.   (and all calling the same node)

I know firing them is always an option :)   Just wanted to see if there was a way to limit or block the nesting and have it just ignored.

Martin Schmude

unread,
Feb 6, 2021, 1:04:42 AM2/6/21
to Jenkins Developers
To my knowledge there isn't any such feature in Jenkins.
A code quality checker could be setup, that enforces coding conventions with nesting restrictions being one of them.

"... have it just ignored" - code that is regarded bad/buggy in your environment should not be ignored, but the developer be blamed.

But the outlined code fragment does not exhibit a nesting of 4 levels, it looks OK to me.
Do you mean something like
node {
  node('agent') {
    node(''agent') {
      node('agent') {
Which is indeed obviously flawed.



Reply all
Reply to author
Forward
0 new messages