symbols: Key on version directory
Created by: chrismwendt
Before this, the symbols service could accidentally read a SQLite DB from the same repo but different application-level SQLite DB version. This would happen when bumping the version and then doing a symbol search with a previously indexed SQLite DB on disk. Here's what the disk structure looked like:
<repo> / <commit>-<version>
Different versions would be right alongside each other:
github.com/foo/bar / 1234-4.zip
github.com/foo/bar / 1234-5.zip <-- while building this DB, the symbols service would try to reuse v4 above and fail
After this, the disk structure will be:
<version> / <repo> / <commit>
That way, grabbing a previously-indexed SQLite DB from the repo dir will always give you a SQLite DB with the same version.
Encountered in https://github.com/sourcegraph/sourcegraph/pull/32299
Depends on https://github.com/sourcegraph/sourcegraph/pull/32301
Test plan
Ran it locally both ways.