Skip to content

codeintel: Collapse interfaces

Administrator requested to merge ef/remove-interfaces into main

Created by: efritz

Why the heck: I needed to update metrics for additions to the auto indexer as well as changes to the service topology (addition of minio, the removal of the bundle manager). The current dashboards are super duper outdated and shouldn't be released in this state. In order to clean up the metrics, which were made difficult to change due to the old observability layer pattern which I now regret, I had to do some refactoring. Details are given below.

This closes https://github.com/sourcegraph/sourcegraph/issues/14609.

What the heck:

  • Remove mocks/ packages
  • Remove interface definitions for things for which there is one canonical implementation. Because there are several implementations for the upload store, this is still a common interface between S3 and GCS APIs. This removes a lot of indirection through interfaces which was bad for code nav in the code intel codebase.
  • Add interfaces at the use site where they need to be mocked for tests. This allows each package with a dependency to define the minimal set of methods they need to operate.
  • Begin to inline metrics into the structs themselves instead of having it separated in an observability layer.

Next heckin' step: Add back the spans and metrics for each observable operation. This will be done in a stacked PR for readability.

This change was very mechanical and I have high confidence nothing changed. Unit and integration tests still pass just fine, so everything is still wired up correctly.

Merge request reports

Loading