nemccarthy / stash-pullrequest-builder-plugin

A Jenkins plugin for Building Stash Pull Requests
https://wiki.jenkins-ci.org/display/JENKINS/Stash+pullrequest+builder+plugin
Other
64 stars 130 forks source link

Support Pipeline plugin from Jenkins 2.0 #80

Closed nickbroon closed 7 years ago

nickbroon commented 8 years ago

Would allow using this plugin programatically from a Jenkinsfile

Details at: https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md#plugin-developer-guide

Possibly as simple as replacing AbstractBuild with Run

stashnotifier-plugin is looking to implement similar support: https://github.com/jenkinsci/stashnotifier-plugin/issues/92

There is already a plugin that supports both BitBucket Cloud and Bitbucket Server/Stash along similar lines, though it's support for PR's is more limited, not supporting things like using the merge branch, etc and is restricted to multi-branch source type Jobs. https://github.com/jenkinsci/bitbucket-branch-source-plugin https://documentation.cloudbees.com/docs/cje-user-guide/bitbucket.html

It appears that @tjkierzkowski may have made a start on this:https://github.com/nemccarthy/stash-pullrequest-builder-plugin/compare/master...tjkierzkowski:pipeline_conversion?expand=1

nickbroon commented 8 years ago

This is also being tracked for the Bitbucket Cloud pullrequest builder plugin: https://issues.jenkins-ci.org/browse/JENKINS-31749

nemccarthy commented 8 years ago

Jenkins file support would be awesome! Happy to take a PR on this one

bjoernwenzel-tommapps commented 8 years ago

+1

vmwiz commented 8 years ago

+10

randyesq commented 8 years ago

+10

lunetics commented 8 years ago

+100

goekhanm commented 8 years ago

+100

nemccarthy commented 8 years ago

Would someone like to raise a PR for this feature?

nickbroon commented 8 years ago

https://github.com/jenkinsci/ghprb-plugin/issues/270 https://github.com/jenkinsci/ghprb-plugin/pull/279 both appear related.

dcsobral commented 8 years ago

Why is this closed? Because of lack of help?

kenyee commented 8 years ago

+1 been trying to figure out how to get this to work w/ pipelines w/o luck

tknerr commented 8 years ago

+1 need that too!

nickbroon commented 7 years ago

jenkinsci/stash-pullrequest-builder-plugin#21 looks to add support for this.

stebadge commented 7 years ago

What would be the best way to get that pull request merged in? Further dev or testing needed?

stebadge commented 7 years ago

I've opened nemccarthy/stash-pullrequest-builder-plugin#110 so that this can be merged here and propagate through to jenkinsci, if that's the preferred approach.

jkerry commented 7 years ago

I've been bashing my head against this for a day or two. Is there any way we can get some movement? I'd be happy to build the plugin and patch it into our system to do some pre-merge QA if that'll help

nemccarthy commented 7 years ago

Thanks for this @stebadge. @jkerry have you been able to test #110 ? if so then we can merge and release

jkerry commented 7 years ago

Installing on our chef build server now. Stay tuned.

jkerry commented 7 years ago

This looks good. I just ran our first successful PR build through it on a self-built HPI. IMO :shipit:

ewollesen commented 7 years ago

Working here as well on self-built HPI.

akomakom commented 7 years ago

Any chance this change loses the ignoreSsl functionality? I have the checkbox checked but I'm getting this for both Pipeline and non-Pipeline jobs:

stashpullrequestbuilder.stashpullrequestbuilder.StashBuildTrigger.run() failed for org.jenkinsci.plugins.workflow.job.WorkflowJob@476de42b[job-name]
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
Caused: sun.security.validator.ValidatorException: PKIX path building failed

I'm not seeing this problem on my other Jenkins instance that has the official 1.7.0 version, nor when I downgrade this Jenkins instance to 1.7.0 (although of course I have to use non-Pipeline jobs then).

Update: I gave up and imported our Stash SSL cert into the JVM cacerts file, and then the job ran (so this is clearly an issue). I've encountered other problems though so it doesn't seem like this is ready for primetime. Here is a short list:

nickbroon commented 7 years ago

Resolved by #110

aakshih commented 6 years ago

When a pull request is created in bitbucket jenkins build does not get triggered. PullrequestID and other parameters are not passed from bitbucket pull request to jenkin job. I see in log below Exception.

Jul 16, 2018 10:50:00 AM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge INFO: Failure authenticating with BASIC 'Atlassian Bitbucket'@bitbucketdc.***.net:443 Jul 16, 2018 10:50:00 AM stashpullrequestbuilder.stashpullrequestbuilder.stash.StashApiClient$1 call SEVERE: Failing to get response from Stash PR GET/rest/api/1.0/projects/SCPPAR/repos/asset-record/pull-requests java.util.concurrent.ExecutionException: java.lang.RuntimeException: Didn't get a 200 response from Stash PR GET! Response; 'Unauthorized' with message; null

Let me know how to fix this.