Handle indexing projects with no repos more gracefully

What does this MR do and why?

Handle indexing projects with no repos more gracefully

AI Summary

This change improves how the search indexing system handles Git repositories that don't exist on disk. Previously, the code was checking if repositories were "empty" but now it properly checks if the repository actually exists before trying to access it.

The main improvements are:

  1. When deciding whether to skip indexing a repository, the system now checks if the repo exists rather than just if it's empty
  2. When preparing data to send to the search indexer, the system skips including Git connection details if the repository doesn't exist, preventing errors
  3. New tests were added to verify that when a repository doesn't exist, the system still creates a valid indexing task but without the Git-specific information

This makes the search indexing more robust by gracefully handling cases where repositories might be missing or inaccessible, rather than failing or including invalid connection information.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #562129 (closed)

Merge request reports

Loading