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

Link from triggering promotion to triggered build

    XMLWordPrintable

Details

    Description

      When "Trigger a parameterized build" is used in a promotion step, there is no link to the parameterized build that was actually started.

      In the promotion, it looks like this following:

      Building on master in workspace /var/lib/jenkins/jobs/Main Build/workspace
      Promoting Main Build #222
      build hudson.plugins.parameterizedtrigger.BuildTrigger@25765df0 SUCCESS
      Marking build to keep forever.
      build hudson.plugins.promoted_builds.KeepBuildForeverAction@7e114ac6 SUCCESS
      Finished: SUCCESS

      The parameterized trigger succeeded, and the build started. But, in the build that is triggered, you get this:

      Started by upstream project "Main Build/promotion/Triggered Build" build number 32
      originally caused by: Legacy code started this job. No cause information is available

      There are no actual links between the build that was promoted, and the build that was triggered by the promotion.

      I think it would be very useful if there were links between the 2, in the same way that upstream / downstream builds are linked such that you can figure out which build caused another build.

      Attachments

        Issue Links

          Activity

            gregcovertsmith Greg Smith created issue -
            ikedam ikedam added a comment -

            When called as a publisher of a job, ParameterrizedTrigger launches downstream jobs by registering them to DependencyGraph. 
            When called in a promotion, ParameterrizedTrigger launches downstream jobs by itself.
            This difference seems make downstram builds lose their upstram build.

            In the promotion process, PromotedBuild doesn't trigger DependencyGraph. It is the reason ParameterrizedTrigger launches downstream jobs by itself. It is mentioned in the comment in hudson.plugins.parameterizedtrigger.BuildTrigger.canDeclare, and seems reported in Hudson-5679.
            (I could not access that page, however...)

            On the other hand, used hudson.tasks.BuildTrigger, the upstream build can be tracked from downstram builds even called in the promotion process.
            This is for PromotedBuilds treats hudson.tasks.BuildTrigger in a special way. This is done in JENKINS-1765 (and HUDSON-1765), patched in 88920e3.

            There could be two ways to improve ParameterrizedTrigger with PromotedBuilds.

            • Make PromotedBuilds to treat ParameterrizedTrigger as the way as built-in BuildTrigger.
            • Make ParameterrizedTrigger to trigger downstream jobs as PromotedBuilds does for built-in BuildTrigger.

            The latter one is better as a design, but I'm not sure ParameterrizedTrigger can retrieve the original build of the promotion.

            ikedam ikedam added a comment - When called as a publisher of a job, ParameterrizedTrigger launches downstream jobs by registering them to DependencyGraph.  When called in a promotion, ParameterrizedTrigger launches downstream jobs by itself. This difference seems make downstram builds lose their upstram build. In the promotion process, PromotedBuild doesn't trigger DependencyGraph. It is the reason ParameterrizedTrigger launches downstream jobs by itself. It is mentioned in the comment in hudson.plugins.parameterizedtrigger.BuildTrigger.canDeclare, and seems reported in Hudson-5679. (I could not access that page, however...) On the other hand, used hudson.tasks.BuildTrigger, the upstream build can be tracked from downstram builds even called in the promotion process. This is for PromotedBuilds treats hudson.tasks.BuildTrigger in a special way. This is done in JENKINS-1765 (and HUDSON-1765), patched in 88920e3 . There could be two ways to improve ParameterrizedTrigger with PromotedBuilds. Make PromotedBuilds to treat ParameterrizedTrigger as the way as built-in BuildTrigger. Make ParameterrizedTrigger to trigger downstream jobs as PromotedBuilds does for built-in BuildTrigger. The latter one is better as a design, but I'm not sure ParameterrizedTrigger can retrieve the original build of the promotion.
            ikedam ikedam made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-1765 [ JENKINS-1765 ]
            ikedam ikedam made changes -
            Link This issue is related to JENKINS-5679 [ JENKINS-5679 ]
            ikedam ikedam added a comment -


            HUDSON-5679 is JENKINS-5679, and the commit is 6ff8203 .

            ikedam ikedam added a comment - HUDSON-5679 is JENKINS-5679 , and the commit is 6ff8203 .
            ikedam ikedam added a comment - Sent a pull request: https://github.com/jenkinsci/parameterized-trigger-plugin/pull/38
            gregcovertsmith Greg Smith added a comment -

            This is great – Thanks much.

            Is this now tracked to be included in an upcoming update?

            gregcovertsmith Greg Smith added a comment - This is great – Thanks much. Is this now tracked to be included in an upcoming update?
            ikedam ikedam added a comment -

            I'm not sure for I'm not a maintainer of Parametrized Trigger plugin.
            I sent a pull request https://github.com/jenkinsci/parameterized-trigger-plugin/pull/38  and anyone deos not yet respond it.

            ikedam ikedam added a comment - I'm not sure for I'm not a maintainer of Parametrized Trigger plugin. I sent a pull request  https://github.com/jenkinsci/parameterized-trigger-plugin/pull/38  and anyone deos not yet respond it.
            gregcovertsmith Greg Smith added a comment -

            Can one of the owners of this plugin please pull this feature? I would be happy to help test. I think this would be a great addition.

            gregcovertsmith Greg Smith added a comment - Can one of the owners of this plugin please pull this feature? I would be happy to help test. I think this would be a great addition.
            ikedam ikedam added a comment -

            @gregcovertsmith
            Now I have a commit access to parameterized-trigger-plugin (https://groups.google.com/forum/#!topic/jenkinsci-dev/ua5aDnEwlec).
            Could you test this change before I merge it and release a new version?
            Please let me know the best way for you to test it:

            • You build a test version by yourself, and install it in the advanced menu.
            • I build a test version and attach it to this ticket. You install it in the advanced menu.
            • I prepare a custom update center, and you install a test version from that update center using UpdateSites Manager plugin
            ikedam ikedam added a comment - @gregcovertsmith Now I have a commit access to parameterized-trigger-plugin ( https://groups.google.com/forum/#!topic/jenkinsci-dev/ua5aDnEwlec ). Could you test this change before I merge it and release a new version? Please let me know the best way for you to test it: You build a test version by yourself, and install it in the advanced menu. I build a test version and attach it to this ticket. You install it in the advanced menu. I prepare a custom update center, and you install a test version from that update center using UpdateSites Manager plugin
            ikedam ikedam added a comment -

            Now @jglick is reviewing.
            I'll create a new pull request that fix problems pointed by @jglick.

            ikedam ikedam added a comment - Now @jglick is reviewing. I'll create a new pull request that fix problems pointed by @jglick.

            Code changed in jenkins
            User: ikedam
            Path:
            pom.xml
            src/test/java/hudson/plugins/parameterizedtrigger/test/TriggerBuilderTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/a3022047e2220dd6bfbdc5e0a225c48be78a30f6
            Log:
            JENKINS-17751 added tests for a combination with Promoted Builds plugin.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: pom.xml src/test/java/hudson/plugins/parameterizedtrigger/test/TriggerBuilderTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/a3022047e2220dd6bfbdc5e0a225c48be78a30f6 Log: JENKINS-17751 added tests for a combination with Promoted Builds plugin.

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig.java
            src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java
            src/test/java/hudson/plugins/parameterizedtrigger/test/TriggerBuilderTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/e13ee740828081dc539d3dda903929ce39c808c7
            Log:
            [FIX JENKINS-17751] Called from a promotion, set UpstreamCause from the original build of the promotion.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig.java src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java src/test/java/hudson/plugins/parameterizedtrigger/test/TriggerBuilderTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/e13ee740828081dc539d3dda903929ce39c808c7 Log: [FIX JENKINS-17751] Called from a promotion, set UpstreamCause from the original build of the promotion.

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/9eecd5b27ad47bbbb2d00f7418f8b5dec178854b
            Log:
            JENKINS-17751 removed unnecessary `super`. It is misleading.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/9eecd5b27ad47bbbb2d00f7418f8b5dec178854b Log: JENKINS-17751 removed unnecessary `super`. It is misleading.

            Code changed in jenkins
            User: ikedam
            Path:
            pom.xml
            src/main/java/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig.java
            src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java
            src/test/java/hudson/plugins/parameterizedtrigger/test/TriggerBuilderTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/ce231ba84c0b2dbd9c1e2f3ce7995691744e55e2
            Log:
            Merge pull request #40 from ikedam/feature/JENKINS-17751-2

            JENKINS-17751 set upstream builds to original builds of promotions(improvement of #38)

            Compare: https://github.com/jenkinsci/parameterized-trigger-plugin/compare/a443010853f7...ce231ba84c0b

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: pom.xml src/main/java/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig.java src/main/java/hudson/plugins/parameterizedtrigger/BuildTriggerConfig.java src/test/java/hudson/plugins/parameterizedtrigger/test/TriggerBuilderTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/ce231ba84c0b2dbd9c1e2f3ce7995691744e55e2 Log: Merge pull request #40 from ikedam/feature/ JENKINS-17751 -2 JENKINS-17751 set upstream builds to original builds of promotions(improvement of #38) Compare: https://github.com/jenkinsci/parameterized-trigger-plugin/compare/a443010853f7...ce231ba84c0b
            gregcovertsmith Greg Smith added a comment -

            @ikedam
            If you can attach a test version of the plugin here, I can install via the advanced menu and test.
            I do not have access to a build environment, but that would work for me.
            Thank you much for the effort.

            gregcovertsmith Greg Smith added a comment - @ikedam If you can attach a test version of the plugin here, I can install via the advanced menu and test. I do not have access to a build environment, but that would work for me. Thank you much for the effort.
            gregcovertsmith Greg Smith added a comment -

            Sorry I did not see your original request for test – I got the new notifications on this issue report, and saw your previous comment.

            gregcovertsmith Greg Smith added a comment - Sorry I did not see your original request for test – I got the new notifications on this issue report, and saw your previous comment.
            ikedam ikedam added a comment -

            @gregcovertsmith
            Thanks for your reply.
            My change is already merged in the source tree, and I'll release a new version.
            Please wait for a while.

            ikedam ikedam added a comment - @gregcovertsmith Thanks for your reply. My change is already merged in the source tree, and I'll release a new version. Please wait for a while.
            ikedam ikedam added a comment -

            Released 2.19 containing fix for this issue.
            It should be available in a day.
            (It is said to be available in 6 hours, but I'm not sure.)

            ikedam ikedam added a comment - Released 2.19 containing fix for this issue. It should be available in a day. (It is said to be available in 6 hours, but I'm not sure.)
            ikedam ikedam made changes -
            Assignee huybrechts [ huybrechts ] ikedam [ ikedam ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 148931 ] JNJira + In-Review [ 206605 ]

            People

              ikedam ikedam
              gregcovertsmith Greg Smith
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: