reconquest / atlassian-external-hooks

External Hooks plugin for Atlassian Bitbucket
https://external-hooks.reconquest.io
Other
44 stars 37 forks source link

Unable to merge a pull request even after error is fixed #71

Closed kchawlaSP closed 5 years ago

kchawlaSP commented 5 years ago

Bitbucket Server version: 5.14.1 External Hooks plugin version: 4.5-1

Hi,

I upgraded Bitbucket Server from 5.11.1 to 5.14.1 and upgraded the plugin from 4.4-1 to 4.5-1.

After upgrading, I have a script setup to not allow a merge if a "special" file has changes. I update the special file and make the pull request. I am given an error.

I go ahead and modify the commit to remove the special file changes.

I am still unable to merge.

I see the following Error

Index: 0

kchawlaSP commented 5 years ago

Error calling com.ngs.stash.externalhooks.hook.ExternalMergeCheckHook.preUpdate (com.ngs.stash.externalhooks.external-hooks:external-merge-check-hook) java.lang.NullPointerException: summaryMessage at java.util.Objects.requireNonNull(Objects.java:228) at com.atlassian.bitbucket.hook.repository.SimpleRepositoryHookVeto.(SimpleRepositoryHookVeto.java:19) at com.atlassian.bitbucket.hook.repository.RepositoryHookResult$Builder.veto(RepositoryHookResult.java:141) at com.atlassian.bitbucket.hook.repository.RepositoryHookResult.rejected(RepositoryHookResult.java:49) at com.ngs.stash.externalhooks.hook.ExternalMergeCheckHook.preUpdate(ExternalMergeCheckHook.java:137) at com.ngs.stash.externalhooks.hook.ExternalMergeCheckHook.preUpdate(ExternalMergeCheckHook.java:58) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.preUpdate(DefaultRepositoryHookService.java:863) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.lambda$preUpdate$4(DefaultRepositoryHookService.java:463) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.preUpdate(DefaultRepositoryHookService.java:442) at com.atlassian.stash.internal.pull.DefaultMergeRequestCheckService.doCheck(DefaultMergeRequestCheckService.java:64) at com.atlassian.stash.internal.pull.DefaultMergeRequestCheckService.checkMergeability(DefaultMergeRequestCheckService.java:48) at com.atlassian.stash.internal.pull.DefaultPullRequestService.canMerge(DefaultPullRequestService.java:256) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at com.atlassian.stash.internal.rest.pull.PullRequestResource.canMerge(PullRequestResource.java:480) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) at com.atlassian.analytics.client.filter.UniversalAnalyticsFilter.doFilter(UniversalAnalyticsFilter.java:92) at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) at com.atlassian.bitbucket.internal.xcode.web.XcodeUserAgentFilter.doFilter(XcodeUserAgentFilter.java:36) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69) at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109) at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) at com.atlassian.bitbucket.internal.scm.git.lfs.servlet.filter.GitLfsLockingFilter.doFilter(GitLfsLockingFilter.java:50) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:87) at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 342 frames trimmed

seletskiy commented 5 years ago

@kchawlaSP: hello!

Thanks for bug report. I will take a look in a day and will try to reproduce problem on my local setup.

kchawlaSP commented 5 years ago

@seletskiy, thanks.

I am also able to reproduce this with my script and not committing a special file (merge check should pass).

Looking forward to your response

seletskiy commented 5 years ago

@kchawlaSP: I tested it out on my local setup using Bitbucket 5.14.1 & External Hooks 4.5-1 and unable to reproduce the problem.

Can you share: a) your merge check script; b) Merge Check settings (in Bitbucket interface).

Also if it's viable, I'm open for having a call to see what the problem is. If you want to schedule a call, just drop me a line on my e-mail (s.seletskiy@gmail.com).

kchawlaSP commented 5 years ago

@seletskiy Would you mind sharing your merge check script so I can see if I can reproduce it with your script. If I can't reproduce with your script then there is probably something going on with my script (but it works on the older version).

dploeger commented 5 years ago

@seletskiy Sorry, that was my mistake in my pull request features-PR. Fixed it in #73

seletskiy commented 5 years ago

@kchawlaSP: Thanks to @dploeger this problem should be gone. Can you try to use latest (4.5-2) version of plugin from marketplace?

kchawlaSP commented 5 years ago

Thank @dploeger and @seletskiy its working now!