Some Hudson installations use labels with spaces in their names. This used to be fine, but with the new label expression parser, you get a syntax error in this case. There is no apparent quote syntax either.

          [JENKINS-7216] Label Expression cannot handle spaces

          I'm afraid I'm not sure how to fix this.

          I suppose I could treat all the invalid expressions (or all the invalid expressions without '!' or '&' or '|', etc.) as an atom? Those atoms won't be usable inside an expression, but maybe that's acceptable?

          Kohsuke Kawaguchi added a comment - I'm afraid I'm not sure how to fix this. I suppose I could treat all the invalid expressions (or all the invalid expressions without '!' or '&' or '|', etc.) as an atom? Those atoms won't be usable inside an expression, but maybe that's acceptable?

          Jesse Glick added a comment -

          I would expect to be able to enclose complex labels inside some form of quotes, e.g.

          'hudson-solaris (Solaris)' || 'Windows 2008'
          

          Jesse Glick added a comment - I would expect to be able to enclose complex labels inside some form of quotes, e.g. 'hudson-solaris (Solaris)' || 'Windows 2008'

          thebillybobjr added a comment -

          Also, colons are not allowed.

          org.jvnet.hudson.reactor.ReactorException: java.lang.IllegalArgumentException: Illegal character in a token: 59404:SERVER2003
          at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246)
          at hudson.model.Hudson.executeReactor(Hudson.java:700)
          at hudson.model.Hudson.(Hudson.java:617)
          at hudson.model.Hudson.(Hudson.java:557)
          at hudson.WebAppMain$2.run(WebAppMain.java:222)
          Caused by: java.lang.IllegalArgumentException: Illegal character in a token: 59404:SERVER2003
          at hudson.model.Hudson.getLabelAtom(Hudson.java:1392)

          thebillybobjr added a comment - Also, colons are not allowed. org.jvnet.hudson.reactor.ReactorException: java.lang.IllegalArgumentException: Illegal character in a token: 59404:SERVER2003 at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246) at hudson.model.Hudson.executeReactor(Hudson.java:700) at hudson.model.Hudson.(Hudson.java:617) at hudson.model.Hudson.(Hudson.java:557) at hudson.WebAppMain$2.run(WebAppMain.java:222) Caused by: java.lang.IllegalArgumentException: Illegal character in a token: 59404:SERVER2003 at hudson.model.Hudson.getLabelAtom(Hudson.java:1392)

          rtyler reported the same issue. This issue appears to be very critical now.
          Working on a fix.

          Kohsuke Kawaguchi added a comment - rtyler reported the same issue. This issue appears to be very critical now. Working on a fix.

          Code changed in hudson
          User: : kohsuke
          Path:
          branches/rc/core/src/main/grammar/labelExpr.g
          branches/rc/core/src/main/java/hudson/model/AbstractProject.java
          branches/rc/core/src/main/java/hudson/model/Hudson.java
          branches/rc/core/src/main/java/hudson/model/Label.java
          branches/rc/core/src/main/java/hudson/model/labels/LabelAtom.java
          branches/rc/core/src/main/java/hudson/model/labels/LabelExpression.java
          branches/rc/core/src/main/resources/hudson/model/AbstractProject/help-assignedLabelString.html
          branches/rc/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
          branches/rc/test/src/test/java/hudson/model/labels/LabelExpressionTest.java
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/34000
          Log:
          [FIXED JENKINS-7216]
          Fixed a 1.372 regression in handling whitespace and other characters in label names.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: branches/rc/core/src/main/grammar/labelExpr.g branches/rc/core/src/main/java/hudson/model/AbstractProject.java branches/rc/core/src/main/java/hudson/model/Hudson.java branches/rc/core/src/main/java/hudson/model/Label.java branches/rc/core/src/main/java/hudson/model/labels/LabelAtom.java branches/rc/core/src/main/java/hudson/model/labels/LabelExpression.java branches/rc/core/src/main/resources/hudson/model/AbstractProject/help-assignedLabelString.html branches/rc/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java branches/rc/test/src/test/java/hudson/model/labels/LabelExpressionTest.java trunk/www/changelog.html http://jenkins-ci.org/commit/34000 Log: [FIXED JENKINS-7216] Fixed a 1.372 regression in handling whitespace and other characters in label names.

          dogfood added a comment -

          Integrated in hudson_main_trunk #216
          Merged revisions 34000-34001,34005,34007,34038 via svnmerge from
          https://www.dev.java.net/svn/hudson/branches/rc

          ........
          r34000 | kohsuke | 2010-08-20 14:16:13 -0700 (Fri, 20 Aug 2010) | 2 lines

          [FIXED JENKINS-7216]
          Fixed a 1.372 regression in handling whitespace and other characters in label names.
          ........
          r34001 | kohsuke | 2010-08-20 14:26:55 -0700 (Fri, 20 Aug 2010) | 1 line

          foo*bar parses just like foo-bar parses OK.
          ........
          r34005 | kohsuke | 2010-08-20 20:08:26 -0700 (Fri, 20 Aug 2010) | 1 line

          [maven-release-plugin] prepare release hudson-1_373
          ........
          r34007 | kohsuke | 2010-08-20 20:08:40 -0700 (Fri, 20 Aug 2010) | 1 line

          [maven-release-plugin] prepare for next development iteration
          ........
          r34038 | kohsuke | 2010-08-23 11:02:55 -0700 (Mon, 23 Aug 2010) | 1 line

          updated changelog as a part of the release
          ........

          kohsuke :
          Files :

          • /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelExpression.java
          • /trunk/hudson/main/core/src/main/java/hudson/model/Hudson.java
          • /trunk/hudson/main
          • /trunk/hudson/main/war/pom.xml
          • /trunk/hudson/main/test/pom.xml
          • /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java
          • /trunk/hudson/main/debian/debian/changelog
          • /trunk/hudson/main/maven-plugin/pom.xml
          • /trunk/hudson/main/pom.xml
          • /trunk/hudson/main/ui-samples-plugin/pom.xml
          • /trunk/hudson/main/core/src/main/resources/hudson/model/AbstractProject/help-assignedLabelString.html
          • /trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
          • /trunk/hudson/main/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
          • /trunk/hudson/main/core/src/main/java/hudson/model/Label.java
          • /trunk/hudson/main/core/pom.xml
          • /trunk/hudson/main/core/src/main/grammar/labelExpr.g
          • /trunk/hudson/main/test/src/test/java/hudson/model/labels/LabelExpressionTest.java
          • /trunk/hudson/main/remoting/pom.xml
          • /trunk/hudson/main/cli/pom.xml
          • /trunk/hudson/main/maven-interceptor/pom.xml
          • /trunk/hudson/main/maven-agent/pom.xml

          dogfood added a comment - Integrated in hudson_main_trunk #216 Merged revisions 34000-34001,34005,34007,34038 via svnmerge from https://www.dev.java.net/svn/hudson/branches/rc ........ r34000 | kohsuke | 2010-08-20 14:16:13 -0700 (Fri, 20 Aug 2010) | 2 lines [FIXED JENKINS-7216] Fixed a 1.372 regression in handling whitespace and other characters in label names. ........ r34001 | kohsuke | 2010-08-20 14:26:55 -0700 (Fri, 20 Aug 2010) | 1 line foo*bar parses just like foo-bar parses OK. ........ r34005 | kohsuke | 2010-08-20 20:08:26 -0700 (Fri, 20 Aug 2010) | 1 line [maven-release-plugin] prepare release hudson-1_373 ........ r34007 | kohsuke | 2010-08-20 20:08:40 -0700 (Fri, 20 Aug 2010) | 1 line [maven-release-plugin] prepare for next development iteration ........ r34038 | kohsuke | 2010-08-23 11:02:55 -0700 (Mon, 23 Aug 2010) | 1 line updated changelog as a part of the release ........ kohsuke : Files : /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelExpression.java /trunk/hudson/main/core/src/main/java/hudson/model/Hudson.java /trunk/hudson/main /trunk/hudson/main/war/pom.xml /trunk/hudson/main/test/pom.xml /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java /trunk/hudson/main/debian/debian/changelog /trunk/hudson/main/maven-plugin/pom.xml /trunk/hudson/main/pom.xml /trunk/hudson/main/ui-samples-plugin/pom.xml /trunk/hudson/main/core/src/main/resources/hudson/model/AbstractProject/help-assignedLabelString.html /trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java /trunk/hudson/main/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java /trunk/hudson/main/core/src/main/java/hudson/model/Label.java /trunk/hudson/main/core/pom.xml /trunk/hudson/main/core/src/main/grammar/labelExpr.g /trunk/hudson/main/test/src/test/java/hudson/model/labels/LabelExpressionTest.java /trunk/hudson/main/remoting/pom.xml /trunk/hudson/main/cli/pom.xml /trunk/hudson/main/maven-interceptor/pom.xml /trunk/hudson/main/maven-agent/pom.xml

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: