: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(data-warehouse): add 3 missing tables to the Waydev source (#118052)
Tom Owers38645cd13826
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.mdindex 0c4d6959de11..74a7c984930d 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@@ -13034,10 +13034,10 @@ Today (2): `Incidents`, `Metrics`Diffed against: <https://api-docs.waydev.co/>-- [ ] `Repositories (GET /v2/repositories)` — resolve repository IDs on synced incidents and group failures by codebase (high)+- [x] `Repositories (GET /v2/repositories)` — resolve repository IDs on synced incidents and group failures by codebase (high)- [ ] `Dashboard and developer statistics (GET /v2/stats/dashboard; POST /v2/stats)` — import measured engineering performance; the synced Metrics table contains metric definitions, not measured results (high)-- [ ] `Contributors (GET /v2/contributors)` — identify developers and compare contribution patterns across repositories (medium)-- [ ] `Teams (GET /v2/teams)` — group engineering performance by named teams (medium)+- [x] `Contributors (GET /v2/contributors)` — identify developers and compare contribution patterns across repositories (medium)+- [x] `Teams (GET /v2/teams)` — group engineering performance by named teams (medium)- [ ] `Team members (GET /v2/teams/{team_id}/members)` — connect contributors to teams for team and developer comparisons (medium)- [ ] `Pull requests (GET /v2/repositories/{repository_id}/pulls)` — analyze review delays, delivery throughput, and pull request activity (medium)- [ ] `Commits (GET /v2/repositories/{repository_id}/commits)` — analyze code contribution frequency and development activity by repository (medium)diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/canonical_descriptions.pyindex 531074ba13cf..d27013e99545 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/canonical_descriptions.py@@ -36,4 +36,41 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"fixed_at": "Date and time the incident was marked as resolved, if any.",},},+ "Repositories": {+ "description": "A code repository connected to Waydev from a Git provider, including repositories "+ "that are not selected for processing.",+ "docs_url": "https://api-docs.waydev.co/returns-information-about-the-repositories-in-your-account",+ "columns": {+ "id": "Unique identifier of the repository in Waydev.",+ "name": "Short name of the repository.",+ "full_name": "Full name of the repository, including its owner or namespace.",+ "html_url": "URL of the repository at its Git provider.",+ "is_selected": "Whether the repository is selected for processing in Waydev.",+ "provider": "Git provider that hosts the repository, such as GitHub.",+ },+ },+ "Contributors": {+ "description": "A contributor (developer identity) known to Waydev from a connected integration.",+ "docs_url": "https://api-docs.waydev.co/list-contributors-in-your-account",+ "columns": {+ "id": "Unique identifier of the contributor.",+ "email": "Email address of the contributor.",+ "official_name": "Name of the contributor in Waydev.",+ "teams": "Teams the contributor belongs to.",+ "integration": "Integration the contributor comes from, such as Jira or GitLab.",+ "merged_developers": "Other developer identities merged into this contributor.",+ },+ },+ "Teams": {+ "description": "A team of developers defined in Waydev, used to group engineering metrics.",+ "docs_url": "https://api-docs.waydev.co/retrieves-all-the-teams-in-your-account",+ "columns": {+ "id": "Unique identifier of the team.",+ "name": "Name of the team.",+ "members_count": "Number of members in the team.",+ "members": "Members of the team, with their names and email addresses.",+ "settings": "Team settings that change how metrics are computed, such as merge and "+ "lines-of-code exclusions and the stats time zone.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/settings.pyindex e26e4a1eb652..ebb3d2af1e60 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/settings.py@@ -3,8 +3,11 @@ from products.warehouse_sources.backend.types import IncrementalFieldENDPOINTS = ("Metrics","Incidents",+ "Repositories",+ "Contributors",+ "Teams",)-# Neither endpoint documents a server-side timestamp filter (Incidents only supports-# page/limit/repository_id, and Metrics is a static catalog), so both sync full refresh.+# No endpoint documents a server-side timestamp filter (the list endpoints only take+# paging and name/state filters, and Metrics is a static catalog), so all sync full refresh.INCREMENTAL_FIELDS: dict[str, list[IncrementalField]] = {}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/tests/test_waydev.py b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/tests/test_waydev.pyindex 608027c77b91..aefc0b759d7b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/tests/test_waydev.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/tests/test_waydev.py@@ -56,6 +56,75 @@ class TestWaydevSourceResumeBehavior:assert result.params("page") == ["1"]+class TestWaydevListEndpoints:+ @pytest.mark.parametrize(+ ("endpoint", "script", "expected_pages", "expected_ids", "expected_query"),+ [+ (+ "Repositories",+ [+ ScriptedResponse(json={"count": 3, "values": [{"id": 11}, {"id": 12}]}),+ ScriptedResponse(json={"count": 3, "values": [{"id": 13}]}),+ ScriptedResponse(json={"count": 3, "values": []}),+ ],+ ["1", "2", "3"],+ [11, 12, 13],+ {"state": "all", "limit": "500"},+ ),+ (+ "Teams",+ [+ ScriptedResponse(json={"current_page": 1, "last_page": 2, "data": [{"id": 21}, {"id": 22}]}),+ ScriptedResponse(json={"current_page": 2, "last_page": 2, "data": [{"id": 23}]}),+ ],+ ["1", "2"],+ [21, 22, 23],+ {"limit": "100"},+ ),+ (+ "Teams",+ [ScriptedResponse(json={"current_page": 1, "last_page": 1, "data": []})],+ ["1"],+ [],+ {"limit": "100"},+ ),+ (+ "Contributors",+ [+ ScriptedResponse(+ json={+ "count": 2,+ "contributors": [+ {"id": 31, "official_name": "dev.one", "teams": [], "merged_developers": []},+ {"id": 32, "official_name": "dev.two", "teams": ["Core"], "merged_developers": []},+ ],+ }+ )+ ],+ [None],+ [31, 32],+ {},+ ),+ ],+ )+ def test_walks_pages_and_extracts_rows(+ self,+ endpoint: str,+ script: list[ScriptedResponse],+ expected_pages: list[str | None],+ expected_ids: list[int],+ expected_query: dict[str, str],+ ) -> None:+ result = SourceDriver(WaydevSource(), WaydevSourceConfig(api_key="test-key")).run(endpoint, script)++ assert result.raised is None+ assert result.paths == [f"/v2/{endpoint.lower()}"] * len(expected_pages)+ assert result.params("page") == expected_pages+ for name, value in expected_query.items():+ assert set(result.params(name)) == {value}+ assert [row["id"] for row in result.rows] == expected_ids++class TestValidateCredentials:def test_ok(self) -> None:with scripted_network([ScriptedResponse(json=[])]) as network:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/waydev.py b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/waydev.pyindex d0ae4703b2ef..8e6967d55387 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/waydev.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/waydev/waydev.py@@ -23,6 +23,9 @@ BASE_URL = "https://api.waydev.co/v2"# The public reference documents a `limit` param (default 25) with no stated maximum;# 100 keeps page count down without a documented ceiling to test against.INCIDENTS_PAGE_SIZE = 100+REPOSITORIES_PAGE_SIZE = 500+# Teams documents a default of 10 per page and no maximum.+TEAMS_PAGE_SIZE = 100@frozen@@ -68,6 +71,46 @@ def get_resource(name: str) -> EndpointResource:},"table_format": "delta",},+ "Repositories": {+ "name": "Repositories",+ "table_name": "repositories",+ "write_disposition": "replace",+ "endpoint": {+ "path": "/repositories",+ # `state=all` includes repositories that are not selected for processing, so+ # repository IDs on other tables still resolve.+ "params": {"state": "all", "limit": REPOSITORIES_PAGE_SIZE},+ "data_selector": "values",+ "paginator": PageNumberPaginator(base_page=1, page_param="page", stop_after_empty_page=True),+ },+ "table_format": "delta",+ },+ "Contributors": {+ "name": "Contributors",+ "table_name": "contributors",+ "write_disposition": "replace",+ "endpoint": {+ "path": "/contributors",+ # No pagination is documented; the response carries every contributor.+ "data_selector": "contributors",+ "paginator": SinglePagePaginator(),+ },+ "table_format": "delta",+ },+ "Teams": {+ "name": "Teams",+ "table_name": "teams",+ "write_disposition": "replace",+ "endpoint": {+ "path": "/teams",+ "params": {"limit": TEAMS_PAGE_SIZE},+ "data_selector": "data",+ "paginator": PageNumberPaginator(+ base_page=1, page_param="page", total_path="last_page", stop_after_empty_page=True+ ),+ },+ "table_format": "delta",+ },}return resources[name]