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 schema #13573

Merged
merged 12 commits into from
Jun 10, 2022
Merged

Update schema #13573

merged 12 commits into from
Jun 10, 2022

Conversation

benmoriceau
Copy link
Contributor

What

New modification of the schema.

@github-actions github-actions bot added area/platform issues related to the platform area/protocol labels Jun 7, 2022
@benmoriceau benmoriceau temporarily deployed to more-secrets June 7, 2022 21:05 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets June 9, 2022 16:25 Inactive
@github-actions github-actions bot added the CDK Connector Development Kit label Jun 9, 2022
@benmoriceau benmoriceau temporarily deployed to more-secrets June 9, 2022 16:43 Inactive
@benmoriceau benmoriceau marked this pull request as ready for review June 9, 2022 17:13
@benmoriceau benmoriceau requested review from girarda, pedroslopez, cgardens and jdpgrailsdev and removed request for jdpgrailsdev and cgardens June 9, 2022 17:29
@benmoriceau benmoriceau temporarily deployed to more-secrets June 9, 2022 17:37 Inactive
@@ -1,7 +1,3 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

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

the changes in this file look sus. formatting / linting didn't run?

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, I manually run the generate script and it created this changes. I have posted on the connector channel about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

they responded. sounds like you just need to run build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I managed to finished on build. it is fixed

GLOBAL means that the state should be read from `global` and means that it represents the state for all the streams. It contains one shared
state and individual stream states.
PER_STREAM means that the state should be read from `stream`. The state present in this field correspond to the isolated state of the
associated stream description.
enum:
- GLOBAL
- PER_STREAM
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- PER_STREAM
- STREAM
- LEGACY

Copy link
Contributor

Choose a reason for hiding this comment

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

per @jdpgrailsdev comment let's add legacy

Copy link
Contributor

Choose a reason for hiding this comment

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

also i thought we were just calling it STREAM, not PER_STREAM

Copy link
Contributor

Choose a reason for hiding this comment

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

also good to mention in the description that is the same as LEGACY.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"$ref": "#/definitions/AirbyteStreamState"
StreamDescriptor:
type: object
additionalProperties: false
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any reason not to set this to true? i dunno if we'll ever change how we identify a stream, but i'm not sure there's any value to locking ourselves in.

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 wanted to avoid having the object to generate the extra field additionalProperties where it is not needed. I set it to true for future compatibility.

state:
"$ref": "#/definitions/AirbyteStateBlob"
AirbyteGlobalState:
type: object
additionalProperties: false
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason not to set it to true? I thought generally in the protocol we set this to true for compatibility reasons.

required:
- sharedState
properties:
sharedState:
Copy link
Contributor

Choose a reason for hiding this comment

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

snake case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

type: object
additionalProperties: false
required:
- sharedState
Copy link
Contributor

Choose a reason for hiding this comment

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

snake case

Copy link
Contributor

Choose a reason for hiding this comment

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

also i don't think this should be required. i think it is stream_states that should be required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

properties:
sharedState:
"$ref": "#/definitions/AirbyteStateBlob"
streamStates:
Copy link
Contributor

Choose a reason for hiding this comment

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

snake case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

description: "Stream name"
type: string
streamDescriptor:
"$ref": "#/definitions/StreamDescriptor"
state:
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 spec we called it stream_state. any reason not to stick with that name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It felt like duplication ($.stream.stream_state vs $.stream.state). But I have renamed it because it describe what state is being stored in a better way.

@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 00:08 Inactive
Copy link
Contributor

@cgardens cgardens left a comment

Choose a reason for hiding this comment

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

couple last comments!

additionalProperties: true
required:
- stream_descriptor
- stream_state
Copy link
Contributor

Choose a reason for hiding this comment

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

as written this will fail validations if stream_set: null. I think we want to be able to do that. so i think it can't be required.

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 guess you are speaking of stream_state. On the DB, if the state is null we will remove it from the DB, so it won't be present in the message, that's why it is required. Is is some scenario that was not expected.

Copy link
Contributor

@cgardens cgardens Jun 10, 2022

Choose a reason for hiding this comment

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

yes. sorry. stream_state.

when a connectors wants to reset the state of a stream, I expected it would look like:

type: stream
stream:
  stream_descriptor:
    name: accounts
  stream_state: null

how were you thinking about it?

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 re-request a review even if there is no change at the moment.

@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 01:05 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 18:39 Inactive
Copy link
Contributor

@cgardens cgardens left a comment

Choose a reason for hiding this comment

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

looks great! thanks, @benmoriceau

@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 20:49 Inactive
@benmoriceau benmoriceau force-pushed the bmoric/state-message-model-change branch from 9e27a43 to 4619cd7 Compare June 10, 2022 20:49
@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 20:52 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 21:34 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets June 10, 2022 21:36 Inactive
@cgardens cgardens temporarily deployed to more-secrets June 10, 2022 23:11 Inactive
@benmoriceau benmoriceau merged commit 704dd8b into master Jun 10, 2022
@benmoriceau benmoriceau deleted the bmoric/state-message-model-change branch June 10, 2022 23:36
@cgardens
Copy link
Contributor

wahoo!!!

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/protocol CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants