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

tolerate missing source catalog used to make the configured catalog #20928

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

mfsiega-airbyte
Copy link
Contributor

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.

@mfsiega-airbyte mfsiega-airbyte requested a review from a team as a code owner December 29, 2022 20:18
@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/server labels Dec 29, 2022
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets December 29, 2022 20:19 — with GitHub Actions Inactive
* 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),
Copy link
Contributor

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);
    }

Copy link
Contributor Author

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?

Copy link
Contributor

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

@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets December 29, 2022 20:59 — with GitHub Actions Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets December 29, 2022 20:59 — with GitHub Actions Inactive
@mfsiega-airbyte
Copy link
Contributor Author

/approve-and-merge reason="address oc issue https://github.com/airbytehq/oncall/issues/1247"

@octavia-approvington
Copy link
Contributor

After a careful ML study,
we think this looks okay.
imagine code being okay

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 area/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants