From cedc3018b4dc3769dd017c45ced0162003e8a16d Mon Sep 17 00:00:00 2001 From: Alex Bair Date: Fri, 11 Oct 2024 18:00:46 -0400 Subject: [PATCH] source-zendesk-support: omit tags from capture snapshot The `/tags` endpoint returns the most popular tags used in the last 60 days. After 60 days, it's possible for existing tags to not be returned if they weren't used recently. The capture snapshot has been failing in CI because of this. Instead of making a reminder to go into Zendesk every 2 months and use a tag, I think it's easier to just remove tags from the capture snapshot. --- .../snapshots__capture__capture.stdout.json | 12 ------------ source-zendesk-support/tests/test_snapshots.py | 13 +++++-------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/source-zendesk-support/tests/snapshots/snapshots__capture__capture.stdout.json b/source-zendesk-support/tests/snapshots/snapshots__capture__capture.stdout.json index be8a50f44..488e1a1b6 100644 --- a/source-zendesk-support/tests/snapshots/snapshots__capture__capture.stdout.json +++ b/source-zendesk-support/tests/snapshots/snapshots__capture__capture.stdout.json @@ -296,18 +296,6 @@ "url": "https://d3v-estuary.zendesk.com/api/v2/slas/policies/29006807867284.json" } ], - [ - "acmeCo/tags", - { - "_meta": { - "op": "u", - "row_id": 0, - "uuid": "DocUUIDPlaceholder-329Bb50aa48EAa9ef" - }, - "name": "redacted", - "count": 1 - } - ], [ "acmeCo/ticket_audits", { diff --git a/source-zendesk-support/tests/test_snapshots.py b/source-zendesk-support/tests/test_snapshots.py index cd6b1fb24..b93f99313 100644 --- a/source-zendesk-support/tests/test_snapshots.py +++ b/source-zendesk-support/tests/test_snapshots.py @@ -3,6 +3,10 @@ def test_capture(request, snapshot): + OMITTED_STREAMS = [ + "acmeCo/tags", + ] + result = subprocess.run( [ "flowctl", @@ -25,7 +29,7 @@ def test_capture(request, snapshot): for line in lines: stream = line[0] - if stream not in seen: + if stream not in seen and stream not in OMITTED_STREAMS: unique_stream_lines.append(line) seen.add(stream) @@ -37,13 +41,6 @@ def test_capture(request, snapshot): rec["updated_at"] = "redacted" if "last_login_at" in rec: rec["last_login_at"] = "redacted" - if stream == "acmeCo/tags": - rec["name"] = "redacted" - # Updating count with rec["count"] = 1 sets count to be - # the tuple [1] instead of the int 1. We can get around - # this by deleting the attribute then re-setting it. - del rec["count"] - rec["count"] = 1 assert snapshot("capture.stdout.json") == unique_stream_lines