Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: pipeline-model-definition-plugin
-
Labels:None
-
Environment:Parent POM 2.33
Jenkins 2.7.3
Declarative 1.2.2
-
Similar Issues:
Description
I am hoping to extend the Declarative Model Validator to provide linting services that have the team's policies / standards integrated. Working on a validator for ModelASTPostBuild I saw that the validator was being called twice.
My extension:
@Extension public class PostBuildValidator extends DeclarativeValidatorContributor { @CheckForNull @Override public String validateElement(@Nonnull ModelASTPostBuild postBuild, @CheckForNull FlowExecution execution) { return "abc" + postBuild.getName(); } }
My jenkinsfile:
pipeline { agent { label 'unix' } stages { stage('test'){ steps{ echo "test" } } } post { always{ echo "cleaning" deleteDir() } } }
Response from pipeline-model-converter/validateJenkinsfile:
{"status":"ok","data":{"result":"failure","errors":[
{"error":["abcpost @ line 12, column 3.","abcpost @ line 12, column 3."]}]}}
Attachments
Issue Links
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Description |
I am hoping to extend the Declarative Model Validator to provide linting services that have the team's policies / "style" integrated. Working on a validator for ModelASTPostBuild I saw that the validator was being called twice. My extension: {code:java} @Extension public class PostBuildValidator extends DeclarativeValidatorContributor { @CheckForNull @Override public String validateElement(@Nonnull ModelASTPostBuild postBuild, @CheckForNull FlowExecution execution) { return "abc" + postBuild.getName(); } } {code} My jenkinsfile: {code:java} pipeline { agent { label 'unix' } stages { stage('test'){ steps{ echo "test" } } } post { always{ echo "cleaning" deleteDir() } } } {code} Response from pipeline-model-converter/validateJenkinsfile: {"status":"ok","data":{"result":"failure","errors":[{"error":["abcpost @ line 12, column 3.","abcpost @ line 12, column 3."]}]}} |
I am hoping to extend the Declarative Model Validator to provide linting services that have the team's policies / standards integrated. Working on a validator for ModelASTPostBuild I saw that the validator was being called twice. My extension: {code:java} @Extension public class PostBuildValidator extends DeclarativeValidatorContributor { @CheckForNull @Override public String validateElement(@Nonnull ModelASTPostBuild postBuild, @CheckForNull FlowExecution execution) { return "abc" + postBuild.getName(); } } {code} My jenkinsfile: {code:java} pipeline { agent { label 'unix' } stages { stage('test'){ steps{ echo "test" } } } post { always{ echo "cleaning" deleteDir() } } } {code} Response from pipeline-model-converter/validateJenkinsfile: {"status":"ok","data":{"result":"failure","errors":[{"error":["abcpost @ line 12, column 3.","abcpost @ line 12, column 3."]}]}} |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | In Review [ 10005 ] |
Remote Link | This issue links to "PR #213 (Web Link)" [ 17989 ] |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10005 ] | Resolved [ 5 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Think I found it. Verifying now.