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

source-zendesk-support: update ticket_audits to checkpoint during backfills #2288

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

Alex-Bair
Copy link
Member

@Alex-Bair Alex-Bair commented Jan 22, 2025

Description:

The previously used /ticket_audits endpoint used to list all ticket audits always returns results in descending order and did not let us specify a date window/start date to filter what results are returned. This prevented the connector from checkpointing during backfills, and if backfills spanned 24+ hours, they wouldn't complete since the CDK restarts the connector after it's been running for 24 hours.

The ticket_audits stream now uses tickets as a parent stream, fetching an updated ticket then fetching the audits for that ticket. Although this makes the stream slower since it now makes more HTTP requests to get results, this is the only way I found to get ticket_audits in ascending order & let us checkpoint progress for backfills spanning 24+ hours.

Additional scope in this PR includes:

  • Widening schemas/ticket_audits.json to account for schema violations encountered during testing
  • Coercing any boolean values for custom fields in tickets to strings. This is the same processing implemented in source-zendesk-support: handle bools in ticket_skips documents #1802. This was also motivated by schema violations encountered during testing.
  • Updating tests for the changes made in the PR.

Snapshot changes are expected. Discover snapshot changes are due to the changes to ticket_audits and schema widening. Capture snapshot changes are due to fields Zendesk added to some streams a while ago. These fields have been present and stable for a couple months now, so it should be alright to add them to the capture snapshot.

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 a local stack. Confirmed:

  • ticket_audits checkpoints during backfills.
  • tickets and users streams' behaviors have not changed.
  • no schema violations occurred for the relatively small date ranges I tested over.

All existing captures should backfill their ticket_audits stream after this PR is merged due to the state change.


This change is Reviewable

…ackfills

The previously used `/ticket_audits` endpoint used to list all ticket
audits always returns results in descending order and did not let us
specify a date window/start date to filter what results are returned.
This prevented the connector from checkpointing during backfills, and if
backfills spanned 24+ hours, they wouldn't complete since the CDK
restarts the connector after it's been running for 24 hours.

The `ticket_audits` stream now uses `tickets` as a parent stream,
fetching an updated ticket then fetching the audits for that ticket.
When testing out changes to the `ticket_audits` stream, I encountered
schema violations. These updates are my attempt to address the schema
violations, but I only tested over a short period of time, so further
schema updates may be necessary later too.
…ings

This commit applies the same transformation logic to `tickets` like in
1b8df5d.
@Alex-Bair Alex-Bair marked this pull request as ready for review January 22, 2025 17:43
Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

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

LGTM

@Alex-Bair Alex-Bair merged commit d117438 into main Jan 22, 2025
76 of 82 checks passed
@Alex-Bair Alex-Bair deleted the bair/zendesk-support-ticket-audits branch January 22, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants