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

BlueOcean editor: does not allow empty string for label on agent or node

    XMLWordPrintable

    Details

    • Sprint:
      Blue Ocean 1.6 - beta 2, Blue Ocean - 1.6 - beta 4
    • Similar Issues:

      Description

      Node and agent label strings in Pipeline can be an empty string '', but BlueOcean editor does not allow it be blank (see attached).

        Attachments

          Issue Links

            Activity

            Hide
            jbriden Jenn Briden added a comment -

            Andrew Bayer, with your change, do we need to do any updates to the frontend editor?

            Show
            jbriden Jenn Briden added a comment - Andrew Bayer , with your change, do we need to do any updates to the frontend editor?
            Hide
            abayer Andrew Bayer added a comment -

            I don’t believe so, no.

            Show
            abayer Andrew Bayer added a comment - I don’t believe so, no.
            Hide
            nicu Nicolae Pascu added a comment -

            Awesome, thanks Andrew Bayer, I will close this issue then.

            Show
            nicu Nicolae Pascu added a comment - Awesome, thanks Andrew Bayer , I will close this issue then.
            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/ModelASTAgent.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParserTest.java
            pipeline-model-definition/src/test/resources/agentLabelEmptyString.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/c18ba8695ff32a4cb81e711aaed5ee8a5718021e
            Log:
            JENKINS-43016 Convert empty string label agent to agent any in JSON

            This'll make the editor happier - the label agent type does require an
            argument, but an empty string is a valid (but weird) use case. The
            editor, however, has no way of distinguishing between "you didn't
            specify a label" and "you specified an empty string for the
            label". There still should be work in the editor to figure out how to
            actually handle this situation, but this fix at least will unbreak
            existing Jenkinsfiles with empty string label agents being opened in
            the editor, by converting the JSON in that case to be `agent any`,
            which is functionally equivalent if no additional options are specified.

            However, if additional options are specified (such as
            `customWorkspace`), we have to punt and keep using the empty string
            label agent.

            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/ModelASTAgent.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParserTest.java pipeline-model-definition/src/test/resources/agentLabelEmptyString.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/c18ba8695ff32a4cb81e711aaed5ee8a5718021e Log: JENKINS-43016 Convert empty string label agent to agent any in JSON This'll make the editor happier - the label agent type does require an argument, but an empty string is a valid (but weird) use case. The editor, however, has no way of distinguishing between "you didn't specify a label" and "you specified an empty string for the label". There still should be work in the editor to figure out how to actually handle this situation, but this fix at least will unbreak existing Jenkinsfiles with empty string label agents being opened in the editor, by converting the JSON in that case to be `agent any`, which is functionally equivalent if no additional options are specified. However, if additional options are specified (such as `customWorkspace`), we have to punt and keep using the empty string label agent.
            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/ModelASTAgent.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParserTest.java
            pipeline-model-definition/src/test/resources/agentLabelEmptyString.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/c3dc1ea6badcabe2c3c383c561e1e986ea30e0e2
            Log:
            Merge pull request #264 from abayer/jenkins-43016

            JENKINS-43016 Convert empty string label agent to agent any in JSON

            Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/3b74fc799c00...c3dc1ea6badc
            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            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/ModelASTAgent.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParserTest.java pipeline-model-definition/src/test/resources/agentLabelEmptyString.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/c3dc1ea6badcabe2c3c383c561e1e986ea30e0e2 Log: Merge pull request #264 from abayer/jenkins-43016 JENKINS-43016 Convert empty string label agent to agent any in JSON Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/3b74fc799c00...c3dc1ea6badc * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

              People

              • Assignee:
                nicu Nicolae Pascu
                Reporter:
                bitwiseman Liam Newman
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: