Skip to content

repos: Add blocking support

Administrator requested to merge add-blocked-column-to-repo-table into main

Created by: tsenart

This change set implements support for blocking specific repositories in Sourcegraph. This grew out of the need to block poison pill repositories such as https://github.com/Katee/git-bomb or https://github.com/cdnjs/cdnjs which gitserver or zoekt don't handle well.

For now, we'll be manually blocking repos using a direct SQL query in production. In the future, we expect to automate this process based on certain heuristics that we'll find over time. Manual and automatic blocking of repos is also a useful feature for large customers which have numerous corrupt, unindexable or uncloneable repos that aren't straightforward to filter out in the external service configuration.

I chose to add a column to repo for performance reasons — adding yet another join to these core queries would be detrimental to latency and it can be avoided with this little bit of denormalization. If someone feels strongly against this, I'm open to investigate the alternatives in more detail and provide data, but we need this functionality sooner rather than later to handle these poison pill repos in production.

Merge request reports

Loading