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

Separate connector upgrade from import #5965

Merged
merged 9 commits into from
Sep 10, 2021

Conversation

tuliren
Copy link
Contributor

@tuliren tuliren commented Sep 10, 2021

What

How

  • Call the loadData method after the configs are imported.

Recommended reading order

  1. ConfigDumpImporter.java

@github-actions github-actions bot added the area/platform issues related to the platform label Sep 10, 2021
@tuliren tuliren marked this pull request as ready for review September 10, 2021 05:38
importConfigsFromArchive(sourceRoot, seedPersistence, false);
// 4. Import Configs and update connector definitions
importConfigsFromArchive(sourceRoot, false);
configRepository.loadData(seedPersistence);
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@jrhizor jrhizor left a 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!

@tuliren
Copy link
Contributor Author

tuliren commented Sep 10, 2021

The failed auto migration test is being worked on in #5984.

@tuliren tuliren merged commit b53d826 into master Sep 10, 2021
@tuliren tuliren deleted the liren/separate-connector-upgrade-from-import branch September 10, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate connector definition update from the config import
3 participants