[JIRA] (JENKINS-38152) Jenkinsfile schema Java API as WorkflowRun action

2 views
Skip to first unread message

vivek.pandey@gmail.com (JIRA)

unread,
Sep 12, 2016, 8:17:01 PM9/12/16
to jenkinsc...@googlegroups.com
Vivek Pandey created an issue
 
Jenkins / Task JENKINS-38152
Jenkinsfile schema Java API as WorkflowRun action
Issue Type: Task Task
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2016/Sep/13 12:16 AM
Priority: Minor Minor
Reporter: Vivek Pandey

Kyoto has REST API to expose Jenkinsfile schema in JSON format. Pipeline editor in BO needs to call this API and this would needed to be exposed using pipeline API actions so that pipeline editor UI can call it by looking at 'actions' element in pipeline API response.

As discussed with Andrew Bayer the schema parsing Java API can be exposed as action on WorkflowAction.

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

mneale@cloudbees.com (JIRA)

unread,
Sep 13, 2016, 12:36:02 AM9/13/16
to jenkinsc...@googlegroups.com
Michael Neale commented on Task JENKINS-38152
 
Re: Jenkinsfile schema Java API as WorkflowRun action

I am not sure how this relates to the editor - wont it operate on the JSON model and be passing that around? What am I missing?

vivek.pandey@gmail.com (JIRA)

unread,
Sep 13, 2016, 1:36:01 AM9/13/16
to jenkinsc...@googlegroups.com

How does editor get the JSON model? My understanding talking to James Dumay is that editor will get hold of the JSON using this API.

mneale@cloudbees.com (JIRA)

unread,
Sep 13, 2016, 1:43:01 AM9/13/16
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Sep 13, 2016, 12:51:04 PM9/13/16
to jenkinsc...@googlegroups.com

So if I remember correctly, what's being looked for here is specifically the stage execution order/info, right? Do we want the synthetic stages too or just the "real" ones?

jdumay@cloudbees.com (JIRA)

unread,
Sep 13, 2016, 1:08:01 PM9/13/16
to jenkinsc...@googlegroups.com

Michael Neale Vivek Pandey the REST endpoint is something we probably want to host under our URL structure at /org/pipelines/My Pipeline/model or something?

svanoort@cloudbees.com (JIRA)

unread,
Sep 13, 2016, 2:06:02 PM9/13/16
to jenkinsc...@googlegroups.com

Do we really need such a complex API just to do ordering? Esp when the new Bismuth APIs will already do ordering, and we already have stage ordering?

andrew.bayer@gmail.com (JIRA)

unread,
Sep 13, 2016, 2:15:01 PM9/13/16
to jenkinsc...@googlegroups.com

Sam Van Oort - what's driving this is Blue Ocean being able to check what stages are going to run but have not run yet. With declarative Pipelines, we can say with certainty what stages/parallel branches are going to be executed in what order from the moment we parse the Jenkinsfile. Hence, this.

svanoort@cloudbees.com (JIRA)

unread,
Sep 15, 2016, 12:29:01 AM9/15/16
to jenkinsc...@googlegroups.com

Okay so that kind of helps make the use case clear, and makes sense now.

scm_issue_link@java.net (JIRA)

unread,
Sep 16, 2016, 5:38:02 PM9/16/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTAgent.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTBranch.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTBuildCondition.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTElement.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTEnvironment.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNamedArgumentList.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNotifications.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPositionalArgumentList.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPostBuild.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTSingleArgument.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStage.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStages.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStep.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTTools.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTTreeStep.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/Converter.groovy
src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/actions/ExecutionModelAction.java
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/f4899b814f15f8dadf153c70f0c3a103f2d757f1
Log:
First work on JENKINS-38152 - action/stripped stages

scm_issue_link@java.net (JIRA)

unread,
Sep 19, 2016, 1:34:02 PM9/19/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:

EXTENDING.md


src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTAgent.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTBranch.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTBuildCondition.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTElement.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTEnvironment.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNamedArgumentList.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNotifications.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPositionalArgumentList.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPostBuild.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTSingleArgument.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStage.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStages.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStep.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTTools.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTTreeStep.groovy
src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/Converter.groovy
src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/actions/ExecutionModelAction.java

src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/ModelConverterAction.java
src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/ErrorsEndpointOpsTest.java
src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/SuccessfulEndpointOpsTest.java
src/test/resources/executionModelAction.groovy
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/b385ba5d5015504e91ba9e297283282bd4ce94a5
Log:
Merge pull request #14 from abayer/jenkins-38152

JENKINS-38152 - expose execution model on WorkflowRun

Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/7ae4f284c762...b385ba5d5015

andrew.bayer@gmail.com (JIRA)

unread,
Sep 19, 2016, 1:37:01 PM9/19/16
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Fixed
 
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Fixed

mneale@cloudbees.com (JIRA)

unread,
Sep 20, 2016, 12:14:02 AM9/20/16
to jenkinsc...@googlegroups.com
Michael Neale commented on Task JENKINS-38152
 
Re: Jenkinsfile schema Java API as WorkflowRun action

Ryan Campbell we were talking about this - is already done.

scm_issue_link@java.net (JIRA)

unread,
Oct 24, 2016, 5:59:05 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.

bitwiseman@gmail.com (JIRA)

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