Skip to content

chore: remove circular dependencies with logging migration tests

Joe Shaw requested to merge joe/circular_logs_test_dep into main

Moves logging migrations test setup and migrations setup into the db/migrations package as these are used in various other locations.

I think these naturally fit here, and when other migrations can be cleaned up we should move all migration/test setup logic into this package.

Related to #2634

Circular migration code was revealed when any go mod download operations ran, in particular:

go: gitlab.com/gitlab-org/opstrace/opstrace/go/pkg/query-api/analytics tested by
        gitlab.com/gitlab-org/opstrace/opstrace/go/pkg/query-api/analytics.test imports
        gitlab.com/gitlab-org/opstrace/opstrace/scheduler/controllers/cluster/test imports
        gitlab.com/gitlab-org/opstrace/opstrace/scheduler/controllers/cluster imports
        gitlab.com/gitlab-org/opstrace/opstrace/clickhouse-operator/api/v1alpha1: gitlab.com/gitlab-org/opstrace/opstrace/clickhouse-operator@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000

In this case the go module is trying actually to download the scheduler operator and various dependencies as it does not have a replace directive.

Edited by Joe Shaw

Merge request reports