-
Notifications
You must be signed in to change notification settings - Fork 18
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
source-monday: new connector #2405
Conversation
Looking really good so far! No major issues that I can see, and not even really any minor issues from a quick look. Some general thoughts:
|
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.
Partial self review
Limitation(s) identified:
|
@williamhbaker I have moved this to ready for review. I have made the minor changes we discussed in Slack and on our previous VC. |
I am checking into CI failure now. I tested locally and all worked fine, but I had my |
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.
Made some inline comments below!
A couple of more general things:
- I recommend enabling a type checker and fixing anything it flags if you haven't already done that. I mention this in one of my comments as well - I pulled this PR down and pylance flagged a few things that I think are legitimate issues to resolve.
- The
graphql.py
code could benefit from some more explicit data modeling. Ideally we'd have pydantic models to represent the shape of the API responses, and could use those in place of more dynamic typing and dictionary lookups. I am 100% sure how practical this will be do to so this isn't a total blocker, but if you're able to make any improvements there I think it would help the maintainability of the code.
4a2dae4
to
5862d30
Compare
subitems: list["Item"] | None = None | ||
|
||
|
||
Item.model_rebuild() |
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.
Not sure what this does?
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.
This will rebuild the model schema, which I think is needed since subitems
is a Forward Reference and Python cannot know what Item
is at class definition time for this subitems
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.
Hmm we have lots of examples of using forward references that just put the class name in quotes. What happens if you get rid of this Item.model_rebuild
line?
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.
Hmm you are right. I guess I did not need that after all. I will update to remove that line since I just tested without and everything worked as expected!
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.
LGTM
One remaining tiny question, but overall the updates look good!
This is a new connector for Monday.com. The requirements for this connector are to incorporate the following streams: - Boards - Items - Tags - Teams - Users The connector will be able to perform full refreshes and incremental updates on `Boards` and `Items` using the Activity Log. The rest are full refresh. Monday's API is GraphQL-based, which comes with complexity and rate limits. To combat this we do not select all fields in the GraphQL query, but instead only select a smaller subset. The streams are in full parity with the fields that Airbytes Monday source connector has. We can easily add additional fields or streams if needed later. Monday's Activity Logs do not capture all possible events. The one event we know of now is renaming a subitem. This event is not captured and therefore will not be reflected in the incremental updates. However, there are CDK improvements being worked that will support scheduled backfills which can be used to schedule backfills for the stream. The connector supports API Access tokens as the authentication method. The Monday OAuth2 app will be set up and submitted to Monday for review so that OAuth2 can be usesd for authentication in the future.
Add an additional method of authentication using the authorization code flow grant type in the request to get access tokens. This is required by Monday.com. So this update supports the `source-monday` connector OAuth2 authentication once that is enabled.
5862d30
to
1b1497c
Compare
Description:
This is an initial version of a connector to capture Boards, Teams, Users, Items, and Tags from Monday's GraphQL API.
There are GraphQL/API limitations worth mentioning:
Currently the streams are set up on a 5 minute interval. However, the API still produces HTTP 429 (i.e.,
Too Many Requests
) even with this interval since each binding try to execute concurrently. TheHTTPSession
class is already set up to handle rate limiting, back off, and retry. This has seemed to work okay, but Monday.com also has a way to check the current complexity budget and complexity cost of a query. I have a function that can be used to check the current budget and wait until the complexity budget next resets. We may either need to use the complexity checks or extend the CDK to have some sort of queuing mechanism for requests so that we do not exceed complexity or requests per minute limitations.Workflow steps:
(How does one use this feature, and how has it changed)
Documentation links affected:
(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)
Notes for reviewers:
Tested on local stack. Confirmed:
OAuth
works as expected in the UI when setting theredirect_uri
tolocalhost:3000
for the OAuth app in Monday.com.flowctl preview
shows valid results in standard out.flowctl raw spec
SpecFailed
errors again when installing connector in local stack.OAuth2 Enhancements:
AuthorizationCodeFlowOAuth2Credentials
class to support authorization code flow in OAuth2.TokenSource
to handleAuthorizationCodeFlowOAuth2Credentials
in thefetch_token
and_fetch_oauth2_token
methods. [1] [2] [3] [4]This change is