-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Separate connector upgrade from import #5965
Conversation
importConfigsFromArchive(sourceRoot, seedPersistence, false); | ||
// 4. Import Configs and update connector definitions | ||
importConfigsFromArchive(sourceRoot, false); | ||
configRepository.loadData(seedPersistence); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something, but doesn't loadData
need to handle the upgrade checks that we were handling in importConfigsFromArchive
before to ensure we aren't overwriting source and destination definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, DatabaseConfigPersistence#loadData
does avoid updating a connector if it is used. The FileSystemConfigPersistence#loadData
overwrites everything, but it is not used. Let me change it to throw an exception.
These existing tests ensure that we don’t update a connector definition if it is in use:
https://github.com/airbytehq/airbyte/blob/master/airbyte-config/persistence/src/test/java/io/airbyte/config/persistence/DatabaseConfigPersistenceLoadDataTest.java
https://github.com/airbytehq/airbyte/blob/master/airbyte-server/src/test/java/io/airbyte/server/handlers/ArchiveHandlerTest.java#L163
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing to approve. Didn't realize that in a more recent PR the loadData
behavior changed. Thanks @tuliren for pointing that out!
The failed auto migration test is being worked on in #5984. |
What
importConfigsFromArchive
method. This makes the code complicated and buggy (see thread).importConfigsFromArchive
method, and instead do that with the newloadData
method separately.How
loadData
method after the configs are imported.Recommended reading order
ConfigDumpImporter.java