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

Improve notification when automatic incremental index sent by remote event fails

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Problem Definition

      When you have Fisheye integrated with Bitbucket Server via Application Links and add a Bitbucket repository as such in Fisheye (i.e., not as regular Git repo), and the repository gets renamed only in Bitbucket Server afterwards, Fisheye will still receive the remote event notification from Bitbucket Server and as expected will fail to trigger the incremental index because the new repository URL will not be found in Fisheye.

      The problem is that only when debug logging is enabled Fisheye will write in the logs that the remote event was ignored because it is considered "non-local" (i.e., no repositories with the new URL could be found locally). In addition to adding this notification in regular logging, the admin web interface should show a notification somewhere as well.

      Steps to Reproduce

      1. Integrate Fisheye 4.7.0 with Bitbucket Server 5.7.3 via Application Links
      2. Create the remote consumer tokens
      3. Add the Bitbucket repository to Fisheye
      4. Let Fisheye index the repository
      5. Commit and push changes to Bitbucket Server and notice that this change will show up in Fisheye almost immediately, and the following is written in both application logs:
        • Bitbucket Server dispatches the remote event notification:
          2020-02-18 15:03:31,301 DEBUG [events.remote.ratelimit.threads:thread-1]  c.a.e.r.impl.RemoteEventDispatcher Found dispatch batches: List((https://my.company.com/fisheye/rest/remote-event-consumer/latest/events/stash-repository-refs-changed-remote-event,com.atlassian.stash.plugin.remote.event.StashRepositoryRefsChangedEvent@29dd9872[cloneLinks=[CloneLink{name=http, href=https://217216x710826@git.company.com/scm/abc/myrepo.git}, CloneLink{name=ssh, href=ssh://git@git.company.com:7999/abc/myrepo.git}],repositoryProject=ABC,repositorySlug=myrepo,committer=217216x710826,sourceId=<null>,sourceUrl=<null>]))
          
        • Fisheye receives the remote event notification, triggers an incremental indexing, and incremental indexing starts immediately:
          2020-02-18 15:03:31,341 DEBUG [qtp1095352419-8907 ] com.atlassian.event.remote.impl.rest.RemoteEventConsumerResource RemoteEventConsumerResource-receiveEvent - Publishing event com.atlassian.stash.plugin.remote.event.StashRepositoryRefsChangedEvent@69979e14[cloneLinks=[CloneLink{name=ssh, href=ssh://git@git.company.com:7999/abc/myrepo.git}, CloneLink{name=http, href=https://217216x710826@git.company.com/scm/abc/myrepo.git}],repositoryProject=ABC,repositorySlug=myrepo,committer=217216x710826,sourceId=e784b133-58eb-3726-b9a3-e6611271704c,sourceUrl=https://git.company.com] from request 71602fa6-79d2-4077-815c-46395eb5da5f to capability stash-repository-refs-changed-remote-event
          2020-02-18 15:03:31,342 DEBUG [qtp1095352419-8907 ] fisheye DefaultRepositoryAdminService-incrementalIndex - Incremental index triggered for repository myrepo
          2020-02-18 15:03:31,350 DEBUG [IncrPing3 myrepo ] fisheye RepositoryStatus-setMessage - Status change [myrepo]: Contacting repository.
          
      1. Rename the repository in Bitbucket (which will make the clone URL change)
      2. Commit and push changes to Bitbucket Server and notice that this change will not show up in Fisheye:
        • Bitbucket Server dispatches the remote event notification:
          2020-02-18 15:05:09,569 DEBUG [events.remote.ratelimit.threads:thread-3]  c.a.e.r.impl.RemoteEventDispatcher Found dispatch batches: List((https://my.company.com/fisheye/rest/remote-event-consumer/latest/events/stash-repository-refs-changed-remote-event,com.atlassian.stash.plugin.remote.event.StashRepositoryRefsChangedEvent@5f3b7030[cloneLinks=[CloneLink{name=http, href=https://217216x710826@git.company.com/scm/abc/mynewreponame.git}, CloneLink{name=ssh, href=ssh://git@git.company.com:7999/abc/mynewreponame.git}],repositoryProject=ABC,repositorySlug=mynewreponame,committer=217216x710826,sourceId=<null>,sourceUrl=<null>]))
          
        • Fisheye receives the remote event notification and ignores it:
          2020-02-18 15:05:09,612 DEBUG [qtp1095352419-8907 ] com.atlassian.event.remote.impl.rest.RemoteEventConsumerResource RemoteEventConsumerResource-receiveEvent - Publishing event com.atlassian.stash.plugin.remote.event.StashRepositoryRefsChangedEvent@6c83fa24[cloneLinks=[CloneLink{name=http, href=https://217216x710826@git.company.com/scm/abc/mynewreponame.git}, CloneLink{name=ssh, href=ssh://git@git.company.com:7999/abc/mynewreponame.git}],repositoryProject=ABC,repositorySlug=mynewreponame,committer=217216x710826,sourceId=e784b133-58eb-3726-b9a3-e6611271704c,sourceUrl=https://git.company.com] from request a9a69d62-31a8-4e21-9131-a6e0f12d7751 to capability stash-repository-refs-changed-remote-event
          2020-02-18 15:05:09,634 DEBUG [qtp1095352419-8907 ] com.atlassian.event.remote.impl.RemoteEventListener RemoteEventListener-onRemoteEvent - Ignoring non-local RemoteEvent com.atlassian.stash.plugin.remote.event.StashRepositoryRefsChangedEvent@6c83fa24[cloneLinks=[CloneLink{name=http, href=https://217216x710826@git.company.com/scm/abc/mynewreponame.git}, CloneLink{name=ssh, href=ssh://git@git.company.com:7999/abc/mynewreponame.git}],repositoryProject=ABC,repositorySlug=mynewreponame,committer=217216x710826,sourceId=e784b133-58eb-3726-b9a3-e6611271704c,sourceUrl=https://git.company.com]
          
      1. As can be seen, the log line which says that the remote event was ignored is only written when DEBUG logging is enabled.

      Suggested Solution

      This log line should also be written when DEBUG logging is disabled - maybe with WARN logging level - and the admin interface should notify about this problem somewhere.

      Workaround

      Enable debug logging so as to see the message

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

                Created:
                Updated: