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

update open api in correct place #14652

Merged
merged 5 commits into from
Jul 13, 2022
Merged

update open api in correct place #14652

merged 5 commits into from
Jul 13, 2022

Conversation

alovew
Copy link
Contributor

@alovew alovew commented Jul 12, 2022

  • Update API in correct place to endpoint changes
  • Add in skipReset functionality to new endpoint

@github-actions github-actions bot added area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/server labels Jul 12, 2022
@alovew alovew temporarily deployed to more-secrets July 12, 2022 22:19 Inactive
@alovew alovew temporarily deployed to more-secrets July 12, 2022 22:35 Inactive
@alovew alovew requested a review from gosusnp July 12, 2022 22:35
final List<StreamDescriptor> apiStreamsToReset = getStreamsToReset(catalogDiff);
List<io.airbyte.protocol.models.StreamDescriptor> streamsToReset =
apiStreamsToReset.stream().map(ProtocolConverters::streamDescriptorToProtocol).toList();

ConnectionRead connectionRead;
connectionRead = connectionsHandler.updateConnection(connectionUpdate);
Copy link
Contributor

Choose a reason for hiding this comment

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

In its current state, this PR will reintroduce the bug that Benoit called out, because this is now saving the updated connection before we calculate the diff

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could add a verify InOrder to the tests to catch this in our unit tests, to prevent anyone from reintroducing this bug in the future

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 moved the fetch of the existing catalog before the save though, so I thought that would take care of that?

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 missed that, my bad. This should be fine then 👍

if (stateType == ConnectionStateType.LEGACY || stateType == ConnectionStateType.NOT_SET || stateType == ConnectionStateType.GLOBAL) {
streamsToReset = configRepository.getAllStreamsForConnection(connectionId);
final List<StreamDescriptor> apiStreamsToReset = getStreamsToReset(catalogDiff);
List<io.airbyte.protocol.models.StreamDescriptor> streamsToReset =
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need Benoit's configuration diff change from here for this to be fully working as desired: https://github.com/airbytehq/airbyte/pull/14626/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it ok if these go in separately?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think it's okay, I just wanted to call out that if someone tries to use this endpoint before Benoits change is in then changes to only the configuration of streams will not result in a reset

@alovew alovew temporarily deployed to more-secrets July 12, 2022 23:22 Inactive
@alovew alovew temporarily deployed to more-secrets July 13, 2022 00:10 Inactive
@alovew alovew temporarily deployed to more-secrets July 13, 2022 00:16 Inactive
@@ -1975,6 +1975,27 @@ paths:
$ref: "#/components/schemas/WebBackendConnectionRead"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/web_backend/connections/updateNew:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that this is the superseeded version of an already existing API, could we just name it /v2/web_backend/connections/update? Since we have a version number already in our API paths, this feels like the ideal use-case to leverage it :)

@alovew alovew merged commit 2285c2e into master Jul 13, 2022
@alovew alovew deleted the anne/endpoint-updates branch July 13, 2022 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants