Skip to content

Add support for Jenkins Pipeline. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

rhencke
Copy link

@rhencke rhencke commented Oct 25, 2016

Before this commit, if you attempted to use the Stash pull-request
builder plug in with Jenkins Pipeline, you would encounter an error.
Ultimately, this error was due to the fact that this plug in require
jobs to use the AbstractProject base class, but the Jenkins Pipeline
job class (WorkflowJob) doesn't.

The good news is that WorkflowJob and AbstractProject share a base
class of Job, and that most functionality of this plug in can be made
available to WorkflowJob refactoring uses of AbstractProject to uses
of Job instead. For cases where this does not provide enough
functionality, there are interfaces implemented in common by both
(ParameterizedJobMixIn.ParameterizedJob, Queue.Task) that fill the
gaps.

The one remaining piece of functionality this commit does not extend
to be available to Jenkins Pipeline is custom post-build comments, so
a TODO to that effect was added.

Before this commit, if you attempted to use the Stash pull-request
builder plug in with Jenkins Pipeline, you would encounter an error.
Ultimately, this error was due to the fact that this plug in require
jobs to use the AbstractProject base class, but the Jenkins Pipeline
job class (WorkflowJob) doesn't.

The good news is that WorkflowJob and AbstractProject share a base
class of Job, and that most functionality of this plug in can be made
available to WorkflowJob refactoring uses of AbstractProject to uses
of Job instead.  For cases where this does not provide enough
functionality, there are interfaces implemented in common by both
(ParameterizedJobMixIn.ParameterizedJob, Queue.Task) that fill the
gaps.

The one remaining piece of functionality this commit does not extend
to be available to Jenkins Pipeline is custom post-build comments, so
a TODO to that effect was added.
@aerben
Copy link

aerben commented Dec 20, 2016

Thank you very much! This change is in productive use in our pull request pipeline - we encountered no issues. We would really like to see this on master.

@hbsascha
Copy link

Working fine for us, next compiling this source. Would like to see this in master to get the oportunity to update if we like.
By the way, here also in production without any issues.

@stebadge
Copy link

stebadge commented Jan 9, 2017

I've opened nemccarthy#110 so that this can be merged there and propagate through to jenkinsci, if that's the preferred approach.

@alexander-svendsen
Copy link

when will this be merged?

@teramawi
Copy link

I'd also really love to see this beeing merged and made available via plugin manager.
Sadly I'm not allowed to use a branch-build from source.

Thanks for this little but very important improvement.

@mrit
Copy link

mrit commented Mar 13, 2017

Merge this please :(

@nickbroon
Copy link

This appears to have been merged as:
nemccarthy#110
and I think @nemccarthy just needs to make a release.

@mrit
Copy link

mrit commented Mar 13, 2017

@nemccarthy Make a release for us please ;)

@mopkobot
Copy link

@nemccarthy do we have an ETA for the new release that supports the Jenkins Pipeline?

@nirajgup
Copy link

@nemccarthy I am also looking for this release. Thanks :)

@MrException
Copy link

@nemccarthy just to echo the above comments. Please release this! Thank you!

@eloo
Copy link

eloo commented Jun 1, 2017

anyone tested this PR?
i'm facing the following exception
java.lang.ClassCastException: org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject cannot be cast to hudson.model.Job

@nirajgup
Copy link

@nemccarthy Do you need help with this plugin development and release?

@samdammers
Copy link

Also would love this to be available!

@d1nsh
Copy link

d1nsh commented Sep 5, 2017

Any idea when this will land?

@zeton3
Copy link

zeton3 commented Sep 18, 2017

I'm really waiting for this fix. i'm totally blocked in my pipeline jobs without this plugin.

@wburgers
Copy link

wburgers commented Oct 2, 2017

Any update on this?
We could really use this feature.
I has been approved and all checks pass.
Is there anything standing in the way of merging this PR?

@nickbroon
Copy link

nickbroon commented Oct 2, 2017

I think that this has been merged as nemccarthy#110. It's just that no release has been made yet. :-(

@ThijsX
Copy link

ThijsX commented Oct 2, 2017

@nemccarthy please make a release because the workaround by using an other job starting the pipeline with the same configuration has the result of an other node being in use constantly because it need's to wait on the pipeline being finished.

@mrbell-dev
Copy link

mrbell-dev commented Oct 18, 2017

Jumping in to check and see if there was an update. For the time being, would installing the updated .jar file from https://jenkins.ci.cloudbees.com/job/plugins/job/stash-pullrequest-builder-plugin/83/org.jenkins-ci.plugins$stash-pullrequest-builder/ be the way to go?

@jimklimov
Copy link

Hello all, just a small question for users of this PRed feature: do you also use it with Organization folders (e.g. Bitbucket Team items) - can it then automatically generate MultiBranch Pipeline items (one per repo) and further pipelines per branch with a Jenkinsfile, all using this plugin for integration via Stash comments? In the vanilla plugin, I see there are settings for this but they give a stacktrace as detailed in the PR description so I had not yet looked further.

@Alex-Vol-SV
Copy link

@jimklimov this is incompatible with Organization folders as far as I can tell. For my part I just finished porting some of the features of this plugin into the Branch API build strategy concepts used by the Organization Folder plugins and I will be going into production with these in our CI in the new year. I hope to make a public release of these branch strategies to facilitate reclaiming some of the features lost from this plugin in the Org folders.

@jakub-bochenski
Copy link

@rhencke if you still intend to work on this please rebase your branch against current master to enable CI builds.

@rhencke
Copy link
Author

rhencke commented Jan 23, 2019

@jakub-bochenski This work has been completed for quite some time and was already approved and merged on the author's personal fork, so unfortunately this commit is not a candidate for rebasing.

@jakub-bochenski
Copy link

Closing, we'll possibly revisit this later

@proski
Copy link

proski commented Mar 28, 2019

I've rebased the code on top of the master branch. It's available here:
https://github.com/proski/stash-pullrequest-builder-plugin/tree/pipeline-support

The code has only been compile tested at this time.

I don't want to submit it as a pull request yet, as it conflicts with many small pull requests that should be merged first. Also, there are many changes in the patch that I would double check first.

@jakub-bochenski
Copy link

jakub-bochenski commented Mar 28, 2019

I don't see a problem with filling a PR now. Just mark it as "Work in Progress" if you are worried it would be merged prematurely.
I think it's good to have it visible as actively worked on on the PR list

@jakub-bochenski
Copy link

I think we need to carefully consider the Organization folders overlap.
In my experience you can just use the branch sources infra to handle pull requests.
There are a few missing extra features, like posting comments and rebuild comments. Simplifying the setup would also be a valid improvement.

@proski
Copy link

proski commented Mar 28, 2019

Submitted as #69. Please elaborate about the Organization folders on the new PR. Is that just an overlap in functionality, or some breakage introduced by the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.