Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-6773

Smart commit #time does not log work when days are used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • N/A
    • 4.2.1
    • Integrations
    • None

    Description

      Summary

      When days are specified in smart commits through the usage of 'd' time unit character, such as in the example below, no time gets logged:

      TST-1: Testing smart commits #time 1d
      

      Steps to Reproduce

      1. Integrate FishEye 4.2.1 with JIRA (tested with JIRA 6.4.14 and JIRA 7.2.6) through Application Links
      2. Ensure that OAuth consumer token has been accepted in both sides, allowing you to see JIRA issue details in FishEye side and commits / reviews in the JIRA issue
      3. (Likely optional) Create a user mapping, just to make sure that the repository committer will be mapped to a FishEye user
      4. Enable debug logging in FishEye
      5. Commit code using smart commits, and containing #time 1d in the commit message
      6. Wait until FishEye the new commit shows up in the repository activity stream
      7. Reload the JIRA ticket, ensuring to be in the Work Log tab, and check that the time was not logged.

      Expected Results

      According to Using Smart Commits it should be possible to use the time unit 'd', respective to days, and it should log the number of days specified before the 'd' character in the issue.

      Actual Results

      The following error gets written in FishEye logs:

      2017-02-02 18:06:51,782 ERROR [CommitNotifier1 ] com.atlassian.fecru.plugin.commithook.internal.DefaultCommitHookManager DefaultCommitHookManager-handleCommit - Error processing commit hook JIRA Issue Transitions
      java.lang.IllegalArgumentException: Time spent '1d' must be not null and greater then zero
      	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) [guava-18.0.jar:?]
      	at com.atlassian.fecru.plugins.jirarest.JiraIssueImpl$6.run(JiraIssueImpl.java:290) [?:?]
      	at com.atlassian.fecru.plugins.jirarest.restinvoker.JiraRestInvokerImpl.invoke(JiraRestInvokerImpl.java:46) [?:?]
      	at com.atlassian.fecru.plugins.jirarest.restinvoker.JiraRestInvokerImpl.invokeAuthenticated(JiraRestInvokerImpl.java:29) [?:?]
      	at com.atlassian.fecru.plugins.jirarest.JiraIssueImpl.logWork(JiraIssueImpl.java:286) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.commands.TimeCommandHandler$1.execute(TimeCommandHandler.java:58) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.commands.CommandHandler.doForEachIssue(CommandHandler.java:112) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.commands.TimeCommandHandler.doForProject(TimeCommandHandler.java:53) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.commands.CommandHandler.handleCommand(CommandHandler.java:52) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.JIRACommitHook$1.perform(JIRACommitHook.java:66) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.JIRACommitHook$1.perform(JIRACommitHook.java:61) [?:?]
      	at com.atlassian.crucible.spi.impl.DefaultImpersonationService.doOperationAsUser(DefaultImpersonationService.java:118) [fisheye.jar:?]
      	at com.atlassian.crucible.spi.impl.DefaultImpersonationService.doAsUser(DefaultImpersonationService.java:45) [fisheye.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_111]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_111]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_111]
      	at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_111]
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at com.cenqua.crucible.hibernate.WithSessionAspect.doCloseSession(WithSessionAspect.java:56) [fisheye.jar:?]
      	at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) [?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_111]
      	at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_111]
      	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
      	at com.sun.proxy.$Proxy116.doAsUser(Unknown Source) [?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_111]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_111]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_111]
      	at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_111]
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) [atlassian-plugins-core-4.4.0.jar:?]
      	at com.sun.proxy.$Proxy175.doAsUser(Unknown Source) [?:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_111]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_111]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_111]
      	at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_111]
      	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136) [?:?]
      	at com.sun.proxy.$Proxy175.doAsUser(Unknown Source) [?:?]
      	at com.atlassian.fecru.plugin.commithook.jira.JIRACommitHook.processHook(JIRACommitHook.java:61) [?:?]
      	at com.atlassian.fecru.plugin.commithook.internal.DefaultCommitHookManager.handleCommit(DefaultCommitHookManager.java:224) [fecru-commithooks-plugin-4.2.1-20161109135523_1478710844000.jar:?]
      	at com.atlassian.fecru.plugin.commithook.internal.DefaultCommitHookManager.handleCommit(DefaultCommitHookManager.java:193) [fecru-commithooks-plugin-4.2.1-20161109135523_1478710844000.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_111]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_111]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_111]
      	at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_111]
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:32) [atlassian-event-3.1.1.jar:?]
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:38) [atlassian-event-3.1.1.jar:?]
      	at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) [guava-18.0.jar:?]
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:88) [atlassian-event-3.1.1.jar:?]
      	at com.atlassian.event.internal.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:222) [atlassian-event-3.1.1.jar:?]
      	at com.atlassian.event.internal.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:95) [atlassian-event-3.1.1.jar:?]
      	at com.atlassian.fisheye.event.FisheyeEventPublisher$EventPublication.publish(FisheyeEventPublisher.java:63) [fisheye.jar:?]
      	at com.atlassian.fisheye.event.FisheyeEventPublisher.publish(FisheyeEventPublisher.java:35) [fisheye.jar:?]
      	at com.cenqua.fisheye.rep.CommitEventGenerator$CommitEventNotifier$1.apply(CommitEventGenerator.java:296) [fisheye.jar:?]
      	at com.cenqua.fisheye.rep.CommitEventGenerator$CommitEventNotifier$1.apply(CommitEventGenerator.java:273) [fisheye.jar:?]
      	at com.cenqua.fisheye.rep.RepositoryHandle.withEngine(RepositoryHandle.java:509) [fisheye.jar:?]
      	at com.cenqua.fisheye.rep.CommitEventGenerator$CommitEventNotifier.run(CommitEventGenerator.java:273) [fisheye.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
      2017-02-02 18:06:51,811 WARN  [CommitNotifier1 ] com.atlassian.fecru.plugin.commithook.internal.DefaultCommitHookManager DefaultCommitHookManager-collateErrors - Error while processing a commit directive handled by plugin com.atlassian.fecru.plugin.commithook.fecru-jiracommithook-plugin:jiracommithook for changeset d31c7e3ddd6c0855956ac2ea21e11419f9a8272e in repository Git:
          FishEye could not execute the smart commit because of an unexpected error: Time spent '1d' must be not null and greater then zero
          Please manually perform the required action within Crucible.
      

      As a result of this error, no time gets logged in the JIRA issue.

      Workaround

      In JIRA, 1 day of work has 8 hours, so specifying the number of days * 8 as hours should work.
      For example, supposing someone spent one full day and 3 hours the next day working on something, this person could use '11h' when logging time.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fkraemer Felipe Kraemer
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: