[JIRA] [label-linked-jobs-plugin] (JENKINS-29367) Unable to use label expression to restrict execution on more than one label

3 views
Skip to first unread message

sorin.sbarnea@gmail.com (JIRA)

unread,
Jul 12, 2015, 8:28:01 AM7/12/15
to jenkinsc...@googlegroups.com
Sorin Sbarnea created an issue
 
Jenkins / Bug JENKINS-29367
Unable to use label expression to restrict execution on more than one label
Issue Type: Bug Bug
Assignee: Dominique Brice
Components: label-linked-jobs-plugin
Created: 12/Jul/15 12:27 PM
Priority: Minor Minor
Reporter: Sorin Sbarnea

Somehow I am unable to find a way to introduce more than a label in label expresison field of the job configuration. I tried any combination and it seems impossible to write something else than just a single label.

I don't know if that's just because I do not know the magic syntax but also the help text is completly missing to tell which kind of syntax you can put inside. In my case I wanted A && B kind of condition.

Even if that's only lack of knowledge this bug is still valid because the help-text does not contain any example.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

domi.brice@free.fr (JIRA)

unread,
Jul 12, 2015, 10:23:03 AM7/12/15
to jenkinsc...@googlegroups.com
Dominique Brice updated an issue
Change By: Dominique Brice
Component/s: core
Component/s: label-linked-jobs-plugin

domi.brice@free.fr (JIRA)

unread,
Jul 12, 2015, 10:35:01 AM7/12/15
to jenkinsc...@googlegroups.com
Dominique Brice commented on Bug JENKINS-29367
 
Re: Unable to use label expression to restrict execution on more than one label

Hello Sorin

Your issue is not linked to the label-linked-jobs-plugin so I changed its component to "core". Label functionality is provided by the core engine of Jenkins.
This being said I didn't find either documentation of the available expressions, although I know where to look in the code (there and there).
The available operators are:

  • &&, logical and. Both labels must be present on the node to execute the job.
  • ||, logical or. At least one of the labels must be present on the node to execute the job
  • !, logical not. The label must not be present on the node to execute the job
  • ->, implies operator. If your condition is a -> b, then if label a is present on the node, b must also be present to run the job. If a is not defined, there's no requirement on b
  • <->, 'equivalent' operator. If your condition is a <-> b, then either both or nore of the two labels must be defined on the node to run the job. If only a or only b is defined on the node, the job won't be run on it.

domi.brice@free.fr (JIRA)

unread,
Jul 12, 2015, 10:36:06 AM7/12/15
to jenkinsc...@googlegroups.com
Dominique Brice edited a comment on Bug JENKINS-29367
Hello Sorin

Your issue is not linked to the
 [  label-linked-jobs-plugin |https://wiki.jenkins-ci.org/display/JENKINS/Label+Linked+Jobs+Plugin]  so I changed its component to "core". Label functionality is provided by the core engine of Jenkins.
This being said I didn't find either documentation of the available expressions, although I know where to look in the code ([there|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/grammar/labelExpr.g] and [there|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/labels/LabelExpression.java]).
The available operators are:
* {{&&}}, logical and. Both labels must be present on the node to execute the job.
* {{||}}, logical or. At least one of the labels must be present on the node to execute the job
*  {{!}}, logical not. The label must not be present on the node to execute the job
* {{->}}, implies operator. If your condition is a -> b, then if label a is present on the node, b must also be present to run the job. If a is not defined, there's no requirement on b
* {{<\->}}, 'equivalent' operator. If your condition is a <-> b, then either both or nore of the two labels must be defined on the node to run the job. If only a or only b is defined on the node, the job won't be run on it.

domi.brice@free.fr (JIRA)

unread,
Jul 12, 2015, 10:37:01 AM7/12/15
to jenkinsc...@googlegroups.com

domi.brice@free.fr (JIRA)

unread,
Jul 12, 2015, 10:38:01 AM7/12/15
to jenkinsc...@googlegroups.com
Dominique Brice edited a comment on Bug JENKINS-29367
Hello Sorin

Your issue is not linked to the [label-linked-jobs-plugin|https://wiki.jenkins-ci.org/display/JENKINS/Label+Linked+Jobs+Plugin] so I changed its component to "core". Label functionality is provided by the core engine of Jenkins.
This being said I didn't find either documentation of the available expressions, although I know where to look in the code ([there|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/grammar/labelExpr.g] and [there|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/labels/LabelExpression.java]).
The available operators are:
* {{&&}} logical and. Both labels must be present on the node to execute the job.
* {{||}} logical or. At least one of the labels must be present on the node to execute the job
*  {{!}} logical not. The label must not be present on the node to execute the job
* {{->}} implies operator. If your condition is a -> b, then if label a is present on the node, b must also be present to run the job. If a is not defined, there's no requirement on b
* {{<\->}} 'equivalent' operator. If your condition is a <-> b, then either both or nore of the two labels must be defined on the node to run the job. If only a or only b is defined on the node, the job won't be run on it.


If you can provide additional details and screenshots of what you're trying to achieve I'll be happy to help.

domi.brice@free.fr (JIRA)

unread,
Jan 14, 2016, 8:00:05 PM1/14/16
to jenkinsc...@googlegroups.com

sorin.sbarnea@gmail.com (JIRA)

unread,
Jun 14, 2018, 9:45:02 AM6/14/18
to jenkinsc...@googlegroups.com
Sorin Sbarnea closed an issue as Not A Defect
Change By: Sorin Sbarnea
Status: Open Closed
Resolution: Not A Defect
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

michael.kriese@visualon.de (JIRA)

unread,
Sep 10, 2019, 8:24:02 AM9/10/19
to jenkinsc...@googlegroups.com
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages