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

lockable-resources resource autocomplete creates faulty resource names

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Locking a job with a resource name won't work, if using the autocompleted resource name. Two jobs requiring the same lock can be run in parallel.

      Steps to reproduce:

      1. In the Jenkins configuration, create a lockable resource called 'abcd'
      2. Create a new freestyle job, in the configuration choose 'This build requires lockable resources' and type 'ab' to 'Resources'. The autocomplete should now offer you 'abcd', click on that.
      3. Click save.
      4. Build your new project.
      5. Open the console. It should say

      [lockable-resources] acquired lock on [](it should have said acquired lock on [abcd].

      The problem seems to be, that the plugin writes to the jobs config.xml an extra space character, e.g.

      <resourceNames>abcd </resourceNames>

      instead of <resourceNames>abcd</resourceNames>

       

       

        Attachments

          Issue Links

            Activity

            aga Aleksi Aalto created issue -
            Hide
            aga Aleksi Aalto added a comment -

            Added a PR: https://github.com/jenkinsci/lockable-resources-plugin/pull/76

            This solves the trailing whitespace in config.xm problem, but not the "acquired lock on []" problem, which seems to be a different one.

            Show
            aga Aleksi Aalto added a comment - Added a PR: https://github.com/jenkinsci/lockable-resources-plugin/pull/76 This solves the trailing whitespace in config.xm problem, but not the "acquired lock on []" problem, which seems to be a different one.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Aleksi Aalto
            Path:
            src/main/java/org/jenkins/plugins/lockableresources/RequiredResourcesProperty.java
            http://jenkins-ci.org/commit/lockable-resources-plugin/300d4b1d6aae030daba46e174b507a5a00e38630
            Log:
            Trim trailing whitespace in resourcenames

            If not trimmed, the trailing whitespaces will find their way
            to the jobs config.xml, causing confusion.

            Trailing whitespaces in resourcenames are caused also by the
            autocompletion script, that suggests resourcenames.

            JIRA Issue: https://issues.jenkins-ci.org/browse/JENKINS-47235

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Aleksi Aalto Path: src/main/java/org/jenkins/plugins/lockableresources/RequiredResourcesProperty.java http://jenkins-ci.org/commit/lockable-resources-plugin/300d4b1d6aae030daba46e174b507a5a00e38630 Log: Trim trailing whitespace in resourcenames If not trimmed, the trailing whitespaces will find their way to the jobs config.xml, causing confusion. Trailing whitespaces in resourcenames are caused also by the autocompletion script, that suggests resourcenames. JIRA Issue: https://issues.jenkins-ci.org/browse/JENKINS-47235
            Hide
            abayer Andrew Bayer added a comment - - edited

            Merged, releasing now as 2.1

            Show
            abayer Andrew Bayer added a comment - - edited Merged, releasing now as 2.1
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            krulls Stephan Krull made changes -
            Link This issue relates to JENKINS-43574 [ JENKINS-43574 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                aga Aleksi Aalto
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: