[JIRA] (JENKINS-42771) Upgraded 1.1.1 of Pipeline Model Definition plugin throws error parsing concatenated variable-name/value strings

4 views
Skip to first unread message

stephen.donner@gmail.com (JIRA)

unread,
Mar 14, 2017, 4:16:01 PM3/14/17
to jenkinsc...@googlegroups.com
Stephen Donner created an issue
 
Jenkins / Bug JENKINS-42771
Upgraded 1.1.1 of Pipeline Model Definition plugin throws error parsing concatenated variable-name/value strings
Issue Type: Bug Bug
Assignee: Andrew Bayer
Attachments: support_2017-03-14_20.10.38.zip
Components: pipeline-model-definition-plugin
Created: 2017/Mar/14 8:15 PM
Environment: Jenkins: 2.32.3
Pipeline: Declarative Agent API - 1.1.1
Pipeline: Declarative Extension Points API - 1.1.1
Pipeline: Model Definition - 1.1.1
Pipeline Model API - 1.1.1
Pipeline: Stage Tags Metadata - 1.1.1
Priority: Minor Minor
Reporter: Stephen Donner

Steps to Reproduce:

  1. Given https://github.com/mozilla/fxapom/blob/0f3b3cdb161940614ef50f2203a4633df1464c74/Jenkinsfile#L19
  2. Run a job with the above Jenkinsfile

Actual Results:

We get:

 

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 19: Environment variable values must either be strings or function calls. @ line 19, column 5.
PYTEST_ADDOPTS =
^
 
1 error
 
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:430)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:393)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:238)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)

Finished: FAILURE

Full console output here: https://gist.github.com/stephendonner/3b31a61c9456517888089ab025c63046

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

stephen.donner@gmail.com (JIRA)

unread,
Mar 14, 2017, 4:17:01 PM3/14/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Mar 14, 2017, 4:18:01 PM3/14/17
to jenkinsc...@googlegroups.com

Well, huh. The new parsing doesn't like the multiline statement, apparently. In the immediate, can you move that all onto one line, while I try to figure out whether we can actually support this syntax going forward?

andrew.bayer@gmail.com (JIRA)

unread,
Mar 14, 2017, 4:21:01 PM3/14/17
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Bug JENKINS-42771
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Mar 14, 2017, 5:27:01 PM3/14/17
to jenkinsc...@googlegroups.com

PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/139 - aiming at this going into a 1.1.2 that'll come out probably beginning of next week (once I'm fairly confident we won't get bit by more regression bugs coming in).

andrew.bayer@gmail.com (JIRA)

unread,
Mar 14, 2017, 5:27:01 PM3/14/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Mar 21, 2017, 7:45:02 PM3/21/17
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Mar 21, 2017, 7:45:02 PM3/21/17
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-42771
 
Re: Upgraded 1.1.1 of Pipeline Model Definition plugin throws error parsing concatenated variable-name/value strings

Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/EnvironmentTest.java
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
pipeline-model-definition/src/test/resources/errors/invalidMultiExpressionEnvironment.groovy
pipeline-model-definition/src/test/resources/multiExpressionEnvironment.groovy
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/577eb300baf578cd5d583bf02891acf862b3b308
Log:
[FIXED JENKINS-42771] Allow + binary expressions in env values

This worked previously because we didn't actually pay attention to
what was really in the value for an environment variable in the AST
model, only at runtime. And the runtime parsing worked differently, so
it did fine with `FOO = "A" + "B" + "C"`. Well, now so does the AST
model. Yay!

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:27 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages