Skip to content

Fix GitHub public archived repos appearing even when exclude archived is set to true

Administrator requested to merge iv/github-fix-public-archived-repos into main

Created by: varsanojidan

Closes https://github.com/sourcegraph/sourcegraph/issues/38590

This PR is to fix two things:

  1. There is a big in the repositoryQuery option for GitHub codehosts where if you specify "public" and have archived repos excluded, the archived repos still show up on SG.
  2. The search functionality for repositoryQuery as a whole had a bug in it that could cause it to loop infinitely, the bug is fixed and the logic should be simplified.

The fix for the search functionality is considered needed for the fix of the GitHub public archived repo issue, without it for example, running this locally against dogfood would result in an infinite loop.

Test plan

Tested locally on my machine against dogfood ghe, set it to only clone public non-archived repos, reached arounf 130k repos after a few hours. Verified the inverse query (is:public archived:true) returns the 1 matching repo correctly.

Merge request reports

Loading