Skip to content

Support Pipeline plugin from Jenkins 2.0 #80

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
nickbroon opened this issue Apr 28, 2016 · 23 comments
Closed

Support Pipeline plugin from Jenkins 2.0 #80

nickbroon opened this issue Apr 28, 2016 · 23 comments

Comments

@nickbroon
Copy link
Contributor

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: jenkinsci/stashnotifier-plugin#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
Copy link
Contributor Author

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

@nemccarthy
Copy link
Owner

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

@bjoernwenzel-tommapps
Copy link

+1

@vmwiz
Copy link

vmwiz commented May 31, 2016

+10

1 similar comment
@randyesq
Copy link

+10

@lunetics
Copy link

+100

1 similar comment
@goekhanm
Copy link

goekhanm commented Jul 2, 2016

+100

@nemccarthy
Copy link
Owner

Would someone like to raise a PR for this feature?

@nickbroon
Copy link
Contributor Author

jenkinsci/ghprb-plugin#270
jenkinsci/ghprb-plugin#279
both appear related.

@dcsobral
Copy link

dcsobral commented Aug 5, 2016

Why is this closed? Because of lack of help?

@nickbroon nickbroon reopened this Aug 5, 2016
@kenyee
Copy link

kenyee commented Aug 19, 2016

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

@tknerr
Copy link

tknerr commented Sep 8, 2016

+1 need that too!

@nickbroon
Copy link
Contributor Author

nickbroon commented Oct 27, 2016

jenkinsci#21 looks to add support for this.

@stebadge
Copy link

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

@stebadge
Copy link

stebadge commented Jan 9, 2017

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

@jkerry
Copy link

jkerry commented Jan 23, 2017

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
Copy link
Owner

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

@jkerry
Copy link

jkerry commented Jan 24, 2017

Installing on our chef build server now. Stay tuned.

@jkerry
Copy link

jkerry commented Jan 24, 2017

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

@ewollesen
Copy link

Working here as well on self-built HPI.

@akomakom
Copy link

akomakom commented Feb 22, 2017

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:

  • StackOverFlowError when the job actually runs
  • When something goes wrong, job is not launched but Jenkins logs show: "Build started", "Build Start", "Fetch PullRequests". Then this continues forever, even after the PR for which it attempted to run is closed and merged. There seems to be no way to stop it - just runs according to the job's Stash cron expression.
  • "Ignore SSL" checkbox is... ignored, as I mentioned

@nickbroon
Copy link
Contributor Author

Resolved by #110

@aakshih
Copy link

aakshih commented Aug 1, 2018

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.

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

No branches or pull requests