Skip to content

codeintel: git diffing fails graphql requests related to force-pushed commits

Created by: efritz

The LSIF GraphQL resolvers have the following high-level flow:

  • Based on the repository, path, commit C1, and requested indexer name, determine the set of uploads/dumps that can answer these queries. Suppose this returns a single upload at commit C2 (this can return zero or more uploads in practice).
  • Transform the request path and position wrt C1 into the path and position wrt C2 by running it backwards through the diff of C1...C2.
  • Query the bundle with the adjusted path
  • Adjust the resulting paths and positions wrt C2 into the path and position wrt C1 by running it forwards through the diff of C1...C2.

If there was a force-push that removes commit C2 from the code host between the index and the query, we will make a request to gitserver for a commit that doesn't exist. This will cause an error to be returned by the resolver. We should instead eat this error during step 2 and move on to the next candidate bundle.