[Code Embeddings] Handle force pushes
Context
From gitlab-elasticsearch-indexer!698 (comment 2678313150):
If we can detect force-push scenarios there, we could pass a flag to force re-indexing (like setting
fromSHA = "") instead of the current tree-diff approach.
References
Further context in related issue: gitlab-elasticsearch-indexer#172 (closed)
Proposal
We can make use of a reindexing field in the documents such that:
-
Add a
reindexingfield to indicate a document is in the process of reindexing -
In the Go Indexer, make use of the
reindexingfield to perform a reindex if ran with the optionsfrom_sha=""andforce_reindex=true -
In Rails, when there is a force-push, call the Go Indexer with options
from_sha=""andforce_reindex=true(this issue)
Edited by Pam Artiaga