Skip to content

Search backend: reorganize job packages

Administrator requested to merge cc/jobutil into main

Created by: camdencheek

This reorganizes the job packages to simplify some package dependencies. The main issue is that the internal/search/job package effectively could not be imported by any other search package because it imported many search packages so it could have a list of allJobs. Importing it would cause circular dependencies.

This inverts the package structure so that the internal/search/job package is more minimal and only imports the packages necessary to define the job interface. This will allows us to define shared helpers in the job package (such as the ones in internal/search/job/observe.go) that can be used by every job that implements the interface.

For now, most of the code that lived in the internal/search/job package has been moved into the internal/search/job/jobutil subpackage that makes use of the definitions in internal/search/job. I plan to continue reorganizing this and moving things out of the jobutil package as it makes sense. However, for now, this is mostly just to enable followup PRs on runtime dependencies and tracing.

Test plan

Semantics-preserving and covered by unit tests. Just a package reorganization.

Merge request reports

Loading