Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13577

Retrieve repositories from the database instead of from the Search server when loading the Project page (Bitbucket 8+)

    XMLWordPrintable

Details

    Description

      Background

      Repository archiving was introduced in Bitbucket 8.0

      The archive state of repos is used in some Bitbucket features, like in the Project page, which lists repos under the project.

      Summary

      Bitbucket 8+

      In Bitbucket 8+, when loading the Project page (<BITBUCKET_URL>/projects/<PROJECT_KEY>), a request is made to the Search server to retrieve the list of repositories instead of retrieving them from the database.

      By default, the Project page will show active/non-archived repositories.
      The request called from the UI for this is:

      GET <BITBUCKET_URL>/rest/search/latest/projects/<PROJECT_KEY>/repos?archived=ACTIVE&avatarSize=48&start=0&limit=25
      

      which goes to the Search server to retrieve active repos.

       

      In case there were any problems with search indexing, issues may be observed in these scenarios:

      • newly created repos will not show up in the Project list if they were created during the time when indexing issues were occurring
      • repos that were archived during the time when indexing issues were occurring will still show up under "Active" repos
      • repos that were unarchived during the time when indexing issues were occurring will still show up under "Archived" repos

       

      Suggestion is to retrieve the repos and their archive state from the database instead of the Search server to avoid these situations.

      The Project page is accessed by most users, so it needs a robust and reliable solution.

      Indexing issues also affect the repository management page (Administration > Git > Repositories), which also relies on data from the search server. However, this page is only accessible to admins.

       

      Note, if the search server is unavailable, loading the Project page will use the API:

      GET <BITBUCKET_URL>/rest/api/latest/projects/<PROJECT_KEY>/repos?avatarSize=48&start=0&limit=25
      

      which retrieves repo data from the DB.

       

      Bitbucket versions < 8.0

      In versions < 8.0, loading the Project page calls:

      GET <BITBUCKET_URL>/rest/api/latest/projects/<PROJECT_KEY>/repos?avatarSize=48&start=0&limit=25
      

      which retrieves repos from the DB.
       

      Attachments

        Issue Links

          Activity

            People

              91f2c0a8617b Navpreet Ahuja
              jmariano@atlassian.com JP Mariano
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: