GitWorkTreeBuilder alternates Java API not functioning as expected with hybrid Mesh configuration

XMLWordPrintable

    • 1
    • Severity 3 - Minor
    • 3

      Issue Summary

      The Git SCM Java API GitWorkTreeBuilder behaviour with alternates is not functioning as expected when using a hybrid configuration with repositories on the Mesh sidecar and repositories that have been migrated to external Mesh nodes.

      Note: This issue only occurs with the following scenarios:

      • The specified alternate is managed by Bitbucket (via the Mesh sidecar) and the main repository used for the worktree is managed by external Mesh; or
      • The specified alternate is managed by external Mesh and the main repository used for the worktree is managed by Bitbucket (via the Mesh sidecar)

      Steps to Reproduce

      Execute the following code snippet where the worktree repository is managed by Bitbucket (Mesh sidecar) and alternate managed be external Mesh (or vice versa).

      public void testWorkTreeAlternates(GitWorkTreeBuilderFactory factory, Repository repository, Repository alternate) {
          factory.builder(repository)
              .checkoutType(GitCheckoutType.NONE)
              .alternate(alternate)
              .execute(workTree => {
                  // do operations on the worktree        
              });
      }
      

      Expected Results

      The execute callback should receive a valid workTree object and can be invoked with no errors.

      Actual Results

      The worktree is never created and the execute callback is never invoked. An error similar to the following is also shown in the logs.

      com.atlassian.bitbucket.repository.NoSuchRepositoryException: There is no repository with ID p/0079/h/c0a2a63bb96725c4cbf7/r/6
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            David Zhu (Inactive)
            Reporter:
            Josh Aguilar
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: