nishio-dens / bitbucket-pullrequest-builder-plugin

Bitbucket Pull Request Builder Plugin for Jenkins
Other
125 stars 145 forks source link

TTP starts random builds in random PRs without trigger #195

Open deusnuno opened 5 years ago

deusnuno commented 5 years ago

We're experiencing random open PRs in our repo being built at random times, without the TTP in the comments. Open PRs that aren't touched by anyone in days or weeks start being built out of the blue. I haven't found any pattern in the times this happens, or in the intervals between random builds, or even the number of PRs being built. Sometimes it's just one PR, some times 10's of them, clogging our slaves and queuing up until we manually deleted them.

We have been experiencing this issue since quite some time ago and today I've decided to dig a little deeper in the logs to understand what's happening. Apparently, while the TTP parser seems to correctly identify that a comment in some PR does not have the trigger sentence, the build target flag is set to true nonetheless. Below is a snippet of what we're seeing in the jenkins log right before one random PR build starts:

{"log":"FINE: Found comment: id:95670864 \u003cI will review the code later on, but what is missing here is tests \\(integration\\) to cover all combinations.\u003e\n","stream":"stderr","time":"2019-03-27T17:41:06.597556113Z"} {"log":"Mar 27, 2019 5:41:06 PM bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketRepository filterPullRequestComments\n","stream":"stderr","time":"2019-03-27T17:41:06.597566674Z"} {"log":"FINE: isTTP: false isTTPBuild: false\n","stream":"stderr","time":"2019-03-27T17:41:06.597570929Z"} {"log":"Mar 27, 2019 5:41:06 PM bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketRepository isBuildTarget\n","stream":"stderr","time":"2019-03-27T17:41:06.597595521Z"} {"log":"FINE: Build target? true [rebuild:false processed:false]\n","stream":"stderr","time":"2019-03-27T17:41:06.59759935Z"} {"log":"Mar 27, 2019 5:41:06 PM hudson.security.SidACL _hasPermission\n","stream":"stderr","time":"2019-03-27T17:41:06.597640446Z"} {"log":"FINER: hasPermission(PrincipalSID:anonymous,Permission[interface hudson.model.Item,Read])=\u003efalse\n","stream":"stderr","time":"2019-03-27T17:41:06.597644846Z"} {"log":"Mar 27, 2019 5:41:06 PM bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildFilter instanceByString\n","stream":"stderr","time":"2019-03-27T17:41:06.597664201Z"} {"log":"FINE: Filter instance by filter string\n","stream":"stderr","time":"2019-03-27T17:41:06.597668123Z"} {"log":"Mar 27, 2019 5:41:06 PM bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildFilter buildFilter\n","stream":"stderr","time":"2019-03-27T17:41:06.597687678Z"} {"log":"FINE: Build filter by phrase: \n","stream":"stderr","time":"2019-03-27T17:41:06.597691215Z"} {"log":"Mar 27, 2019 5:41:06 PM bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildFilter buildFilter\n","stream":"stderr","time":"2019-03-27T17:41:06.597714449Z"} {"log":"FINE: Using filter: AnyFlag\n","stream":"stderr","time":"2019-03-27T17:41:06.597718147Z"} {"log":"Mar 27, 2019 5:41:06 PM bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.BitbucketBuildFilter approved\n","stream":"stderr","time":"2019-03-27T17:41:06.597735333Z"} {"log":"FINE: Approve cause: bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.bitbucket.cloud.CloudBitbucketCause@14ab1d83\n","stream":"stderr","time":"2019-03-27T17:41:06.597739182Z"} {"log":"Mar 27, 2019 5:41:06 PM org.apache.commons.httpclient.methods.GetMethod \u003cinit\u003e\n","stream":"stderr","time":"2019-03-27T17:41:06.597793134Z"} {"log":"FINEST: enter GetMethod(String)\n","stream":"stderr","time":"2019-03-27T17:41:06.597798056Z"} {"log":"Mar 27, 2019 5:41:06 PM org.apache.commons.httpclient.params.DefaultHttpParams setParameter\n","stream":"stderr","time":"2019-03-27T17:41:06.597837232Z"} EDIT: Jenkins version: 2.150.3 Plugin version: 1.4.30

tildedave commented 4 years ago

Open PRs that aren't touched by anyone in days or weeks start being built out of the blue. I haven't found any pattern in the times this happens, or in the intervals between random builds, or even the number of PRs being built. Sometimes it's just one PR, some times 10's of them, clogging our slaves and queuing up until we manually deleted them.

We are also seeing this behavior with the Bitbucket Pullrequest Builder plugin. Plugin vers: 1.5.0 Jenkins ver. 2.218

CodeMonk commented 4 years ago

Thank you - trying to reproduce locally to gather logs. If you happen to have any from the rebuild, and can paste them here, I'd appreciate it!

-Dave