a8n: Inject the ChangesetSyncer from enterprise into repo-updater as sub syncer
Created by: mrnugget
This removes the ChangesetSyncer
goroutine from ./enterprise/cmd/frontend
as planned in https://github.com/sourcegraph/sourcegraph/issues/5678
It does that by injecting a SubSyncer
(something that gets run inside the repos.Syncer
) constructor into the shared.Main()
function both repo-updater
binaries call.
This is a first idea of how we can "extend" the open-source version of repo-updater
in enterprise
without using global hooks.
I'm not entirely sure there's not a better solution possible, but I think this is also fine for a first step.
Happy about any feedback on this!
Thoughts on the constraints and possible other solutions:
Since the complete runtime setup (database connections, http client factories, store, ...) still needs to happens in the open-source version of repo-updater
, we cannot pull it out into the enterprise version and then pass things "down" into open-source, which needs to work standalone.
And since right now enterprise and open-source only differ in the "middle part" (how they construct the Syncer
), it's hard to see a solution that doesn't inject something without duplicating either the "first" or "last" parts of the Main()
function.