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

Support the ScriptTrigger (via XTrigger) plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have ScriptTrigger installed under the XTrigger umbrella plugin for a few triggers.
      For ScriptTrigger triggered plugin if I access this URL:
      http://<jenkins>/job/jobname/jobnum/api/xml?xpath=//cause&wrapper=causes
      I get this:
      <causes>
      <cause _class="org.jenkinsci.lib.xtrigger.XTriggerCause">
      <shortDescription>
      [ScriptTrigger] and stuff printed by ScriptTrigger script.
      </shortDescription>
      </cause>
      </causes>

      I will have a look at adding support.

        Attachments

        1. buildresulttrigger.png
          buildresulttrigger.png
          1 kB
        2. fstrigger.png
          fstrigger.png
          0.6 kB
        3. ivytrigger.png
          ivytrigger.png
          0.7 kB
        4. scripttrigger.png
          scripttrigger.png
          1 kB
        5. scripttrigger2.png
          scripttrigger2.png
          2 kB
        6. xtrigger.png
          xtrigger.png
          2 kB
        7. xtrigger-buildresulttrigger.png
          xtrigger-buildresulttrigger.png
          3 kB
        8. xtrigger-fstrigger.png
          xtrigger-fstrigger.png
          2 kB
        9. xtrigger-ivytrigger.png
          xtrigger-ivytrigger.png
          2 kB
        10. xtrigger-scripttrigger.png
          xtrigger-scripttrigger.png
          3 kB
        11. xtrigger-scripttrigger2.png
          xtrigger-scripttrigger2.png
          4 kB

          Activity

          Hide
          batmat Baptiste Mathus added a comment -

          Hey James Coleman,

          Actually, the hardest part here is to find/design an icon. If you can do that, then I can handle adding the right associated code in a few minutes.

          Thanks

          Show
          batmat Baptiste Mathus added a comment - Hey James Coleman , Actually, the hardest part here is to find/design an icon. If you can do that, then I can handle adding the right associated code in a few minutes. Thanks
          Hide
          jamesc0 James Coleman added a comment -

          Hello,
          I had some problems logging in/retrieving password. So new account for now . . .
          Okay . . . designing icons is a bit tricky :-7 I will have a go.

          Xtrigger includes a few triggers. In the xml cause is "org.jenkinsci.lib.xtrigger.XTriggerCause" and in shortDesc string starts with [ScriptTrigger] or [FSTrigger] or [URLTrigger] or [IvyTrigger] or [BuildResultTrigger]. I'm not sure can handling for that as separate triggers be added. . . :0)

          Anyway one xtrigger icon would be a start.

          I see there us an icon for URLTrigger already, icons could be added to support

          {FS,Script,Ivy,BuildResult}

          Trigger. See here the causes and icon image names . . .

          // "org.jenkinsci.lib.xtrigger.XTriggerCause" and shortDesc contains [ScriptTrigger], others . . .
          defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "xtrigger.png");
          //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "ScriptTrigger", "xtrigger-scripttrigger.png");
          //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "FSTrigger", "xtrigger-fstrigger.png");
          //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "URLTrigger", "xtrigger-urltrigger.png");
          //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "IvyTrigger", "xtrigger-ivytrigger.png");
          // BuildResultTrigger Plugin (a.k.a JobTrigger)
          //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "BuildResultTrigger", "xtrigger-buildresulttrigger.png");
          // a guess:
          defineIconForCause("org.jenkinsci.lib.scripttrigger.ScriptTriggerCause", "scripttrigger.png");
          defineIconForCause("org.jenkinsci.lib.fstrigger.FSTriggerCause", "fstrigger.png");
          defineIconForCause("org.jenkinsci.lib.ivytrigger.IvyTriggerCause", "ivytrigger.png");
          defineIconForCause("org.jenkinsci.lib.buildresulttrigger.BuildResultTriggerCause","buildresulttrigger.png");

          }

          Show
          jamesc0 James Coleman added a comment - Hello, I had some problems logging in/retrieving password. So new account for now . . . Okay . . . designing icons is a bit tricky :-7 I will have a go. Xtrigger includes a few triggers. In the xml cause is "org.jenkinsci.lib.xtrigger.XTriggerCause" and in shortDesc string starts with [ScriptTrigger] or [FSTrigger] or [URLTrigger] or [IvyTrigger] or [BuildResultTrigger] . I'm not sure can handling for that as separate triggers be added. . . :0) Anyway one xtrigger icon would be a start. I see there us an icon for URLTrigger already, icons could be added to support {FS,Script,Ivy,BuildResult} Trigger. See here the causes and icon image names . . . // "org.jenkinsci.lib.xtrigger.XTriggerCause" and shortDesc contains [ScriptTrigger] , others . . . defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "xtrigger.png"); //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "ScriptTrigger", "xtrigger-scripttrigger.png"); //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "FSTrigger", "xtrigger-fstrigger.png"); //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "URLTrigger", "xtrigger-urltrigger.png"); //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "IvyTrigger", "xtrigger-ivytrigger.png"); // BuildResultTrigger Plugin (a.k.a JobTrigger) //defineIconForCause("org.jenkinsci.lib.xtrigger.XTriggerCause", "BuildResultTrigger", "xtrigger-buildresulttrigger.png"); // a guess: defineIconForCause("org.jenkinsci.lib.scripttrigger.ScriptTriggerCause", "scripttrigger.png"); defineIconForCause("org.jenkinsci.lib.fstrigger.FSTriggerCause", "fstrigger.png"); defineIconForCause("org.jenkinsci.lib.ivytrigger.IvyTriggerCause", "ivytrigger.png"); defineIconForCause("org.jenkinsci.lib.buildresulttrigger.BuildResultTriggerCause","buildresulttrigger.png"); }
          Hide
          jamesc0 James Coleman added a comment -

          How about those icons, now attached? I know probably not possible to do the xtrigger-*.png ones.

          Show
          jamesc0 James Coleman added a comment - How about those icons, now attached? I know probably not possible to do the xtrigger-*.png ones.
          Hide
          batmat Baptiste Mathus added a comment -

          Yeah, out of the box, it's not possible. If I want to support and show the "underlying" causes behind XTrigger, it will force me to write specific code for it. That does not mean I won't do it, it's just that it's not possible currently with the code and it may not feel very clean to me to define specific cause per cause. Until now, the code has been kept generic and the class=>icon is totally declarative.

          So, in the short term, I'm gonna define at least something for the global XTriggerCause using one of your icon. Will keep you posted.

          Show
          batmat Baptiste Mathus added a comment - Yeah, out of the box, it's not possible. If I want to support and show the "underlying" causes behind XTrigger, it will force me to write specific code for it. That does not mean I won't do it, it's just that it's not possible currently with the code and it may not feel very clean to me to define specific cause per cause. Until now, the code has been kept generic and the class=>icon is totally declarative. So, in the short term, I'm gonna define at least something for the global XTriggerCause using one of your icon. Will keep you posted.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Baptiste Mathus
          Path:
          src/main/java/org/jenkinsci/plugins/buildtriggerbadge/IconFinder.java
          src/main/webapp/images/xtrigger.png
          http://jenkins-ci.org/commit/buildtriggerbadge-plugin/9f474dc16cd46d5952a07ec87a92cade96a8d5b7
          Log:
          JENKINS-38932 Support XTrigger Plugin

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Baptiste Mathus Path: src/main/java/org/jenkinsci/plugins/buildtriggerbadge/IconFinder.java src/main/webapp/images/xtrigger.png http://jenkins-ci.org/commit/buildtriggerbadge-plugin/9f474dc16cd46d5952a07ec87a92cade96a8d5b7 Log: JENKINS-38932 Support XTrigger Plugin
          Hide
          batmat Baptiste Mathus added a comment -

          Done for XTriggerCause. Just released the 2.6, it should be available for install in a few hours from now (time to propagate through mirrors and so on). Looking at XTriggerCause class, there would be ways to support underlying causes, though with the current code it would most probably require to use reflection, even to access the private attribute org.jenkinsci.lib.xtrigger.XTriggerCause#causeFrom

          So does not seem like the resulting code would be State Of The Art

          Show
          batmat Baptiste Mathus added a comment - Done for XTriggerCause. Just released the 2.6, it should be available for install in a few hours from now (time to propagate through mirrors and so on). Looking at XTriggerCause class, there would be ways to support underlying causes, though with the current code it would most probably require to use reflection, even to access the private attribute org.jenkinsci.lib.xtrigger.XTriggerCause#causeFrom So does not seem like the resulting code would be State Of The Art
          Hide
          jamesc0 James Coleman added a comment -

          I updated to latest version Monday and its working.
          I can see the Xtrig icon in addition to the regular ones (source control, manual build).

          The hover over the BuildTriggerBadge icons gives the cause so you can already get that extra info (on which sub-trigger caused the trigger in case of Xtrigger). So, really the info added by BuildTriggerBadge already provides all that you would need. Very useful. Not just pretty! :-D

          Show
          jamesc0 James Coleman added a comment - I updated to latest version Monday and its working. I can see the Xtrig icon in addition to the regular ones (source control, manual build). The hover over the BuildTriggerBadge icons gives the cause so you can already get that extra info (on which sub-trigger caused the trigger in case of Xtrigger). So, really the info added by BuildTriggerBadge already provides all that you would need. Very useful. Not just pretty! :-D
          Hide
          jamesc0 James Coleman added a comment -

          The support for Xtrigger is added so we can resolve and close this issue, I think.

          Show
          jamesc0 James Coleman added a comment - The support for Xtrigger is added so we can resolve and close this issue, I think.

            People

            • Assignee:
              batmat Baptiste Mathus
              Reporter:
              jamesco James Coleman
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: