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(buildkite): add team pipeline, member, schedule and queue tables (#101622)

Tom Owersbba801f36237
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 f159dc83374a..fc4802c17926 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
@@ -1088,7 +1088,7 @@ Note: PostHog's registered api_docs_url (https://docs.buildbetter.app/) no longe
## Buildkite — gaps
-Today (9): `agents`, `builds`, `jobs`, `organizations`, `pipelines`, `teams`, `test_suite_runs`, `test_suite_tests`, `test_suites`
+Today (13): `agents`, `builds`, `cluster_queues`, `jobs`, `organization_members`, `organizations`, `pipeline_schedules`, `pipelines`, `team_pipelines`, `teams`, `test_suite_runs`, `test_suite_tests`, `test_suites`
Diffed against: <https://buildkite.com/docs/llms.txt>
@@ -1097,13 +1097,13 @@ Diffed against: <https://buildkite.com/docs/llms.txt>
- [x] `analytics/organizations/{org}/suites/{suite}/tests (Test Engine tests, label=flaky)` — per-test pass/fail and flaky labelling — the core use case for anyone importing CI data (high)
- [x] `analytics/organizations/{org}/suites` — the suite list the two Test Engine child tables fan out over, and a lookup in its own right (high)
- [x] `organizations/{org}/teams` — lookup table resolving team ownership of the pipelines we already sync (high)
-- [ ] `organizations/{org}/teams/{team}/pipelines` — membership table joining teams to pipelines, needed to attribute build cost per team (high)
-- [ ] `organizations/{org}/members` — lookup resolving the user IDs that appear as build creators and job agents (high)
-- [ ] `organizations/{org}/clusters/{cluster}/queues` — lookup resolving the queue an agent or job ran on — required for agent capacity and cost analysis (medium)
+- [x] `organizations/{org}/teams/{team}/pipelines` — membership table joining teams to pipelines, needed to attribute build cost per team (high)
+- [x] `organizations/{org}/members` — lookup resolving the user IDs that appear as build creators and job agents (high)
+- [x] `organizations/{org}/clusters/{cluster}/queues` — lookup resolving the queue an agent or job ran on — required for agent capacity and cost analysis (medium)
- [ ] `organizations/{org}/clusters` — lookup resolving cluster IDs carried on agents and queues (medium)
- [ ] `organizations/{org}/pipelines/{pipeline}/builds/{number}/artifacts` — artifact inventory and sizes per build, useful for storage and output tracking (medium)
- [ ] `organizations/{org}/teams/{team}/members` — membership table joining users to teams (medium)
-- [ ] `organizations/{org}/pipelines/{pipeline}/schedules` — explains which builds are scheduled vs triggered — a common breakdown dimension on build volume (medium)
+- [x] `organizations/{org}/pipelines/{pipeline}/schedules` — explains which builds are scheduled vs triggered — a common breakdown dimension on build volume (medium)
- [ ] `organizations/{org}/pipelines/{pipeline}/builds/{number}/annotations` — build annotations carry test summaries and custom CI reporting output (low)
Note: Buildkite publishes a complete machine-readable docs index at /docs/llms.txt with one line per REST resource; every endpoint below is named there.
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/buildkite.py b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/buildkite.py
index c8019925184b..74853c940ebf 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/buildkite.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/buildkite.py
@@ -35,6 +35,48 @@ PAGE_SIZE = 100
# Test Engine suites are the fan-out parent for both Test Engine child tables.
SUITE_CHILD_ENDPOINTS = ("test_suite_runs", "test_suite_tests")
+# Clusters are only a fan-out parent, so the cluster list has no entry in the endpoint catalog and
+# is not offered as a table of its own.
+CLUSTERS_PATH = "/v2/organizations/{organization}/clusters"
+
+
+@frozen
+class BuildkiteFanoutConfig:
+ parent_name: str
+ parent_path: str
+ # Parent field bound into the child path placeholder of the same name.
+ resolve_param: str
+ resolve_field: str
+ # Parent fields copied onto each child row, as {parent field: child column}.
+ parent_field_renames: dict[str, str]
+
+
+# Single-hop fan-outs over a plain organization-level listing. The Test Engine children and jobs
+# stay hand-built below because their parents need extra request or resume handling.
+FANOUT_ENDPOINTS: dict[str, BuildkiteFanoutConfig] = {
+ "cluster_queues": BuildkiteFanoutConfig(
+ parent_name="clusters",
+ parent_path=CLUSTERS_PATH,
+ resolve_param="cluster_id",
+ resolve_field="id",
+ parent_field_renames={"id": "cluster_id"},
+ ),
+ "pipeline_schedules": BuildkiteFanoutConfig(
+ parent_name="pipelines",
+ parent_path=BUILDKITE_ENDPOINTS["pipelines"].path,
+ resolve_param="pipeline_slug",
+ resolve_field="slug",
+ parent_field_renames={"slug": "pipeline_slug"},
+ ),
+ "team_pipelines": BuildkiteFanoutConfig(
+ parent_name="teams",
+ parent_path=BUILDKITE_ENDPOINTS["teams"].path,
+ resolve_param="team_id",
+ resolve_field="id",
+ parent_field_renames={"id": "team_id", "slug": "team_slug"},
+ ),
+}
+
@frozen
class BuildkiteResumeConfig:
@@ -152,6 +194,41 @@ def _suite_child_resource(endpoint: str, organization: str) -> EndpointResource:
}
+def _fanout_parent_resource(fanout: BuildkiteFanoutConfig, organization: str) -> EndpointResource:
+ return {
+ "name": fanout.parent_name,
+ "endpoint": {
+ "path": _bind_organization(fanout.parent_path, organization),
+ "params": {"per_page": PAGE_SIZE},
+ "data_selector_required": True,
+ },
+ }
+
+
+def _fanout_child_resource(endpoint: str, organization: str) -> EndpointResource:
+ fanout = FANOUT_ENDPOINTS[endpoint]
+ return {
+ "name": endpoint,
+ "include_from_parent": list(fanout.parent_field_renames),
+ "endpoint": {
+ "path": _bind_organization(BUILDKITE_ENDPOINTS[endpoint].path, organization),
+ "params": {
+ fanout.resolve_param: {
+ "type": "resolve",
+ "resource": fanout.parent_name,
+ "field": fanout.resolve_field,
+ },
+ "per_page": PAGE_SIZE,
+ },
+ "data_selector_required": True,
+ # A parent deleted between the listing and this fetch 404s; treat it as an empty page
+ # and move to the next parent rather than failing the whole sync.
+ "response_actions": [{"status_code": 404, "action": "ignore"}],
+ },
+ "data_map": rename_parent_fields(fanout.parent_name, fanout.parent_field_renames),
+ }
+
+
def _flatten_pipeline_slug(row: dict[str, Any]) -> dict[str, Any]:
# The jobs path needs the pipeline slug, which a build nests under `pipeline`; flatten it so
# both the path binding and include_from_parent can read it off the parent row.
@@ -306,6 +383,11 @@ def buildkite_source(
if endpoint in SUITE_CHILD_ENDPOINTS:
resources = [_test_suites_resource(organization), _suite_child_resource(endpoint, organization)]
+ elif endpoint in FANOUT_ENDPOINTS:
+ resources = [
+ _fanout_parent_resource(FANOUT_ENDPOINTS[endpoint], organization),
+ _fanout_child_resource(endpoint, organization),
+ ]
elif endpoint == "jobs":
created_from = _build_created_from(should_use_incremental_field, db_incremental_field_last_value)
resources = [_builds_parent_resource(organization, created_from), _jobs_child_resource(organization)]
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/canonical_descriptions.py
index ba0d77951dba..572c14aa03b6 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/canonical_descriptions.py
@@ -19,6 +19,17 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"created_at": "Time the organization was created (ISO 8601).",
},
},
+ "organization_members": {
+ "description": "A user who belongs to the organization, resolving the user ids carried on builds, teams, and schedules.",
+ "docs_url": "https://buildkite.com/docs/apis/rest-api/organizations/members",
+ "columns": {
+ "id": "UUID of the user.",
+ "name": "Name of the user.",
+ "email": "Email address of the user.",
+ "role": "Role the user holds in the organization, either admin or member.",
+ "sso_mode": "Whether SSO is required or optional for the user. Only returned to organization admins and for the caller's own membership.",
+ },
+ },
"pipelines": {
"description": "A pipeline defines the steps Buildkite runs for a project's builds.",
"docs_url": "https://buildkite.com/docs/apis/rest-api/pipelines",
@@ -40,6 +51,29 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"visibility": "Whether the pipeline is public or private.",
},
},
+ "pipeline_schedules": {
+ "description": "A cron schedule that creates builds for a pipeline, which distinguishes scheduled builds from triggered ones.",
+ "docs_url": "https://buildkite.com/docs/apis/rest-api/pipeline-schedules",
+ "columns": {
+ "id": "Unique identifier for the schedule.",
+ "graphql_id": "GraphQL identifier for the schedule.",
+ "url": "API URL for the schedule.",
+ "label": "Display name of the schedule.",
+ "cronline": "Cron expression that decides when the schedule runs.",
+ "message": "Build message applied to the builds the schedule creates.",
+ "commit": "Git commit the scheduled build runs against.",
+ "branch": "Git branch the scheduled build runs against.",
+ "env": "Environment variables applied to the builds the schedule creates.",
+ "enabled": "Whether the schedule currently creates builds.",
+ "next_build_at": "Time the schedule next creates a build (ISO 8601).",
+ "failed_message": "Reason the schedule last failed to create a build, or null.",
+ "failed_at": "Time the schedule last failed to create a build, or null (ISO 8601).",
+ "created_at": "Time the schedule was created (ISO 8601).",
+ "created_by": "The user who created the schedule.",
+ "pipeline": "The pipeline the schedule creates builds for.",
+ "pipeline_slug": "Slug of the pipeline the schedule belongs to.",
+ },
+ },
"builds": {
"description": "A single run of a pipeline, made up of one or more jobs.",
"docs_url": "https://buildkite.com/docs/apis/rest-api/builds",
@@ -120,6 +154,27 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"pipeline_slug": "Slug of the pipeline the job's build ran for.",
},
},
+ "cluster_queues": {
+ "description": "A queue within a cluster, resolving the queue an agent or job ran on for capacity and cost analysis.",
+ "docs_url": "https://buildkite.com/docs/apis/rest-api/clusters/queues",
+ "columns": {
+ "id": "Unique identifier for the queue.",
+ "graphql_id": "GraphQL identifier for the queue.",
+ "key": "Key jobs target the queue by.",
+ "description": "Human-readable description of the queue.",
+ "url": "API URL for the queue.",
+ "web_url": "URL of the queue in the Buildkite web UI.",
+ "cluster_url": "API URL for the cluster the queue belongs to.",
+ "retry_agent_affinity": "Which agent a retried job prefers, either prefer-warmest or prefer-different.",
+ "dispatch_paused": "Whether job dispatch to the queue's agents is paused.",
+ "dispatch_paused_by": "The user who paused dispatch.",
+ "dispatch_paused_at": "Time dispatch was paused (ISO 8601).",
+ "dispatch_paused_note": "Note given when dispatch was paused.",
+ "created_at": "Time the queue was created (ISO 8601).",
+ "created_by": "The user who created the queue.",
+ "cluster_id": "Identifier of the cluster the queue belongs to.",
+ },
+ },
"teams": {
"description": "A team within the organization, used to grant access to pipelines and suites.",
"docs_url": "https://buildkite.com/docs/apis/rest-api/teams",
@@ -134,6 +189,18 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"created_by": "The user who created the team.",
},
},
+ "team_pipelines": {
+ "description": "A link between a team and a pipeline, with the access level the team's users hold. Use it to attribute pipelines and build cost to teams.",
+ "docs_url": "https://buildkite.com/docs/apis/rest-api/teams/pipelines",
+ "columns": {
+ "pipeline_id": "UUID of the pipeline the team can access.",
+ "pipeline_url": "API URL for the pipeline.",
+ "access_level": "Permission the team's users hold on the pipeline: read_only, build_and_read, or manage_build_and_read.",
+ "created_at": "Time the pipeline was added to the team (ISO 8601).",
+ "team_id": "Identifier of the team the pipeline is linked to.",
+ "team_slug": "Slug of the team the pipeline is linked to.",
+ },
+ },
"test_suites": {
"description": "A Test Engine suite collecting the test results uploaded for a project.",
"docs_url": "https://buildkite.com/docs/apis/rest-api/test-engine/suites",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/settings.py
index 01560ca56b82..f44beb34d32d 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/settings.py
@@ -43,12 +43,30 @@ BUILDKITE_ENDPOINTS: dict[str, BuildkiteEndpointConfig] = {
partition_key="created_at",
incremental_fields=[],
),
+ "organization_members": BuildkiteEndpointConfig(
+ name="organization_members",
+ path="/v2/organizations/{organization}/members",
+ # A member row carries no timestamp of any kind, so there is nothing stable to partition on.
+ incremental_fields=[],
+ ),
"pipelines": BuildkiteEndpointConfig(
name="pipelines",
path="/v2/organizations/{organization}/pipelines",
partition_key="created_at",
incremental_fields=[],
),
+ "pipeline_schedules": BuildkiteEndpointConfig(
+ name="pipeline_schedules",
+ path="/v2/organizations/{organization}/pipelines/{pipeline_slug}/schedules",
+ # A schedule is only addressable through its pipeline, so the pipeline has to reach the row
+ # for the key to stay unique once every pipeline's schedules land in one table.
+ primary_keys=["pipeline_slug", "id"],
+ partition_key="created_at",
+ # Buildkite returns a pipeline's schedules newest-created first.
+ sort_mode="desc",
+ incremental_fields=[],
+ probe_path="/v2/organizations/{organization}/pipelines",
+ ),
"builds": BuildkiteEndpointConfig(
name="builds",
path="/v2/organizations/{organization}/builds",
@@ -103,12 +121,33 @@ BUILDKITE_ENDPOINTS: dict[str, BuildkiteEndpointConfig] = {
partition_key="created_at",
incremental_fields=[],
),
+ "cluster_queues": BuildkiteEndpointConfig(
+ name="cluster_queues",
+ path="/v2/organizations/{organization}/clusters/{cluster_id}/queues",
+ # A queue key is only unique within its cluster, and the row carries the cluster as a URL
+ # rather than an id, so the parent cluster id is injected and keyed on.
+ primary_keys=["cluster_id", "id"],
+ partition_key="created_at",
+ incremental_fields=[],
+ probe_path="/v2/organizations/{organization}/clusters",
+ ),
"teams": BuildkiteEndpointConfig(
name="teams",
path="/v2/organizations/{organization}/teams",
partition_key="created_at",
incremental_fields=[],
),
+ "team_pipelines": BuildkiteEndpointConfig(
+ name="team_pipelines",
+ path="/v2/organizations/{organization}/teams/{team_id}/pipelines",
+ # The rows are team-to-pipeline links, not pipelines, so they carry no id of their own.
+ # The pair of endpoints they join is the key.
+ primary_keys=["team_id", "pipeline_id"],
+ # `created_at` is when the pipeline was added to the team, which is set once.
+ partition_key="created_at",
+ incremental_fields=[],
+ probe_path="/v2/organizations/{organization}/teams",
+ ),
"test_suites": BuildkiteEndpointConfig(
name="test_suites",
path="/v2/analytics/organizations/{organization}/suites",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/source.py
index a50cdb21fba3..7012b66770a0 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/source.py
@@ -73,6 +73,7 @@ Make sure to grant the following read scopes:
- `read_pipelines`
- `read_builds`
- `read_agents`
+- `read_clusters`
- `read_teams`
- `read_suites`
""",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite.py b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite.py
index 141b4781d197..d9cc7d9e1c13 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite.py
@@ -27,6 +27,7 @@ CLIENT_SESSION_PATCH = "products.warehouse_sources.backend.temporal.data_imports
BUILDKITE_SESSION_PATCH = (
"products.warehouse_sources.backend.temporal.data_imports.sources.buildkite.buildkite.make_tracked_session"
)
+ORG_URL = "https://api.buildkite.com/v2/organizations/my-org"
class TestFormatIncrementalValue:
@@ -62,7 +63,16 @@ class TestBuildInitialParams:
)
assert params == {"per_page": 100}
- @parameterized.expand([("organizations",), ("pipelines",), ("agents",), ("teams",), ("test_suites",)])
+ @parameterized.expand(
+ [
+ ("organizations",),
+ ("organization_members",),
+ ("pipelines",),
+ ("agents",),
+ ("teams",),
+ ("test_suites",),
+ ]
+ )
def test_full_refresh_endpoints_never_get_a_time_filter(self, endpoint: str) -> None:
# These endpoints expose no server-side timestamp filter, so an incremental request must
# not silently add one (it would be ignored by the API and misrepresent the sync).
@@ -260,6 +270,14 @@ class TestBuildkiteSourceResponse:
("builds", ["id"], "desc", "created_at"),
("agents", ["id"], "asc", "created_at"),
("teams", ["id"], "asc", "created_at"),
+ # A fan-out child carries its parent in the key, because its own id is only unique
+ # within that parent once every parent's rows land in one table.
+ ("pipeline_schedules", ["pipeline_slug", "id"], "desc", "created_at"),
+ ("cluster_queues", ["cluster_id", "id"], "asc", "created_at"),
+ # A team-to-pipeline link has no id of its own, so the pair it joins is the key.
+ ("team_pipelines", ["team_id", "pipeline_id"], "asc", "created_at"),
+ # A member row carries no timestamp, so it is not partitioned.
+ ("organization_members", ["id"], "asc", None),
("jobs", ["id"], "desc", "build_created_at"),
("test_suite_runs", ["suite_slug", "id"], "desc", "created_at"),
# Suites and tests expose no creation timestamp, so they are not partitioned.
@@ -332,14 +350,25 @@ class TestValidateCredentials:
validate_credentials("bkua", "my-org", schema_name="agents")
assert captured["url"] == "https://api.buildkite.com/v2/organizations/my-org/agents?per_page=1"
- @parameterized.expand([("test_suite_runs",), ("test_suite_tests",)])
+ @parameterized.expand(
+ [
+ ("test_suite_runs", "https://api.buildkite.com/v2/analytics/organizations/my-org/suites?per_page=1"),
+ ("test_suite_tests", "https://api.buildkite.com/v2/analytics/organizations/my-org/suites?per_page=1"),
+ ("team_pipelines", f"{ORG_URL}/teams?per_page=1"),
+ ("pipeline_schedules", f"{ORG_URL}/pipelines?per_page=1"),
+ ("cluster_queues", f"{ORG_URL}/clusters?per_page=1"),
+ ]
+ )
@mock.patch(BUILDKITE_SESSION_PATCH)
- def test_fanout_schema_probe_targets_the_parent_listing(self, endpoint: str, mock_session) -> None:
+ def test_fanout_schema_probe_targets_the_parent_listing(
+ self, endpoint: str, expected_url: str, mock_session
+ ) -> None:
# A fan-out child's own path needs a parent row, so the probe hits the listing that
- # carries the same scope. Formatting the child path here would raise on {suite_slug}.
+ # carries the same scope. Formatting the child path here would raise on the parent
+ # placeholder it still carries, such as {suite_slug} or {team_id}.
captured = self._patch_get(mock_session, 200)
validate_credentials("bkua", "my-org", schema_name=endpoint)
- assert captured["url"] == "https://api.buildkite.com/v2/analytics/organizations/my-org/suites?per_page=1"
+ assert captured["url"] == expected_url
@mock.patch(BUILDKITE_SESSION_PATCH)
def test_jobs_schema_probe_targets_the_builds_listing(self, mock_session) -> None:
@@ -434,6 +463,78 @@ class TestSuiteFanout:
assert [r["id"] for r in rows] == ["b"]
+class TestSimpleFanout:
+ @parameterized.expand(
+ [
+ (
+ "team_pipelines",
+ [{"id": "t1", "slug": "backend"}, {"id": "t2", "slug": "frontend"}],
+ f"{ORG_URL}/teams",
+ [f"{ORG_URL}/teams/t1/pipelines", f"{ORG_URL}/teams/t2/pipelines"],
+ [{"pipeline_id": "p1"}, {"pipeline_id": "p2"}],
+ [{"team_id": "t1", "team_slug": "backend"}, {"team_id": "t2", "team_slug": "frontend"}],
+ ),
+ (
+ "pipeline_schedules",
+ [{"id": "pl1", "slug": "web"}, {"id": "pl2", "slug": "api"}],
+ f"{ORG_URL}/pipelines",
+ [f"{ORG_URL}/pipelines/web/schedules", f"{ORG_URL}/pipelines/api/schedules"],
+ [{"id": "s1"}, {"id": "s2"}],
+ [{"pipeline_slug": "web"}, {"pipeline_slug": "api"}],
+ ),
+ (
+ "cluster_queues",
+ [{"id": "c1"}, {"id": "c2"}],
+ f"{ORG_URL}/clusters",
+ [f"{ORG_URL}/clusters/c1/queues", f"{ORG_URL}/clusters/c2/queues"],
+ [{"id": "q1"}, {"id": "q2"}],
+ [{"cluster_id": "c1"}, {"cluster_id": "c2"}],
+ ),
+ ]
+ )
+ @mock.patch(CLIENT_SESSION_PATCH)
+ def test_binds_the_parent_path_and_carries_the_parent_onto_each_row(
+ self,
+ endpoint: str,
+ parent_rows: list[dict[str, Any]],
+ parent_url: str,
+ child_urls: list[str],
+ child_rows: list[dict[str, Any]],
+ parent_columns: list[dict[str, Any]],
+ MockSession,
+ ) -> None:
+ session = MockSession.return_value
+ snapshots = _wire(session, [_response(parent_rows), _response([child_rows[0]]), _response([child_rows[1]])])
+
+ rows = _rows(_source(endpoint, _make_manager()))
+
+ assert snapshots[0]["url"] == parent_url
+ assert snapshots[0]["params"] == {"per_page": 100}
+ assert [s["url"] for s in snapshots[1:]] == child_urls
+ # The parent identifier has to land on the row under its final column name, because the
+ # composite primary key keys on it. A missing rename leaves the key with no column.
+ assert rows == [{**child_rows[i], **parent_columns[i]} for i in (0, 1)]
+
+ @mock.patch(CLIENT_SESSION_PATCH)
+ def test_deleted_parent_does_not_fail_the_sync(self, MockSession) -> None:
+ session = MockSession.return_value
+ gone = Response()
+ gone.status_code = 404
+ gone._content = b'{"message": "Not Found"}'
+ _wire(
+ session,
+ [
+ _response([{"id": "t1", "slug": "backend"}, {"id": "t2", "slug": "frontend"}]),
+ gone,
+ _response([{"pipeline_id": "p2"}]),
+ ],
+ )
+
+ rows = _rows(_source("team_pipelines", _make_manager()))
+
+ assert [r["pipeline_id"] for r in rows] == ["p2"]
+
+
class TestJobsFanout:
@staticmethod
def _builds_page() -> Response:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite_source.py
index 943c43b64229..eb0817e0e0da 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/buildkite/tests/test_buildkite_source.py
@@ -36,9 +36,13 @@ class TestBuildkiteSource:
("builds", True, True),
("jobs", True, False),
("organizations", False, False),
+ ("organization_members", False, False),
("pipelines", False, False),
+ ("pipeline_schedules", False, False),
("agents", False, False),
+ ("cluster_queues", False, False),
("teams", False, False),
+ ("team_pipelines", False, False),
("test_suites", False, False),
("test_suite_runs", False, False),
("test_suite_tests", False, False),