Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-21466

Newly added Gitlab projects are not automatically synced in DVCS by the hourly sync

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 8.20.0, 9.2.0, 9.3.0, 9.12.17
    • DVCS Connector

      Issue Description

      This issue happens when the Jira application is configured to sync repositories from a Gitlab group configured in ⚙ > Appications > DVCS Accounts. This issue does not happen when Jira is integrated with other tools such as Github or BitBucket.

      Here is the issue: when a new project (=repository) is added to the Gitlab group on the Gitlab side, the repository will be added on the Jira side after the DVCS hourly sync, but the 2 following issues can be observed:

      • Issue 1: the repository is not automatically synced (the last activity column is empty for this repository/project)
      • Issue 2: no webhook pointing to the Jira application is created for this project (=repository) on the Gitlab side. This issue will fix in this ticket JSWSERVER-21361

      Note

      If we go to the DVCS account (in ⚙ > Applications > DVCS Accounts) and use the button Account tools > Refresh repositories button for that account to "force" Jira to add this repository to the DVCS account, the 2 issues don't happen. Instead:

      • the repository is automatically synced
      • the webhooks pointing to the Jira application are created in the project on the Gitlab side

      Environment

      Replicated on Jira Software Server/Data Center 8.20.0, integrated with a self managed Gitlab instance

      Steps to replicate the bug

      • Integrate the Jira application with a self managed Gitlab instance
      • Create a new group in Gitlab
      • Add this new Gitlab group in the Jira DVCS account page (in ⚙ > Applications > DVCS Accounts) by following the instructions in this documentation
      • Create a new project in the Gitlab group account. Go to the webhook setting of this project, and verify that there is no webhook to Jira:
      • In Jira, do nothing and wait for about 1h (for the automatic DVCS sync to kick in)

      Excepted behavior

      • The new Gitlab project should be added as a new repository and it should be synced:
      • On the Gitlab side, webhooks pointing to the Jira application should have been automatically added:

      Actual behavior

      After the hourly sync kicked in:

      • the new Gitlab project was added as a new repository
      • however the repository did not get synced at all (the last activity column is empty for this repo/project):
      • When checking the webhook settings on the Gitlab side for that Gitlab group, no webhooks pointing to Jira were created:

      Workaround 1

      Instead of waiting for the hourly sync to kick in, use the following method to make sure that the project is added, synced, and that the Jira webhooks are created in Gitlab for this project:

      • Go to the DVCS Accounts page in Jira (in ⚙ > Applications > DVCS Accounts)
      • Click on the right DVCS account, and then click on Account tools > Refresh repositories
      • Verify that:
        • the new Gitlab project was added as a repository, and that it was synced:
      • Verify that the webhooks pointing to Jira were successfully added on the Gitlab side

      Workaround 2

      Sometimes, if the automatic DVCS sync to has already kicked in, the webhooks are not getting created by Refreshing repositories or Running a full sync in the repository.

      • Deleting/creating the DVCS account for the affected repository will create the missing webhooks

        1. Screenshot5.png
          402 kB
          Julien Rey
        2. Screenshot4.png
          214 kB
          Julien Rey
        3. Screenshot2.png
          320 kB
          Julien Rey
        4. Screenshot6.png
          337 kB
          Julien Rey
        5. Screenshot1.png
          399 kB
          Julien Rey
        6. Screenshot3.png
          414 kB
          Julien Rey

              58905173dc40 Radoslav Velichkov (Inactive)
              jrey Julien Rey (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated: