-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 ZenDesk Support: fix 404 responses for the ticket_comments stream #6513
🐛 Source ZenDesk Support: fix 404 responses for the ticket_comments stream #6513
Conversation
Maksym Pavlenok seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
/test connector=connectors/source-zendesk-support
|
/test connector=connectors/source-zendesk-support
|
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
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.
Awesome, adding a few useful things here. Could you update the title/description to reflect all that (since it's more than just fixing the 404 bug).
Just one main concern at the moment in my comments.
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py
Outdated
Show resolved
Hide resolved
) | ||
|
||
if ticket_pages: | ||
last_times = sorted(ticket_pages.keys()) |
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.
based on doing ticket_pages[tickets_stream.last_end_time].append(...
above, won't ticket_pages just have one unique key which is Tickets(start_date=self._start_date, subdomain=self._subdomain, authenticator=self.authenticator).last_end_time
?
This code seems like it expects multiple...
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.
(relevant down to line 430)
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 necessary, the option last_end_time is updated by every new request to the zendesk server. And there is an probability that a bit of tickets were updated simultaneously. For example: Some script added 3000 comments to 3000 tickets. All them would have same updated time. And as result this connector would load same last_end_time value for 3 different consistent reques. Thus this logic tries to aggregate all tickets with same last_end_time.
Sure, this probability is unlikely but I added the aggregation just in case
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.
Understood, I was missing the knowledge that last_end_time
gets updated on every request. It may already be commented somewhere but would be good to have comments in this logic as well to explain that.
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/spec.json
Show resolved
Hide resolved
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/source.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/spec.json
Show resolved
Hide resolved
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py
Show resolved
Hide resolved
…zendesk_support/streams.py Co-authored-by: George Claireaux <george@claireaux.co.uk>
Co-authored-by: Davin Chia <davinchia@gmail.com>
…hub.com:airbytehq/airbyte into antixar/6249-zendesk-support-not-found-comments
/test connector=connectors/source-zendesk-support
|
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.
Great lgtm, minor comments and code suggestions but all good to publish/merge when addressed 👍
# from airbyte_cdk.sources.streams.http.auth.token import TokenAuthenticator | ||
|
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.
# from airbyte_cdk.sources.streams.http.auth.token import TokenAuthenticator |
) | ||
|
||
if ticket_pages: | ||
last_times = sorted(ticket_pages.keys()) |
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.
Understood, I was missing the knowledge that last_end_time
gets updated on every request. It may already be commented somewhere but would be good to have comments in this logic as well to explain that.
airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py
Outdated
Show resolved
Hide resolved
Co-authored-by: George Claireaux <george@claireaux.co.uk>
…zendesk_support/streams.py Co-authored-by: George Claireaux <george@claireaux.co.uk>
/test connector=connectors/source-zendesk-support
|
/test connector=connectors/source-zendesk-support
|
/publish connector=connectors/source-zendesk-support
|
@@ -23,6 +23,17 @@ | |||
"default": "api_token", | |||
"description": "Zendesk service provides 2 auth method: API token and oAuth2. Now only the first one is available. Another one will be added in the future", | |||
"oneOf": [ | |||
{ | |||
"type": "object", | |||
"title": "OAuth2.0 authorization (not implemented)", |
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.
Why are we adding this if it's not implemented? A user who sees this will lose confidence in the product
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 was planned as temporary gap for the oauth future functionality. I remember to CI tests checked that oneOf items have to include more than 1 subitem. But now I see CI passes this test without problems.
You're right to it will be able to confuse users.
I've added a PR with correction.
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 got it. thanks for making the change!
@antixar is this PR also introducing oauth support? I am asking because the title doesn't reflect it, so we should either make sure to update the title appropriately Also, please make sure to update the PR description in the future -- it's not clear to the reader what the root cause exactly is or how the PR solves it unless they read the whole PR which in this case is not trivial |
@sherifnada , Initially this PR included correction for 2 critical bugs (they were fixed 2 weeks ago). Unfortunately oauth2 development is blocked. Thus I splitted all oauth2 logic to another PR. It will be bumped by separate version. |
…tream (airbytehq#6513) * fix 404 responses for the ticket_comments stream * add unit test * add unit test * add oauth2 access token * Update airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py Co-authored-by: George Claireaux <george@claireaux.co.uk> * switching among auth methods * Update docs/integrations/sources/zendesk-support.md Co-authored-by: Davin Chia <davinchia@gmail.com> * add log message for 404 errors * Update docs/integrations/sources/zendesk-support.md Co-authored-by: George Claireaux <george@claireaux.co.uk> * Update airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py Co-authored-by: George Claireaux <george@claireaux.co.uk> * remove oauth logic from this PR * remove oauth logic from this PR Co-authored-by: Maksym Pavlenok <maksym.pavlenok@globallogic.com> Co-authored-by: George Claireaux <george@claireaux.co.uk> Co-authored-by: Davin Chia <davinchia@gmail.com>
What
There is an issue with relevant statutes for a lot of tickets. Some of them can be deleted by users while comments loading.
How
Need to handle 404 code responses for same cases.
Recommended reading order
streams.py
Pre-merge Checklist
Updating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described here