sourcebot-dev / sourcebot

Blazingly fast code search 🏎️ Deployed as a single Docker image 📦 Search million+ lines of code in your GitHub and GitLab repositories 🪄 MIT licensed ✅
MIT License
938 stars 24 forks source link

GitLab repositories remain indexed after Sourcebot no longer has access to them #39

Open jerrykan opened 3 days ago

jerrykan commented 3 days ago

We have Sourcebot set up to index repositories hosted in a self-hosted GitLab instance. A dedicated Sourcebot account in GitLab is used to determine which repositories it has access to (by adding the user as a member of a repository or group) and only indexes those repositories.

However, if the Sourcebot user is removed as a member from a repository (or group) the repository remains in Sourcebot (presumably with a stale index).

What I would expect to happen is if Sourcebot no longer has access to a repository (or the repository has been deleted) then the repository should be removed from Sourcebot.

brendan-kellam commented 1 day ago

Thanks for the issue - yea I think this expectation makes sense. We are introducing a new index server in #42 that will mark repositories as "stale" when they were previously indexed, but are not longer found.

I think what would work well is if we have some "automatically delete stale repositories" setting that, when enabled, will auto delete a stale repo's folder & any indexes associated with it.