-
New Feature
-
Resolution: Unresolved
-
Minor
-
Powered by SuggestiMate
I missed the GHPRB trigger on the triggers section on the workflow job config page
[JENKINS-26591] Workflow support for GitHub Pull Requests Builder Trigger
Any news on get it compatible to pipeline (aka workflow)... This would be an awesome addition
I am not sure how to make these compatible, and if it will take more work than just changing over from AbstractProject to Job. If anyone would like to have a go at it I will be sure to review the PR and get it released.
FWIW, I've started making the changes but it is going to take me a long while to get this right as I've never worked on this plugin before. You can look at my progress in here: https://github.com/anomalizer/ghprb-plugin/tree/pipeline-compat
It appears that the functionally of the current plugin must be unbundled to a certain extent for it be relevant in the world of pipelines.
Trigger on pull request
This part deals with setting up the github hook, listening to the pull request events posted from github, filtering out the events on which we do not wish to trigger a build, branches, skip phrases, etc. etc.. The role of this piece is to determine when a build should be triggered. A simple port of this to use the new types should suffice
Trigger setup
This part of the plugin interacts with github by manipulating the pull request in many ways such as updating the github status, posting comments, one liners on progress and eventual outcomes. This is the functionality that cannot be ported as-is into the pipeline world. Users would need to ability to wrap any step / stage within a trigger setup. For example, we can choose to have one github status that is controlled by the first stage of the pipeline that presumably compiles the code and another status that is controlled by a latter stage of the pipeline that creates a docker image and launches it to run integration tests against it. Note that this might be a useful capability to have even in the pre-pipeline world. However, it becomes a necessity once we move into the world of pipelines
Pull request merger
This should be thought of as an independent, step in the pipelined world.
I encounter the same exception with Stash Pull Request Builder Plugin + Pipeline Plugin on Jenkins 2.7.4 LTS:
javax.servlet.ServletException: java.lang.ClassCastException: org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject cannot be cast to hudson.model.AbstractProject at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
See also JENKINS-32749 (pull request support for GitHub branch source). I'm not sure how much overlap there is.
Code changed in jenkins
User: Jesse Glick
Path:
COMPATIBILITY.md
http://jenkins-ci.org/commit/pipeline-plugin/c84a9af380854dbafd66e265b63cd05969ad7c47
Log:
Merge pull request #439 from alexbrjo/alexbrjo-compat-update
JENKINS-32263 JENKINS-32650 JENKINS-33841 JENKINS-33310 JENKINS-26591 JENKINS-30522 Updated support status for several plugins
Compare: https://github.com/jenkinsci/pipeline-plugin/compare/23d473486c8e...c84a9af38085
BTW the CCE is a bug, not an unimplemented RFE; this code is simply wrong.