Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): add 1 missing table to the Givebutter source (#117443)

Tom Owersae6b7d668cdd
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
index 6f658352321b..dcefc07441eb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
@@ -5286,7 +5286,7 @@ Today (14): `campaign_discount_codes`, `campaign_members`, `campaign_teams`, `ca
Diffed against: <https://givebutter.com/docs/api.json>
-- [ ] `Messages (GET /v1/messages)` — compare donor outreach volume, delivery status, recipient counts, and campaign timing with donation activity (medium)
+- [x] `Messages (GET /v1/messages)` — compare donor outreach volume, delivery status, recipient counts, and campaign timing with donation activity (medium) Added as `messages` (full refresh). The endpoint accepts no timestamp filter.
Note: Parsed all GET operations in the official OpenAPI specification and compared them with the static endpoint catalog. Household responses already contain contacts, so the household contacts endpoint adds no missing membership data. Excluded webhook activity, webhook management, and SSO operations.
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/canonical_descriptions.py
index 483f53a8dba8..32eba08e2f8c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/canonical_descriptions.py
@@ -59,6 +59,17 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"head_contact_id": "Identifier of the household's head contact.",
},
},
+ "messages": {
+ "description": "Email and text messages sent to supporters, including delivery status, recipient count, and send times.",
+ "docs_url": "https://docs.givebutter.com/api-reference/messages/list-all-messages",
+ "columns": {
+ "id": "Unique message identifier.",
+ "status": "Delivery status of the message.",
+ "channel": "Channel used to send the message.",
+ "recipient_count": "Number of recipients of the message.",
+ "sent_at": "Time the message was sent.",
+ },
+ },
"payouts": {
"description": "Payouts of raised funds, including amounts, fees, payment methods, and payout status.",
"docs_url": "https://docs.givebutter.com/api-reference/payouts/list-all-payouts",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/settings.py
index 97eb2db5d1e1..93e886e0a641 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/settings.py
@@ -47,6 +47,7 @@ ENDPOINTS: dict[str, GivebutterEndpoint] = {
"households": GivebutterEndpoint(
path="households", data_selector=None, paginator=PageNumberPaginator(base_page=1), page_size=None
),
+ "messages": GivebutterEndpoint(path="messages"),
"payouts": GivebutterEndpoint(path="payouts"),
"plans": GivebutterEndpoint(path="plans"),
"pledges": GivebutterEndpoint(path="pledges"),
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/tests/test_givebutter.py b/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/tests/test_givebutter.py
index 860f704cfd7e..479ac7a6e5f0 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/tests/test_givebutter.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/givebutter/tests/test_givebutter.py
@@ -58,15 +58,33 @@ def pages(response: SourceResponse) -> Generator[list[dict[str, Any]]]:
return cast(Generator[list[dict[str, Any]]], iter(items))
+ ("table", "first", "second"),
+ [
+ (
+ "transactions",
+ {"id": "txn-one", "created_at": "2025-01-01T00:00:00Z", "amount": 25},
+ {"id": "txn-two", "created_at": "2025-01-02T00:00:00Z", "amount": 10},
+ ),
+ (
+ "messages",
+ {"id": "msg-one", "status": "sent", "channel": "email", "recipient_count": "12", "sent_at": None},
+ {"id": "msg-two", "status": "draft", "channel": "sms", "recipient_count": "0", "sent_at": None},
+ ),
+ ],
+)
def test_pagination_and_resume_after_yield(
requests_mock: Mocker,
inputs: SourceInputs,
manager: ResumableSourceManager[GivebutterResumeConfig],
+ table: str,
+ first: dict[str, Any],
+ second: dict[str, Any],
) -> None:
- next_url = API + "transactions?page=2&per_page=100"
- first = {"id": "txn-one", "created_at": "2025-01-01T00:00:00Z", "amount": 25}
- last = [{"id": "txn-two", "created_at": "2025-01-02T00:00:00Z", "amount": 10}]
- requests_mock.get(API + "transactions", json={"data": [first], "links": {"next": next_url}})
+ inputs.schema_name = table
+ next_url = API + f"{table}?page=2&per_page=100"
+ last = [second]
+ requests_mock.get(API + table, json={"data": [first], "links": {"next": next_url}})
requests_mock.get(next_url, json={"data": last, "links": {"next": None}})
iterator = pages(givebutter_source("test-api-key", inputs, manager))