Pipeline not being triggered on pull-request (github-pullrequest-builder) - jenkins

I have some problems with getting GitHub Pull Request Builder to work.
While configuring this plugin I used all of the given tests to check:
basic connection to GitHub
permissions to a repository
adding comment to pull-request
updating commit status
All of these things work right, but issuing pullrequest does not trigger the pipeline start. All I was able to get out of Jenkins logs is just an info that pr is being checked...jenkins_logs
Have anyone run into the same trouble? I can't find a solution to this problem.

Related

Trigger a Jenkins Job when a PR is raised - Should be one of the Status Checks

I have gone through numerous post on triggering Jenkins build when a PR is raised in github.
I have checked Git hub Pull Request Builder Option in jenkins job. Apart from above , I have added webhook and jenkins Github plugin as service in my repo.
How do I add status checks?
Anything else being missed here. I dont see build getting triggered when PR is raised.

Github not triggering job when pull request is created to branch

I need to run a jenkins job when PR is created to my staging branch in github. The jenkins will run some test cases and return the results to github and after that only we can merge the PR to the staging branch.
I'm using GitHub pull request builder plugin in jenkins. But my job in jenkins is not getting triggered when PR is created. The webhook from github is show 200 status and its working to buid a jenkins job for github push.
I followed https://medium.com/#mreigen/integrate-jenkins-builds-into-github-pull-requests-33bc053d6210 steps.
Can anybody help me with This!
Check the Jenkins logs first.
For example, jenkinsci/ghprb-plugin issue 286 mentioned:
It looks like GitHub is sending the wrong kind of events.
The plugin only accepts pull_request and issue_comment events.
GitHub is sending a push event, so I am not sure but you might have configured the webhook using a different plugin?
Check your master config and make sure you are only telling the job triggers to use webhooks. Also, make sure you have checked the box in each job you want that says to build using webhooks.
Issue 603 involved the option "Use github hooks for build triggering", but mention an Hook URL issue.

Cannot get Jenkins to update GitHub Pull Request with a build status

I am using the Jenkins plugin GitHub Pull Request Builder to run some commands, and then update the status of my Pull Request.
The job is correctly triggering when I update a PR on GitHub, however I cannot get the job to update the status of the build on GitHub.
I have closely replicated the steps outlined in this article: https://medium.com/#mreigen/integrate-jenkins-builds-into-github-pull-requests-33bc053d6210
When I check the System Logs, I see this error: GitHub project property is missing the URL, cannot start ghprb trigger for job
I have entered the URL everywhere I can find to enter it, but so far nothing has worked.
This is my configuraiton for the plugin:
Any help on how to get the job to successfully add a status message to the Pull Request on GitHub would be greatly appreciated!
On the GitHub Pull Request Builder section of the Build Triggers, enabling the checkbox:
Build every pull request automatically without asking enables the Jenkins job to add an update status to GitHub.
You need to enable the github project option and provide your gihub url there.

Bitbucket Pull Request Builder plugin for Jenkins unable to post comments

The Bitbucket Pull Request Builder plugin for Jenkins allows Jenkins build to be triggers when Pull requests are created or commented on in Bitbucket.
This has been working fine for us, but on one particular repo, it has started failing.
The logs show:
WARNING: bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger.run() failed for hudson.model.FreeStyleProject#2840d594[ci-metadata-app-new]
java.lang.NullPointerException
at bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketRepository.postBuildTagInTTPComment(BitbucketRepository.java:182)
at bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketRepository.isBuildTarget(BitbucketRepository.java:253)
at bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketRepository.getTargetPullRequests(BitbucketRepository.java:94)
at bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketPullRequestsBuilder.run(BitbucketPullRequestsBuilder.java:37)
at bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildTrigger.run(BitbucketBuildTrigger.java:187)
It looks like the plugin can't post a comment to the Bitbucket API
postBuildTagInTTPComment
Which is preventing the build from triggering.
Has anyone seen this issue before? It is only happening for this particular repo.
Eventually cleared it by deleting all the pull requests and adding them back one by one. I think it had something to do with one PR have a target branch that was behind its source branch.

Bitbucket pull request builder plugin keeps triggering same commit build

I need to integrate Bitbucket with Jenkins. So that whenever a PR is opened it will trigger a build in Jenkins. Then commit status of the last commit in the PR will be updated as failed or success and this commit wont trigger the build again. (This works beautiful with Github but seems to be a nightmare for me with Bitbucket)
So far I did:
Installed Bitbucket pull request builder plugin.
Set everything up like its described in https://github.com/jenkinsci/bitbucket-pullrequest-builder-plugin#readme
User has write permissions to the repository (we added shh pub key to organization and its in the group that has write permissions)
Problems
Build is triggered over and over again for the same PR/commit
Commit status is not updated on bitbucket
Let me know if I can provide more information.
In my case, the Jenkins URL was set to http://jenkins:8080 and when such a URL was sent to BitBucket via their API, BitBucket returned the error "Invalid URL" (Look in Jenkins Logs: http://yourjenkins:8080/log/all) Which is not handled by the BitBucket Pull Request Builder plugin and thus kept continuously rebuilding all of our pull requests because it thought that build was not in progress. After setting Jenkins URL to http://jenkins.domain.tld:8080/ or http:///jenkins, the BitBucket API started accepting the URL and everything started to work.
But in your case it may be possible that some other error is the cause. You can check your Jenkins Error log to see the failure.
See the following issue: Build status notification fails with Enter a valid URL

Resources