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

Pipeline support for XTrigger

    XMLWordPrintable

Details

    Description

      It will require some research / analysis but the suite of xtrigger plugins (eg: fstrigger) should be refactored to support Jenkins Workflow.

      Attachments

        Issue Links

          Activity

            apemberton Andy Pemberton created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Priority Minor [ 4 ] Major [ 3 ]
            Summary Workflow Support Workflow support for XTrigger
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 161506 ] JNJira + In-Review [ 180724 ]
            abayer Andrew Bayer made changes -
            Labels workflow pipeline workflow
            abayer Andrew Bayer made changes -
            Labels pipeline workflow pipeline
            alexbrjo Alex Johnson made changes -
            Epic Link JENKINS-44690 [ 182554 ]
            alexbrjo Alex Johnson added a comment - - edited

            Most of these plugins are fairly old and inactive, but adding trigger compatibility will involve minimal code changes compared to other plugins. 

            xTrigger-lib:

            • update to be compatible with pipeline APIs
            • Add unit tests to confirm changes are correct
            • Bonus: speed up tests
              • Note: AbstractTriggerTest uses Thread.sleep(60000), possibly more efficient impl

            FSTrigger (thanks svanoort):

            • Implement EnvVars lookup that works for pipeline too (probably use a job or Jenkins level API)
            • Check compatibility of xtrigger-lib and FSTriggerCause
            • Create bridge methods for old method signatures & convert plugin signatures to new one
            • Add test that can trigger with pipelines
            • Manual test that file changes will trigger a pipeline build

            URLtrigger:

            • refactor to use pipeline compatible APIs
            • Add unit tests that triggers pipeline build from url response change
            • Manually test that a different response from a url will trigger a build

            Build result trigger:

            • Fix tests. errors after clone (I see slf4j in the stack trace ugh)
            • refactor to use pipeline compatible APIs
              • More work than URL and FS trigger to refactor, lots of uses of AbstractProject 
            • Add unit tests that triggers pipeline build from result
            • Manually test that the build result of a job can trigger a pipeline job

            Bonus:

            • Clean up code and docs. Add READMEs
            • addTrigger pipeline step

            I don't think ScriptTrigger (security issue; no longer distributed) or IvyTrigger (only 250 downloads) are worth looking at.

            alexbrjo Alex Johnson added a comment - - edited Most of these plugins are fairly old and inactive, but adding trigger compatibility will involve minimal code changes compared to other plugins.  xTrigger-lib: update to be compatible with pipeline APIs Add unit tests to confirm changes are correct Bonus: speed up tests Note: AbstractTriggerTest uses Thread.sleep(60000), possibly more efficient impl FSTrigger (thanks svanoort ): Implement EnvVars lookup that works for pipeline too (probably use a job or Jenkins level API) Check compatibility of xtrigger-lib and FSTriggerCause Create bridge methods for old method signatures & convert plugin signatures to new one Add test that can trigger with pipelines Manual test that file changes will trigger a pipeline build URLtrigger: refactor to use pipeline compatible APIs Add unit tests that triggers pipeline build from url response change Manually test that a different response from a url will trigger a build Build result trigger: Fix tests. errors after clone (I see slf4j in the stack trace ugh) refactor to use pipeline compatible APIs More work than URL and FS trigger to refactor, lots of uses of AbstractProject  Add unit tests that triggers pipeline build from result Manually test that the build result of a job can trigger a pipeline job Bonus: Clean up code and docs. Add READMEs addTrigger pipeline step I don't think ScriptTrigger (security issue; no longer distributed) or IvyTrigger (only 250 downloads) are worth looking at.
            recampbell Ryan Campbell added a comment -

            From a user POV, I should be able to write a pipeline script like this:

            pipeline {
                agent any
                triggers {
                    fstrigger('/ant/glob/**')
                }
                stages {...}
            }
            
            recampbell Ryan Campbell added a comment - From a user POV, I should be able to write a pipeline script like this: pipeline { agent any triggers { fstrigger( '/ant/glob/**' ) } stages {...} }
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-44690 [ 182554 ] JENKINS-34657 [ 170293 ]
            basil Basil Crow made changes -
            Link This issue is duplicated by JENKINS-33691 [ JENKINS-33691 ]
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Gregory Boissinot [ gbois ]
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Alex Johnson [ alexbrjo ]
            oleg_nenashev Oleg Nenashev made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            oleg_nenashev Oleg Nenashev made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            oleg_nenashev Oleg Nenashev made changes -
            Remote Link This issue links to "https://github.com/jenkinsci/xtrigger-lib/pull/7 (Web Link)" [ 17769 ]
            oleg_nenashev Oleg Nenashev made changes -
            Summary Workflow support for XTrigger Pipeline support for XTrigger
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is related to JENKINS-42614 [ JENKINS-42614 ]
            dcendents Daniel Beland added a comment -

            I'm still using ScriptTrigger and would really appreciate if the new XTrigger plugin could support groovy scripts.

            Provide a groovy function expected to return true/false, set a frequency (cron) and possibly restrict on which node to execute.

            Then it should be possible to open the log of the last script execution and it's result from the project page.

             

            dcendents Daniel Beland added a comment - I'm still using ScriptTrigger and would really appreciate if the new XTrigger plugin could support groovy scripts. Provide a groovy function expected to return true/false, set a frequency (cron) and possibly restrict on which node to execute. Then it should be possible to open the log of the last script execution and it's result from the project page.  
            ccoleman Curt Coleman added a comment -

            Is the associated PR (https://github.com/jenkinsci/xtrigger-lib/pull/7) dead in the water? The last activity was back on Sep 24, 2017.

            We'd really, really like to be able to leverage the URL Trigger plugin from within pipeline code. At present, we're having to stick freestyle jobs that use URL Trigger (watching specific paths in our Artifactory instance) in front of pipeline jobs, but it's pretty clunky and does not scale well.

            I'm not trying to be pushy - just trying to determine if we need to give up hoping for this issue (really JENKINS-33691) to be resolved and start looking into other avenues.

            ccoleman Curt Coleman added a comment - Is the associated PR ( https://github.com/jenkinsci/xtrigger-lib/pull/7 ) dead in the water? The last activity was back on Sep 24, 2017. We'd really, really like to be able to leverage the URL Trigger plugin from within pipeline code. At present, we're having to stick freestyle jobs that use URL Trigger (watching specific paths in our Artifactory instance) in front of pipeline jobs, but it's pretty clunky and does not scale well. I'm not trying to be pushy - just trying to determine if we need to give up hoping for this issue (really  JENKINS-33691 ) to be resolved and start looking into other avenues.
            colmelvin Chris Lindee added a comment - - edited

            New PRs available.  They were made small and independent to allow partial acceptance, such that, if one wasn't merged, a future PR wouldn't need to re-do all of the work (notice the similarities between #7#8).

            colmelvin Chris Lindee added a comment - - edited New PRs available.  They were made small and independent to allow partial acceptance, such that, if one wasn't merged, a future PR wouldn't need to re-do all of the work (notice the similarities between #7 &  #8 ). https://github.com/jenkinsci/xtrigger-lib/pull/11 https://github.com/jenkinsci/xtrigger-lib/pull/12 https://github.com/jenkinsci/xtrigger-lib/pull/13 https://github.com/jenkinsci/xtrigger-lib/pull/14 https://github.com/jenkinsci/xtrigger-lib/pull/15
            ccoleman Curt Coleman added a comment -

            It looks like all of the above pull requests have been merged. What's the next step for a downstream plugin like URL Trigger to get updated, such that there is support for pipeline jobs?

            ccoleman Curt Coleman added a comment - It looks like all of the above pull requests have been merged. What's the next step for a downstream plugin like URL Trigger to get updated, such that there is support for pipeline jobs?
            bhanu Bhanu Pathak added a comment -

            Kinldy fix this issue if possible or atleast provide some pointers how it can be implemented

            bhanu Bhanu Pathak added a comment - Kinldy fix this issue if possible or atleast provide some pointers how it can be implemented
            vititov Valentin Titov made changes -
            Link This issue is related to JENKINS-57078 [ JENKINS-57078 ]

            Please, merge PRs from JENKINS-57078 with fixes from URL Trigger.

            vititov Valentin Titov added a comment - Please, merge PRs from JENKINS-57078 with fixes from URL Trigger.

            People

              alexbrjo Alex Johnson
              apemberton Andy Pemberton
              Votes:
              13 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated: