Skip to content

Monorepo submodules not loading

Created by: christinelovett

  • Sourcegraph version: 3.28.0
  • Platform information: K8s on-prem

Steps to reproduce:

  1. User searches repo: ^main/trunk$
  2. User finds main/trunk in search results and clicks it
  3. User is taken to sourcegraph.app.redacted.com/main/trunk
  4. User sees top level folders and .gitmodules file loaded in the file navigation. User also sees full commit / branch history
  5. User tries to open one of the folders foo. User waits a few minutes and sees the Error loading file tree: Request to https://sourcegraph.app.customer.com/.api/graphql?TreeEntriies failed with 504 Gateway Time-out message in the file nav

In addition, a user cannot search contents in the monorepo for the Code tab:

  1. User writes the query repo: ^main/trunk$ foo and presses search
  2. User instantly sees No Results in the Code tab
  3. User navigates to the Diffs tab, and the query runs for ~20 seconds and returns 1 accurate result. However, the query times out
  4. User navigates to the Commits tab, and the search returns results as expected

The .gitmodule file for the monorepo looks like:

 [submodule "<subdir1>/<subdir2>/<submodule>"]
             path = <subdir1>/<subdir2>/<submodule>
             url = ../../<project>/<subdir1>.d/<subdir2>.d/<submodule>-git

for a given submodule. These submodules have different numbers of subdirs (it’s not always two like the example here). The .gitmodule file is ~50K LOC and takes a few minutes to load in Sourcegraph.

Customer