sourcegraph/internal/database/dbtest
Anton Sviridov 2821447ae5
Syntactic indexing: enqueuer and scheduler (#62485)
This PR introduces three main components:

    Enqueuer – a thin layer responsible for actually inserting the syntactic indexing records into the database.
    Scheduler - a service that
        Identifies repositories that haven't been processed in a while
        Identifies policies that match those repositories (policies that have syntactic indexing enabled)
        Identifies commits that match any of the policies
        And finally, enqueues the jobs to index the discovered repositories and commits
    Scheduler job – a periodic routine that triggers Scheduler on with specified interval. This job runs as part of the main Worker service, and only schedules jobs if the experimental syntactic indexing feature is enabled.

Refactoring:

    Making some methods public in policies.Service to make it easier to test logic that depends on glob matching of repository names (this matching requires a separate state to be updated)
    Extracting some test utilities into a separate package

---------

Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
2024-05-31 10:25:30 +01:00
..
BUILD.bazel Chore: construct logger inside dbtest.NewDB (#57549) 2023-10-11 20:41:11 -05:00
CODENOTIFY codenotify: dr. fritz is kil (#57313) 2023-10-03 16:19:55 +00:00
dbtest.go Syntactic indexing: enqueuer and scheduler (#62485) 2024-05-31 10:25:30 +01:00
dsn_test.go sg: Add db delete-test-dbs (#43197) 2022-10-19 21:46:20 +00:00
dsn.go Housekeeping: Rename variables to avoid collisions with packages (#47179) 2023-01-31 16:28:43 +01:00