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: switch Groups stream to use cursor pagination #2012

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

Alex-Bair
Copy link
Contributor

@Alex-Bair Alex-Bair commented Oct 2, 2024

Description:

Previously, the Groups stream was inheriting from the BaseSourceZendeskSupportStream class, meaning it paginated by retrieving the total number of results from a /count endpoint, calculated how many pages there should be based off that count, then concurrently sent requests for those pages of results. When I added the exclude_deleted param earlier to all Groups requests, I didn't ensure that the /count endpoint would include deleted groups. It does not, and it doesn't accept the exclude_deleted query param. So when the connector was calculating how many pages there should be, it wasn't including deleted groups in the total count, and we were missing results.

Instead of keeping Groups as a BaseSourceZendeskSupportStream that uses this older method of pagination, I switched Groups to use cursor pagination. The stream's behaviour and document schema remained the same, only how it queries the Zendesk API changed.

We should move Macros and TicketFields off of BaseSourceZendeskSupportStream too since their current pagination method has limitations that don't exist for the newer cursor pagination-based classes, but that can be done at a later time.

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:

  • All results for Groups were retrieved.
  • All tests pass.

All Groups bindings for existing tasks will need backfilled after merging this PR to clear out previous state.


This change is Reviewable

Previously, the `Groups` stream was inheriting from the
`BaseSourceZendeskSupportStream` class, meaning it paginated by
retrieving the total number of results from a `/count` endpoint,
calculated how many pages there should be based on that count, then
concurrently sent requests for those pages of results. When I added the
`exclude_deleted` param earlier to all `Groups` requests, I didn't
ensure that the `/count` endpoint would include deleted groups. It does
not, and it doesn't accept the `exclude_deleted` query param. So when
the connector was calculating how many pages there should be, it wasn't
including deleted groups in the total count, and we were missing results.

Instead of keeping `Groups` as a `BaseSourceZendeskSupportStream` that
uses this older method of pagination, I switched `Groups` to use cursor
pagination. The stream's behaviour and document schema remained the
same, only how it queries the Zendesk API changed. We should move
`Macros` and `TicketFields` off of `BaseSourceZendeskSupportStream` too,
but that can be done at a later time.
@Alex-Bair Alex-Bair added the change:unplanned Unplanned change, useful for things like doc updates label Oct 2, 2024
Zendesk Support's API is no longer returning the `configuration.explore_reports` field for custom roles. This reverts the snapshot change done in PR #1991.
@Alex-Bair
Copy link
Contributor Author

In the 30 minutes from when I tested locally & created the PR, Zendesk Support's API stopped including the configuration.explore_reports field in custom roles (the same field they added over the weekend & we merged PR #1991 earlier this week to address). I've removed that field from our capture snapshot so our tests can pass.

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 0e42de3 into main Oct 2, 2024
68 of 75 checks passed
@Alex-Bair Alex-Bair deleted the bair/zendesk-support-groups-pagination branch October 2, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:unplanned Unplanned change, useful for things like doc updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants