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

Snippetizer broken for DownstreamBuildSelector with Jenkins Pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Copy artifact is throwing a NPE when pointing at Jenkins Pipelines in the Jenkins Pipeline snippet generator when creating a copy artifact step using the DownstreamBuildSelector:

      Caused by: java.lang.NullPointerException
      	at hudson.plugins.copyartifact.DownstreamBuildSelector$DescriptorImpl.doCheckUpstreamProjectName(DownstreamBuildSelector.java:198)
      	at sun.reflect.GeneratedMethodAccessor1349.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            JENKINS-32526 would fix the error, without making the validation actually work.

            Show
            jglick Jesse Glick added a comment - JENKINS-32526 would fix the error, without making the validation actually work.
            Hide
            ikedam ikedam added a comment -

            JENKINS-32526 fixed the error, but it warns "Not Found" when you specified pipeline jobs for the upstream project.

            I found that DownstreamBuildSelector cannot pick builds related to pipeline jobs, as it depends on AbstractBuild#getUpstreamRelationshipBuild to detect relationships, which can be applicable only to `AbstractProject`.

            I'll add a change to display to warn that DownstreamBuildSelector is applicable only to AbstractProject for now.

            Show
            ikedam ikedam added a comment - JENKINS-32526 fixed the error, but it warns "Not Found" when you specified pipeline jobs for the upstream project. I found that DownstreamBuildSelector cannot pick builds related to pipeline jobs, as it depends on AbstractBuild#getUpstreamRelationshipBuild to detect relationships, which can be applicable only to `AbstractProject`. I'll add a change to display to warn that DownstreamBuildSelector is applicable only to AbstractProject for now.
            Show
            ikedam ikedam added a comment - https://github.com/jenkinsci/copyartifact-plugin/pull/84
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
            src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName.html
            src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName_ja.html
            src/main/resources/hudson/plugins/copyartifact/Messages.properties
            src/main/resources/hudson/plugins/copyartifact/Messages_ja.properties
            src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java
            http://jenkins-ci.org/commit/copyartifact-plugin/cafa6135bccb864c5aaadb8af3614d343498a15c
            Log:
            JENKINS-33578 Displays error or warning messages when applied DownstreamBuildSelector to Workflow jobs.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName.html src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName_ja.html src/main/resources/hudson/plugins/copyartifact/Messages.properties src/main/resources/hudson/plugins/copyartifact/Messages_ja.properties src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/cafa6135bccb864c5aaadb8af3614d343498a15c Log: JENKINS-33578 Displays error or warning messages when applied DownstreamBuildSelector to Workflow jobs.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java
            http://jenkins-ci.org/commit/copyartifact-plugin/2e349bea6791d31799defad01649a09d902b1ac7
            Log:
            JENKINS-33578 Removed a test for doAutoCompleteUpstreamProjectName for DownstreamBuildSelector. Workflow projects continue to be listed as allow to complete folder names.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/2e349bea6791d31799defad01649a09d902b1ac7 Log: JENKINS-33578 Removed a test for doAutoCompleteUpstreamProjectName for DownstreamBuildSelector. Workflow projects continue to be listed as allow to complete folder names.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
            src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java
            http://jenkins-ci.org/commit/copyartifact-plugin/53af7b06084f5af8912a564d200951988ee635b6
            Log:
            JENKINS-33578 Improved the message when the upstream is non-AbstractProject for DownstreamBuildSelector.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/53af7b06084f5af8912a564d200951988ee635b6 Log: JENKINS-33578 Improved the message when the upstream is non-AbstractProject for DownstreamBuildSelector.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
            src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName.html
            src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName_ja.html
            src/main/resources/hudson/plugins/copyartifact/Messages.properties
            src/main/resources/hudson/plugins/copyartifact/Messages_ja.properties
            src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java
            http://jenkins-ci.org/commit/copyartifact-plugin/12ec59c7e8992850d55b8d35613326d90a5b0bfd
            Log:
            Merge pull request #84 from ikedam/feature/JENKINS-33578_DownstreamBuildSelectorForWorkflow

            JENKINS-33578 DownstreamBuildSelector is not applicable to Workflow jobs.

            Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/0e4974f90951...12ec59c7e899

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName.html src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName_ja.html src/main/resources/hudson/plugins/copyartifact/Messages.properties src/main/resources/hudson/plugins/copyartifact/Messages_ja.properties src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/12ec59c7e8992850d55b8d35613326d90a5b0bfd Log: Merge pull request #84 from ikedam/feature/ JENKINS-33578 _DownstreamBuildSelectorForWorkflow JENKINS-33578 DownstreamBuildSelector is not applicable to Workflow jobs. Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/0e4974f90951...12ec59c7e899
            Hide
            ikedam ikedam added a comment -

            Released 1.38 containing this fix.
            It will be available in the update center in a day.

            Show
            ikedam ikedam added a comment - Released 1.38 containing this fix. It will be available in the update center in a day.

              People

              • Assignee:
                ikedam ikedam
                Reporter:
                apemberton Andy Pemberton
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: