Skip to content

A project listed in Bitbucket's projectKey list that the user/token is not authorized to see causes repository sync to stop

Created by: mike-r-mclaughlin

Description

When a projectKey is included in the projectKeys list that the user is not authorized to see, syncing repositories seems to stop. This is most noticeable when a repository is deleted from one of the other projects. Sourcegraph will continue to update it and fail until the unauthorized projectKey is removed from the projectKeys list.

Steps to reproduce:

Prep Bitbucket Server

  1. Create multiple projects with repositories
  2. Change the permissions on one (we'll refer to this project as FOO) such that the user you'll be using in Sourcegraph does not have access to it

Sourcegraph

  1. Create a new Bitbucket Server code host connection
  2. Use projectKeys to define the list of projects to sync.
  3. Include in the projectKeys all of the project keys including FOO

Expected behavior:

Syncing should correctly alert the user that the projectKey FOO is not authorized. But, syncing for all other project keys should continue.

Actual behavior:

Syncing is stopped once the unauthorized key is found. This means that deleted repos inside of the other projects will continue to be included in the update scheduler, for example.

/cc @jplahn @ryphil