Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract StandardSyncPersistence from DatabaseConfigPersistence #18930

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

gosusnp
Copy link
Contributor

@gosusnp gosusnp commented Nov 3, 2022

What

ConfigRepository is getting too big, breaking it out into more specific classes would help separation of concerns and more specific dependency injection.
ConfigPersistence and its implementation are convoluted with some form of fan in/out dispatch on its operation. We want to move away from those objects.

How

Extract StandardSync related operations into a StandardSyncPersistence as a first step.
It is still used under the hood by ConfigRepository, to minimize the span of this change.

Medium term next step would be to have clients use the StandardSyncPersistence directly, but this step should become more straightforward once the APIs are broken up and we are using micronaut in the airbyte-server.

Recommended reading order

StandardSyncPersistence contains the code that has been extracted from DatabaseConfigPersistence. Logic change should be minimal, mostly moving code around.

}

@VisibleForTesting
ConfigRepository(final ConfigPersistence persistence, final Database database, final ActorDefinitionMigrator actorDefinitionMigrator) {
ConfigRepository(final ConfigPersistence persistence,
Copy link
Contributor

@jdpgrailsdev jdpgrailsdev Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may make sense to just make this constructor the one, public constructor in order to better support dependency injection and better support inversion of control.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that's how we should be doing it eventually, for now, I'd rather not to avoid extra breaking changes with cloud.

Copy link
Contributor

@jdpgrailsdev jdpgrailsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: LGTM -- just one nit about the ConfigRepository constructor, but that change can be done as a separate PR, as it will also introduce some breaking changes.

@gosusnp gosusnp merged commit d405bc9 into master Nov 3, 2022
@gosusnp gosusnp deleted the gosusnp/breakout-standard-sync-persistence branch November 3, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants