Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44039

editor failing on round trip with script block sometimes: hangs when saving due to quoted groovy script

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
    • Sprint:
      Blue Ocean 1.1-beta4, Blue Ocean 1.1, Blue Ocean 1.1, Blue Ocean 1.2-beta1, Blue Ocean 1.2-beta2, Blue Ocean 1.2-beta3, Blue Ocean 1.2-beta4, Blue Ocean 1.2, Blue Ocean 1.3
    • Similar Issues:

      Description

      When saving a script block with certain content (below) it will fail to save and "hang". There is actually an error response which is being not handled correctly. Furthermore, it should save in this case as it is a valid block of script (there is a problem it seems with single quoted strings, perhaps). 

       

      To reproduce: 

      • Open a pipeline in the editor
      • Add the a script block below
      • Save it to a branch
      • Note that it never appears to save, check the log in the browser for errors

      What should happen: 

       

      User should be given error feedback that there is a problem (IF it is invalid groovy), or it should cope with correct groovy script. 

       

      The script block which is valid groovy to try: 

      def initialize = load('jenkins/pipeline/initialize.groovy')
      initialize()
      
      echo 'done initializing'

       

       

      — original ticket —

      The behavior is: I open the editor and then either make a change or don't, and then go to Save, enter a description and click Save & Run.  the dialog greys out but no saving happens.  when the background of the browser window is clicked, the dialog disappears and I am back where I started.

      There is another pipeline that saves correctly.

      I've been editing the Jenkinsfile with the blueocean editor and also with IDEA. I've seen the editor refuse to load stuff I've created with the IDEA ide, which I then correct back in IDEA and then load into the BO editor. So since the Jenkinsfile loaded I'm assuming it was OK.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTValue.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BaseParserLoaderTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/JSONValidationTest.java
            pipeline-model-definition/src/test/resources/json/singleQuoteInMultiline.json
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/45389a1dc7be8e72681b696e70558c29b237b7cf
            Log:
            JENKINS-44039 Fix multiline script blocks containing single quotes

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTValue.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BaseParserLoaderTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/JSONValidationTest.java pipeline-model-definition/src/test/resources/json/singleQuoteInMultiline.json http://jenkins-ci.org/commit/pipeline-model-definition-plugin/45389a1dc7be8e72681b696e70558c29b237b7cf Log: JENKINS-44039 Fix multiline script blocks containing single quotes
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTValue.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BaseParserLoaderTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/JSONValidationTest.java
            pipeline-model-definition/src/test/resources/json/singleQuoteInMultiline.json
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/a1fa5a5891a0d1752b6906a20d4ca354dda47802
            Log:
            Merge pull request #187 from abayer/jenkins-44039

            JENKINS-44039 Fix multiline script blocks containing single quotes

            Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/1d2fc7f133d1...a1fa5a5891a0

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTValue.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BaseParserLoaderTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/JSONValidationTest.java pipeline-model-definition/src/test/resources/json/singleQuoteInMultiline.json http://jenkins-ci.org/commit/pipeline-model-definition-plugin/a1fa5a5891a0d1752b6906a20d4ca354dda47802 Log: Merge pull request #187 from abayer/jenkins-44039 JENKINS-44039 Fix multiline script blocks containing single quotes Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/1d2fc7f133d1...a1fa5a5891a0
            Hide
            abayer Andrew Bayer added a comment -

            Ok, the single-quote multiline thing is fixed. Might make sense to open a new ticket for the invalid Groovy case.

            Show
            abayer Andrew Bayer added a comment - Ok, the single-quote multiline thing is fixed. Might make sense to open a new ticket for the invalid Groovy case.
            Hide
            jamesdumay James Dumay added a comment -

            Nice. In 1.2, Andrew Bayer?

            Show
            jamesdumay James Dumay added a comment - Nice. In 1.2, Andrew Bayer ?
            Hide
            abayer Andrew Bayer added a comment -

            ahyup.

            Show
            abayer Andrew Bayer added a comment - ahyup.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                cantorman Dave Hildebrandt
              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: