[JIRA] (JENKINS-37823) Pipeline Model: Add a "wrappers" section

2 views
Skip to first unread message

andrew.bayer@gmail.com (JIRA)

unread,
Aug 30, 2016, 6:07:02 PM8/30/16
to jenkinsc...@googlegroups.com
Andrew Bayer created an issue
 
Jenkins / Story JENKINS-37823
Pipeline Model: Add a "wrappers" section
Issue Type: Story Story
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2016/Aug/30 10:06 PM
Environment: Pipeline Model 0.1
Priority: Minor Minor
Reporter: Andrew Bayer

We should add a "wrappers" section for specifying things like withCredentials, timeout and the like across the entire build rather than just within the steps for a given stage.

A couple notes - this will need to only be for block-scoped Pipeline steps, not for BuildWrapper, since the latter require a node context. And this'll be a little tricky to implement since we want to be able to specify a wrapper step and any of its arguments and then invoke each of those steps with the rest of the build (including subsequent wrapper steps) in a closure passed to those steps...

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Oct 20, 2016, 10:06:03 AM10/20/16
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Story JENKINS-37823
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Oct 21, 2016, 10:08:01 AM10/21/16
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Story JENKINS-37823
 
Re: Pipeline Model: Add a "wrappers" section

Started work on this, but it's harder to get a good way to translate the syntax to translate at runtime than you might think. I put this down for a couple days to let my mind subconsciously stew on it for a bit. =)

scm_issue_link@java.net (JIRA)

unread,
Oct 24, 2016, 5:59:04 AM10/24/16
to jenkinsc...@googlegroups.com

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/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
pipeline-model-definition/src/test/resources/errors/pipelineStepWithinOtherBlocksFailure.groovy
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/f25d40a2a5ffe0469ce80b070610d07fcdd3bb2a
Log:
[FIXED JENKINS-39011] Error out at parse time when pipeline step is nested.

We don't want to support nesting the pipeline step within other blocks

  • until JENKINS-38152, we never noticed that this was actually
    possible, since the parse-time validation just ignored any Jenkinsfile
    without a root-level pipeline step, but with JENKINS-38152, we not
    only do another parse round but need to grab the stages from the model
    to attach to the run, so we hit an NPE when there's a pipeline step
    nested under other blocks.

So - this will now catch when the pipeline step is nested within
another block and give an error message at parse-time, rather than
NPEing at runtime. There is a valid use case for wanting to wrap the
entire build in something like a timeout or timestamper, but we're
going to address that with JENKINS-37823.

andrew.bayer@gmail.com (JIRA)

unread,
Oct 24, 2016, 8:31:08 AM10/24/16
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Oct 24, 2016, 8:32:01 AM10/24/16
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Nov 1, 2016, 6:06:02 PM11/1/16
to jenkinsc...@googlegroups.com
Change By: Andrew Bayer
Status: In Review Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Nov 1, 2016, 6:06:06 PM11/1/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:

pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStep.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWrapper.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWrappers.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Wrappers.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/WrappersToMap.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/WrappersToMapTranslator.groovy
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/WrappersTest.java
pipeline-model-definition/src/test/resources/errors/invalidWrapperType.groovy
pipeline-model-definition/src/test/resources/json/errors/invalidWrapperType.json
pipeline-model-definition/src/test/resources/json/multipleWrappers.json
pipeline-model-definition/src/test/resources/json/simpleWrapper.json
pipeline-model-definition/src/test/resources/multipleWrappers.groovy
pipeline-model-definition/src/test/resources/simpleWrapper.groovy
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/b01db8aa6e692e06c8228e0891ca8f06aac4aa02
Log:
[FIXED JENKINS-37823] Added "wrappers" section.

scm_issue_link@java.net (JIRA)

unread,
Nov 2, 2016, 6:07:02 AM11/2/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStep.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWrapper.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWrappers.java
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Wrappers.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/WrappersToMap.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy

pipeline-model-definition/src/main/resources/ast-schema.json


pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/WrappersToMapTranslator.groovy
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/WrappersTest.java
pipeline-model-definition/src/test/resources/errors/invalidWrapperType.groovy
pipeline-model-definition/src/test/resources/json/errors/invalidWrapperType.json
pipeline-model-definition/src/test/resources/json/multipleWrappers.json
pipeline-model-definition/src/test/resources/json/simpleWrapper.json
pipeline-model-definition/src/test/resources/multipleWrappers.groovy
pipeline-model-definition/src/test/resources/simpleWrapper.groovy

[FIXED JENKINS-37823] Added "wrappers" section.

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:45 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