-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
tolerate missing source catalog used to make the configured catalog #20928
Conversation
* Diffing the catalog used to make the configured catalog gives us the clearest diff between the | ||
* schema when the configured catalog was made and now. In the case where we do not have the | ||
* original catalog used to make the configured catalog, we make due, but using the configured | ||
* catalog itself. The drawback is that any stream that was not selected in the configured catalog | ||
* but was present at time of configuration will appear in the diff as an added stream which is | ||
* confusing. We need to figure out why source_catalog_id is not always populated in the db. | ||
*/ | ||
syncCatalog = updateSchemaWithRefreshedDiscoveredCatalog(configuredCatalog, catalogUsedToMakeConfiguredCatalog.orElse(configuredCatalog), |
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.
in the update endpoint, we just check to make sure that catalogUsedToMakeConfiguredCatalog is present before calling this. Maybe we should do the same thing here?
final Optional<AirbyteCatalog> catalogUsedToMakeConfiguredCatalog = connectionsHandler
.getConnectionAirbyteCatalog(connectionId);
if (catalogUsedToMakeConfiguredCatalog.isPresent()) {
// Update the Catalog returned to include all streams, including disabled ones
final AirbyteCatalog syncCatalog =
updateSchemaWithRefreshedDiscoveredCatalog(updatedConnectionRead.getSyncCatalog(), catalogUsedToMakeConfiguredCatalog.get(),
catalogUsedToMakeConfiguredCatalog.get());
updatedConnectionRead.setSyncCatalog(syncCatalog);
}
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.
The behaviour here is that if the catalogUsedToMakeConfiguredCatalog
is missing, then we'll show any previously de-selected fields as "newly added" rather than "already existed but de-selected". This is indeed not ideal, but not returning a diff is also a problem since the frontend needs the diff to decide what to display to the user.
The previous decision was that if we don't have the catalogUsedToMakeConfiguredCatalog then we can wrongly display streams as newly-added, so this approach is consistent with that.
I don't actually understand the behaviour in the update endpoint - it may be that the frontend isn't actually using the value returned by the update endpoint? Otherwise, I can't figure out how it's okay to just sometimes not populate the sync catalog field?
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.
ah I see what you're saying here. I'd have to look at the update endpoint more closely to figure out the logic there, I'm not 100% sure why it would be ok to not populate sync catalog. but I think for this endpoint this is fine
/approve-and-merge reason="address oc issue https://github.com/airbytehq/oncall/issues/1247" |
What
Tolerate a missing source catalog used to make the configured catalog.
How
Use the configured catalog itself. This is a bandaid -- instead we should have clear guarantees about whether that source catalog should exist -- but it's consistent with the existing approach.