: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
fix(engineering-analytics): close test triage gaps in the devex mcp tools (#126424)
Julian Bez8e9ea0c506e2
diff --git a/products/engineering_analytics/backend/facade/api.py b/products/engineering_analytics/backend/facade/api.pyindex 68c1129e58c1..4bc034101b94 100644--- a/products/engineering_analytics/backend/facade/api.py+++ b/products/engineering_analytics/backend/facade/api.py@@ -11,7 +11,7 @@ costs; the same surfaces also take a broader ``run_scope`` filter (see``WorkflowHealthRunScope``). ``date_from`` / ``date_to`` acceptrelative strings (``-30d``) or ISO8601 and are resolved against the team timezone.``source_id`` selects a specific connected GitHub source when the team has more than-one; it defaults to the oldest connected source. ``user_access_control`` enforces the+one; it defaults to the oldest synced source. ``user_access_control`` enforces therequesting user's per-source warehouse access (pass the request's; ``None`` for systemcontexts). Each function resolves the team's authorized curated read handle once, here,then delegates to the read layer: source selection and access control live in this layer,@@ -91,7 +91,7 @@ def _authorized_source("""Resolve this caller's curated read handle: the single place source selection and per-sourcewarehouse access control happen. ``user_access_control`` (None for system/Temporal/CLI contexts)filters out sources the requesting user can't access; ``source_id`` selects a specific source,- else the oldest connected. ``repo`` ('owner/name'), when the caller already scopes to one repo,+ else the oldest one the sources list reports as synced. ``repo`` ('owner/name'), when the caller already scopes to one repo,prefers the source connected for that repo, so a team with one source per repository reads theright one. Raises ``GitHubSourceNotConnectedError`` / ``ValueError`` (bad source_id)."""@@ -623,6 +623,9 @@ def list_flaky_tests(min_failed_prs: int | None = None,limit: int | None = None,runner: CITestRunner | None = None,+ test: str | None = None,+ branch: str | None = None,+ pr_number: int | None = None,source_id: str | None = None,repo: str | None = None,user_access_control: "UserAccessControl | None" = None,@@ -634,6 +637,9 @@ def list_flaky_tests(min_failed_prs=min_failed_prs,limit=limit,runner=runner,+ test=test,+ branch=branch,+ pr_number=pr_number,)@@ -700,11 +706,15 @@ def get_team_merge_trend(def get_broken_tests(*,team: Team,+ test: str | None = None,+ branch: str | None = None,source_id: str | None = None,repo: str | None = None,user_access_control: "UserAccessControl | None" = None,) -> BrokenTestsResult:- return logic.build_broken_tests(curated=_authorized_source(team, source_id, user_access_control, repo=repo))+ return logic.build_broken_tests(+ curated=_authorized_source(team, source_id, user_access_control, repo=repo), test=test, branch=branch+ )def list_github_sources(*, team: Team, user_access_control: "UserAccessControl | None" = None) -> list[GitHubSource]:diff --git a/products/engineering_analytics/backend/logic/job_logs/activity.py b/products/engineering_analytics/backend/logic/job_logs/activity.pyindex a13e2b8cddd0..fefe2460b7ea 100644--- a/products/engineering_analytics/backend/logic/job_logs/activity.py+++ b/products/engineering_analytics/backend/logic/job_logs/activity.py@@ -82,6 +82,7 @@ class FetchDepotJobLogInputs:native_run_id: str = ""native_workflow_run_id: str = ""native_job_id: str = ""+ branch: str = ""@frozen@@ -207,8 +208,8 @@ async def fetch_and_emit_depot_job_log_activity(inputs: FetchDepotJobLogInputs)"job_id": inputs.job_id,"run_id": inputs.run_id,"repo": inputs.repo,- # Depot reports no branch, and discovery only takes failed attempts.- "branch": "",+ "branch": inputs.branch,+ # Discovery only takes failed attempts."conclusion": "failure","job_name": inputs.job_name,"workflow_name": inputs.workflow_name,diff --git a/products/engineering_analytics/backend/logic/job_logs/coordinator.py b/products/engineering_analytics/backend/logic/job_logs/coordinator.pyindex afe4335fd32d..46faf3c38556 100644--- a/products/engineering_analytics/backend/logic/job_logs/coordinator.py+++ b/products/engineering_analytics/backend/logic/job_logs/coordinator.py@@ -38,6 +38,7 @@ from posthog.models.team import Teamfrom posthog.sync import database_sync_to_asyncfrom posthog.temporal.common.base import PostHogWorkflow+from products.engineering_analytics.backend.facade.contracts import GitHubSourceNotConnectedErrorfrom products.engineering_analytics.backend.logic.job_logs.activity import (FetchDepotJobLogInputs,FetchDepotJobLogWorkflow,@@ -45,7 +46,11 @@ from products.engineering_analytics.backend.logic.job_logs.activity import (FetchJobLogInputs,)from products.engineering_analytics.backend.logic.queries._test_spans import rerun_recovered_job_attempts-from products.engineering_analytics.backend.logic.sources import depot_source_job_attempts_table+from products.engineering_analytics.backend.logic.sources import (+ depot_source_job_attempts,+ depot_source_job_attempts_table,+ resolve_github_tables,+)from products.engineering_analytics.backend.logic.views.depot_ci import depot_github_run_id, depot_id_to_intfrom products.warehouse_sources.backend.facade.models import ExternalDataSourcefrom products.warehouse_sources.backend.facade.source_inputs import SourceInputsStore, UnreadableSourceInputsError@@ -248,8 +253,8 @@ def _query_failed_depot_attempts(# against the cutoff is chronological. The table name comes from the source's synced schema.after = after or DepotAttemptCursor(finished_at=cutoff_iso, attempt_id="")sql = f"""- SELECT run_id, run_workflow_count, workflow_id, attempt_id, attempt, repo, head_sha, workflow_name, job_id,- job_display_name, job_key, attempt_finished_at+ SELECT run_id, run_workflow_count, workflow_id, attempt_id, attempt, repo, ref, head_sha, workflow_name,+ job_id, job_display_name, job_key, attempt_finished_atFROM {table}WHERE attempt_status = 'failed' AND attempt_finished_at > {{cutoff}} AND (attempt_finished_at > {{after_finished_at}}@@ -273,7 +278,64 @@ def _query_failed_depot_attempts(return [dict(zip(response.columns or [], row)) for row in response.results]-def _depot_attempt_inputs(source: ExternalDataSource, row: dict[str, Any]) -> FetchDepotJobLogInputs | None:+# The same ref patterns the Depot runs view reads the branch from.+_PUSHED_REF = re.compile(r"^refs/heads/(.+)$")+_PULL_REQUEST_REF = re.compile(r"^refs/pull/([0-9]+)/")+++def _query_depot_attempt_branches(source: ExternalDataSource, rows: list[dict[str, Any]]) -> dict[str, str]:+ """The head branch of each discovered attempt, read the way the runs view reads it.++ Depot reports only a ref. A pushed ref names its branch, and a pull request ref takes its head+ branch from the GitHub PR snapshot, so a missing snapshot leaves pull request attempts blank.+ """+ branches: dict[str, str] = {}+ pr_numbers: dict[str, int] = {}+ for row in rows:+ ref = row.get("ref") or ""+ if pushed := _PUSHED_REF.match(ref):+ branches[row["attempt_id"]] = pushed.group(1)+ elif pull_request := _PULL_REQUEST_REF.match(ref):+ pr_numbers[row["attempt_id"]] = int(pull_request.group(1))+ depot = depot_source_job_attempts(source.team, source)+ if not pr_numbers or depot is None:+ return branches+ try:+ pull_requests = resolve_github_tables(team=source.team, repo=depot.repository).pull_requests+ except GitHubSourceNotConnectedError:+ return branches+ numbers = sorted(set(pr_numbers.values()))+ sql = f"""+ SELECT number, any(JSONExtractString(ifNull(head, '{{}}'), 'ref')) AS head_branch+ FROM {pull_requests}+ WHERE number IN {{numbers}}+ GROUP BY number+ LIMIT {{limit}}+ """+ with tags_context(product=Product.ENGINEERING_ANALYTICS, feature=Feature.QUERY, team_id=source.team.pk):+ response = execute_hogql_query(+ query=parse_select(+ sql,+ placeholders={+ "numbers": ast.Constant(value=numbers),+ # Without a LIMIT, HogQL caps the read at its default row count, below a discovery page.+ "limit": ast.Constant(value=len(numbers)),+ },+ ),+ team=source.team,+ query_type="DepotJobLogsBranches",+ bypass_warehouse_access_control=True,+ )+ head_branches = {number: head_branch for number, head_branch in response.results if head_branch}+ for attempt_id, number in pr_numbers.items():+ if number in head_branches:+ branches[attempt_id] = head_branches[number]+ return branches+++def _depot_attempt_inputs(+ source: ExternalDataSource, row: dict[str, Any], branch: str+) -> FetchDepotJobLogInputs | None:# The same run id the runs view gives this workflow, so the logs join it. A push run's id carries# a prefix outside the Depot id alphabet, so it has no integer run id for its logs to join on.run_id = depot_github_run_id(row["run_id"] or "", row["workflow_id"] or "", row["run_workflow_count"] or 0)@@ -294,6 +356,7 @@ def _depot_attempt_inputs(source: ExternalDataSource, row: dict[str, Any]) -> Fenative_run_id=row["run_id"] or "",native_workflow_run_id=row["workflow_id"] or "",native_job_id=row["job_id"] or "",+ branch=branch,)@@ -326,7 +389,16 @@ def _discover_failed_depot_attempts(inputs: DepotDiscoveryInputs) -> DepotDiscovif cursor is not None:cursors[source_id] = cursorcontinue- attempts.extend(found for row in rows if (found := _depot_attempt_inputs(source, row)) is not None)+ try:+ branches = _query_depot_attempt_branches(source, [row for row in rows if row["attempt_id"]])+ except Exception:+ # A log without its branch still classifies, so a failed lookup must not drop the attempts.+ logger.warning("depot_job_logs_branch_lookup_failed", source_id=source_id, exc_info=True)+ branches = {}+ for row in rows:+ found = _depot_attempt_inputs(source, row, branches.get(row["attempt_id"] or "", ""))+ if found is not None:+ attempts.append(found)if len(rows) == limit:cursors[source_id] = DepotAttemptCursor(finished_at=rows[-1]["attempt_finished_at"], attempt_id=rows[-1]["attempt_id"]diff --git a/products/engineering_analytics/backend/logic/job_logs/test/test_activity.py b/products/engineering_analytics/backend/logic/job_logs/test/test_activity.pyindex 2f7742712f50..e7e74df8c970 100644--- a/products/engineering_analytics/backend/logic/job_logs/test/test_activity.py+++ b/products/engineering_analytics/backend/logic/job_logs/test/test_activity.py@@ -36,6 +36,7 @@ _DEPOT_INPUTS = FetchDepotJobLogInputs(job_name="Product tests (experiments)",run_attempt=1,head_sha="abc1234",+ branch="feature-x",)@@ -133,7 +134,7 @@ async def test_depot_attempt_fetches_by_attempt_id_and_emits_decoded_ids(monkeyp"job_id": 579485267642625,"run_id": 80213453736890,"repo": "PostHog/posthog",- "branch": "",+ "branch": "feature-x","conclusion": "failure","job_name": "Product tests (experiments)","workflow_name": "Backend CI on Depot",diff --git a/products/engineering_analytics/backend/logic/job_logs/test/test_coordinator.py b/products/engineering_analytics/backend/logic/job_logs/test/test_coordinator.pyindex 5a3d5a4851a9..7a1a5c288dcf 100644--- a/products/engineering_analytics/backend/logic/job_logs/test/test_coordinator.py+++ b/products/engineering_analytics/backend/logic/job_logs/test/test_coordinator.py@@ -19,9 +19,22 @@ from products.engineering_analytics.backend.logic.job_logs.coordinator import (_github_source_params,_query_jobs_with_diagnostics,)-from products.engineering_analytics.backend.logic.sources import DEPOT_JOB_ATTEMPTS_SCHEMA-from products.engineering_analytics.backend.logic.views.source_schema import DEPOT_JOB_ATTEMPTS_COLUMNS-from products.engineering_analytics.backend.tests._github_fixtures import create_github_warehouse_table, link_schema+from products.engineering_analytics.backend.logic.sources import (+ DEPOT_JOB_ATTEMPTS_SCHEMA,+ PULL_REQUESTS_SCHEMA,+ WORKFLOW_RUNS_SCHEMA,+)+from products.engineering_analytics.backend.logic.views.source_schema import (+ DEPOT_JOB_ATTEMPTS_COLUMNS,+ PULL_REQUESTS_COLUMNS,+)+from products.engineering_analytics.backend.tests._github_fixtures import (+ _pr_row,+ create_github_source,+ create_github_warehouse_table,+ create_warehouse_table_row,+ link_schema,+)from products.warehouse_sources.backend.facade.models import DataWarehouseTable, ExternalDataSourcefrom products.warehouse_sources.backend.facade.types import ExternalDataSourceType@@ -81,10 +94,40 @@ class TestDiscoverFailedDepotAttempts(ClickhouseTestMixin, BaseTest):job_inputs={"api_token": "depot-tok", "repository": "PostHog/posthog"},)+ # Depot reports only a ref. A pull request ref takes its head branch from the PR snapshot.+ github = create_github_source(self.team, prefix="gh", repository="PostHog/posthog")+ pull_requests = create_github_warehouse_table(+ self,+ "github_pull_requests",+ PULL_REQUESTS_COLUMNS,+ [_pr_row(77, "alice", "open", 0, "2026-09-23T10:00:00Z", head_ref="feature-x")],+ source=github,+ prefix="gh",+ )+ link_schema(+ self.team,+ github,+ name=PULL_REQUESTS_SCHEMA,+ table=DataWarehouseTable.objects.get(team=self.team, name=pull_requests),+ )+ link_schema(+ self.team,+ github,+ name=WORKFLOW_RUNS_SCHEMA,+ table=create_warehouse_table_row(self.team, name="ghgithub_workflow_runs", source=github),+ )+def attempt(- attempt_id: str, status: str, finished: str, *, run_id: str = "427q556wmn", run_workflow_count: int = 1+ attempt_id: str,+ status: str,+ finished: str,+ *,+ run_id: str = "427q556wmn",+ run_workflow_count: int = 1,+ ref: str = "refs/pull/77/merge",) -> dict:return dict.fromkeys(DEPOT_JOB_ATTEMPTS_COLUMNS) | {+ "ref": ref,"run_id": run_id,"run_workflow_count": run_workflow_count,"workflow_id": "cccccccccc",@@ -108,7 +151,14 @@ class TestDiscoverFailedDepotAttempts(ClickhouseTestMixin, BaseTest):attempt("b82nsv77wl", "failed", "2026-09-22T14:52:30.000Z"),attempt("q28m5dl5rg", "failed", "2026-09-24T14:53:00.000Z", run_id="ps_59s92fgx6c"),# A run with two workflows takes the workflow's id, as the runs view keys it.- attempt("h8qn5x801q", "failed", "2026-09-24T14:54:00.000Z", run_id="bbbbbbbbbb", run_workflow_count=2),+ attempt(+ "h8qn5x801q",+ "failed",+ "2026-09-24T14:54:00.000Z",+ run_id="bbbbbbbbbb",+ run_workflow_count=2,+ ref="refs/heads/hotfix",+ ),],source=source,prefix="ci",@@ -120,7 +170,7 @@ class TestDiscoverFailedDepotAttempts(ClickhouseTestMixin, BaseTest):table=DataWarehouseTable.objects.get(team=self.team, name=table_name),)- def fetch_inputs(attempt_id: str, run_id: int, job_id: int) -> FetchDepotJobLogInputs:+ def fetch_inputs(attempt_id: str, run_id: int, job_id: int, branch: str) -> FetchDepotJobLogInputs:return FetchDepotJobLogInputs(team_id=self.team.pk,source_id=str(source.id),@@ -134,10 +184,11 @@ class TestDiscoverFailedDepotAttempts(ClickhouseTestMixin, BaseTest):head_sha="abc1234",native_run_id="bbbbbbbbbb" if run_id == 223978965517241 else "427q556wmn",native_workflow_run_id="cccccccccc",+ branch=branch,)- two_workflow_run = fetch_inputs("h8qn5x801q", run_id=223978965517241, job_id=300989664396052)- one_workflow_run = fetch_inputs("zf6sbbn2wh", run_id=80213453736890, job_id=579485267642625)+ two_workflow_run = fetch_inputs("h8qn5x801q", run_id=223978965517241, job_id=300989664396052, branch="hotfix")+ one_workflow_run = fetch_inputs("zf6sbbn2wh", run_id=80213453736890, job_id=579485267642625, branch="feature-x")window_start = DepotDiscoveryInputs(cutoff_iso="2026-09-24T00:00:00+00:00", cursors={})assert _discover_failed_depot_attempts(window_start) == DepotDiscovery(attempts=[two_workflow_run, one_workflow_run], cursors={}diff --git a/products/engineering_analytics/backend/logic/queries/broken_tests.py b/products/engineering_analytics/backend/logic/queries/broken_tests.pyindex 606506462805..e431f682f8dc 100644--- a/products/engineering_analytics/backend/logic/queries/broken_tests.py+++ b/products/engineering_analytics/backend/logic/queries/broken_tests.py@@ -108,6 +108,7 @@ _FINGERPRINTS_SELECT = """FROM __FAILURES_SOURCE__WHERE timestamp >= {date_from} AND lower(repo) = lower({repository})GROUP BY fingerprint+ HAVING __FILTERS__ORDER BY master_hits DESC, merge_queue_hits DESC, branches DESC, last_seen DESCLIMIT {limit_plus_one}"""@@ -219,6 +220,8 @@ def query_broken_tests(hourly_from: datetime,window_days: int,limit: int,+ test: str | None = None,+ branch: str | None = None,) -> BrokenTestsResult:repository = curated.repository# The failure-lines view is team-global; without a source repository we cannot scope it to the@@ -231,9 +234,6 @@ def query_broken_tests(failures_source = f"({ci_failures.build_query()})"# Shape-only: the failure-lines view carries no actor to corroborate against, and a false# positive here can only mis-rank one fingerprint — it drops and re-keys nothing.- fingerprints_sql = _FINGERPRINTS_SELECT.replace(- "__MERGE_QUEUE_BRANCH__", looks_like_merge_queue_branch_expr("branch")- ).replace("__FAILURES_SOURCE__", failures_source)logs_placeholders: dict[str, ast.Expr] = {"default_branches": ast.Constant(value=_DEFAULT_BRANCHES),"repository": ast.Constant(value=repository),@@ -241,6 +241,22 @@ def query_broken_tests(# +1 so a full page reveals that more fingerprints qualified than returned."limit_plus_one": ast.Constant(value=limit + 1),}+ # The filters run before the cap, so a narrowed read reaches rows the cap would cut. They sit in+ # HAVING because `test_id` in WHERE would bind to the `any(test_id)` alias (see repo_name above).+ filters = ["1"]+ if test:+ filters.append("positionCaseInsensitive(test_id, {test}) > 0")+ logs_placeholders["test"] = ast.Constant(value=test)+ # A branch keeps a fingerprint that failed there, but its counts cover every branch, so the row+ # still shows whether the failure also happens elsewhere.+ if branch:+ filters.append("countIf(branch = {branch}) > 0")+ logs_placeholders["branch"] = ast.Constant(value=branch)+ fingerprints_sql = (+ _FINGERPRINTS_SELECT.replace("__MERGE_QUEUE_BRANCH__", looks_like_merge_queue_branch_expr("branch"))+ .replace("__FAILURES_SOURCE__", failures_source)+ .replace("__FILTERS__", " AND ".join(filters))+ )fingerprint_rows = (curated.run(fingerprints_sql,diff --git a/products/engineering_analytics/backend/logic/queries/flaky_tests.py b/products/engineering_analytics/backend/logic/queries/flaky_tests.pyindex 0974cccc18bb..5a4c81969417 100644--- a/products/engineering_analytics/backend/logic/queries/flaky_tests.py+++ b/products/engineering_analytics/backend/logic/queries/flaky_tests.py@@ -47,12 +47,14 @@ _SELECT = """countIf(quarantined_in_run) AS quarantined_failed_run_count,max(run_signal_at) AS last_signal_atFROM (__RUN_EVIDENCE__)- __RUNNER_FILTER__+ WHERE __TEST_FILTERS__GROUP BY runner, nodeid- HAVING same_commit_recovery_run_count > 0+ HAVING (+ same_commit_recovery_run_count > 0OR quarantined_failed_run_count > 0OR master_failed_run_count > 0OR failed_pr_count >= {min_failed_prs}+ ) AND __SCOPE_FILTERS__ORDER BYmaster_failed_run_count DESC,failed_pr_count DESC,@@ -72,6 +74,9 @@ def query_flaky_tests(min_failed_prs: int,limit: int,runner: CITestRunner | None,+ test: str | None = None,+ branch: str | None = None,+ pr_number: int | None = None,) -> FlakyTestList:repository = curated.repository# Fail closed: the spans are scoped to the source's repository. Without a repository identity we@@ -87,15 +92,33 @@ def query_flaky_tests(setup_breaks=query_setup_breaks(curated=curated, date_from=date_from, date_to=date_to),)placeholders["min_failed_prs"] = ast.Constant(value=min_failed_prs)- runner_filter = ""+ test_filters = ["1"]if runner is not None:- runner_filter = "WHERE runner = {runner}"+ test_filters.append("runner = {runner}")placeholders["runner"] = ast.Constant(value=runner.value)+ # A branch or PR scope keeps a test that has evidence there, but counts all of its evidence, so+ # the row still shows whether the test also fails elsewhere.+ scope_filters = ["1"]+ if test:+ # The nodeid drops '.py' and folds the file/class boundary into '/', so a pytest selector+ # or file path only matches the selector. In HAVING, `selector` is the row's selector.+ scope_filters.append(+ "(positionCaseInsensitive(nodeid, {test}) > 0 OR positionCaseInsensitive(selector, {test}) > 0)"+ )+ placeholders["test"] = ast.Constant(value=test)+ if branch:+ scope_filters.append("countIf(branch = {branch}) > 0")+ placeholders["branch"] = ast.Constant(value=branch)+ if pr_number is not None:+ scope_filters.append("countIf(pr_number = {pr_number}) > 0")+ placeholders["pr_number"] = ast.Constant(value=str(pr_number))# +1 so a full page tells us more tests qualified than returned.placeholders["limit_plus_one"] = ast.Constant(value=limit + 1)- query = _SELECT.replace("__RUN_EVIDENCE__", run_evidence(bounded=date_to is not None)).replace(- "__RUNNER_FILTER__", runner_filter+ query = (+ _SELECT.replace("__RUN_EVIDENCE__", run_evidence(bounded=date_to is not None))+ .replace("__TEST_FILTERS__", " AND ".join(test_filters))+ .replace("__SCOPE_FILTERS__", " AND ".join(scope_filters)))response = curated.run(diff --git a/products/engineering_analytics/backend/logic/sources.py b/products/engineering_analytics/backend/logic/sources.pyindex f3d2e8011f22..f5c8497b2400 100644--- a/products/engineering_analytics/backend/logic/sources.py+++ b/products/engineering_analytics/backend/logic/sources.py@@ -150,9 +150,12 @@ def resolve_github_tables(With ``source_id``, reads that specific connected GitHub source; otherwise picks the oldestsource's first usable repo with both endpoints synced (oldest = the team's first/establishedconnection) — deterministic when a team has more than one source or a source syncs more than- one repo. Raises ``GitHubSourceNotConnectedError`` when no matching usable repo exists (the- presentation layer maps it to a 400, so the UI prompts to connect a source and an agent gets- an actionable error), or ``ValueError`` when ``source_id`` is not a UUID.+ one repo. Without ``source_id``, a repo that ``list_github_sources`` reports as synced wins over+ one it does not, so the default matches the first synced entry of the list; the oldest usable+ repo is the fallback when no listed repo is synced. Raises ``GitHubSourceNotConnectedError``+ when no matching usable repo exists (the presentation layer maps it to a 400, so the UI prompts+ to connect a source and an agent gets an actionable error), or ``ValueError`` when ``source_id``+ is not a UUID.``repo`` ('owner/name') scopes a repo-specific call — a team with several repos otherwise alwaysresolves the oldest, so a repo-scoped read (e.g. ``resolve_branch``, or the picker selecting a@@ -170,8 +173,11 @@ def resolve_github_tables(queryset = _github_sources(team, user_access_control)if source_id is not None:queryset = queryset.filter(id=_as_source_uuid(source_id))- # Lazy by default so the common path (no `repo`) stops querying sources on the first usable repo.candidates: Iterable[_RepoCandidate] = _repo_candidates(team=team, sources=queryset)+ if source_id is None:+ # Read what the sources list calls synced first. An old source can still hold tables for a repo+ # it no longer lists, and taking it by age alone reads stale data instead of the live source.+ candidates = _listed_first(candidates)if repo:# An explicit repo must never silently resolve a *different* named repo: the picker lists a# source's repos before they finish syncing, so a not-yet-complete pick should surface the@@ -450,6 +456,19 @@ class _RepoCandidate(NamedTuple):repository: strtables: _RepoTablessource_id: str+ # True when the source lists this repo, so ``list_github_sources`` reports it as synced.+ listed: bool+++def _listed_first(candidates: Iterable[_RepoCandidate]) -> Iterator[_RepoCandidate]:+ """Listed candidates in source order, then the unlisted ones, without reading sources ahead."""+ unlisted: list[_RepoCandidate] = []+ for candidate in candidates:+ if candidate.listed:+ yield candidate+ else:+ unlisted.append(candidate)+ yield from unlisteddef _repo_candidates(*, team: Team, sources: QuerySet[ExternalDataSource]) -> Iterator[_RepoCandidate]:@@ -479,7 +498,11 @@ def _repo_candidates(*, team: Team, sources: QuerySet[ExternalDataSource]) -> Itby_repo = _synced_tables_by_repo(team=team, source=source)for repo_key in sorted(by_repo, key=order_key):repository = display if repo_key == legacy_key else repo_key- yield _RepoCandidate(repository=repository, tables=by_repo[repo_key], source_id=str(source.id))+ # Mirrors list_github_sources: a source with no configured repo lists one blank entry.+ listed = repo_key in configured if configured else repo_key == ""+ yield _RepoCandidate(+ repository=repository, tables=by_repo[repo_key], source_id=str(source.id), listed=listed+ )def _github_sources(team: Team, user_access_control: "UserAccessControl | None" = None) -> QuerySet[ExternalDataSource]:@@ -639,6 +662,13 @@ def depot_source_job_attempts_table(team: Team, source: ExternalDataSource) -> sreturn _synced_table_name(team, source, DEPOT_JOB_ATTEMPTS_SCHEMA)+def depot_source_job_attempts(team: Team, source: ExternalDataSource) -> depot_ci.DepotJobAttempts | None:+ """The synced job attempts of one Depot source, scoped to the repository it syncs, or None."""+ table = depot_source_job_attempts_table(team, source)+ repository = _source_repository(source).casefold()+ return depot_ci.DepotJobAttempts.for_repository(table, repository) if table and repository else None++def _synced_table_name(team: Team, source: ExternalDataSource, schema_name: str) -> str | None:"""The warehouse table a source syncs for ``schema_name``, or None. Only a plain identifierqualifies, because callers interpolate the name into HogQL."""diff --git a/products/engineering_analytics/backend/logic/suite_health.py b/products/engineering_analytics/backend/logic/suite_health.pyindex ad22dcc3c419..4edd490b2bb6 100644--- a/products/engineering_analytics/backend/logic/suite_health.py+++ b/products/engineering_analytics/backend/logic/suite_health.py@@ -41,6 +41,9 @@ def build_flaky_tests(min_failed_prs: int | None = None,limit: int | None = None,runner: CITestRunner | None = None,+ test: str | None = None,+ branch: str | None = None,+ pr_number: int | None = None,) -> FlakyTestList:parsed_from, parsed_to = _parse_window(curated.team, date_from, date_to, default=_DEFAULT_FLAKY_WINDOW, max_days=MAX_FLAKY_WINDOW_DAYS@@ -60,6 +63,9 @@ def build_flaky_tests(min_failed_prs=min_failed_prs,limit=limit,runner=runner,+ test=test,+ branch=branch,+ pr_number=pr_number,)@@ -71,7 +77,9 @@ def build_trunk_quarantine(*, curated: CuratedGitHubSource) -> TrunkQuarantineDe)-def build_broken_tests(*, curated: CuratedGitHubSource) -> BrokenTestsResult:+def build_broken_tests(+ *, curated: CuratedGitHubSource, test: str | None = None, branch: str | None = None+) -> BrokenTestsResult:# Fixed windows resolved through the module's relative-date entry point (like current_branch_health):# the 2-day analysis window and the 24h sparkline window. The SQL uses now() for the age/span/offset# math, so these bounds only floor the scans.@@ -81,4 +89,6 @@ def build_broken_tests(*, curated: CuratedGitHubSource) -> BrokenTestsResult:hourly_from=_parse_date(curated.team, f"-{BROKEN_TEST_SPARKLINE_HOURS}h"),window_days=_BROKEN_TESTS_WINDOW_DAYS,limit=_BROKEN_TESTS_LIMIT,+ test=test,+ branch=branch,)diff --git a/products/engineering_analytics/backend/presentation/views/_base.py b/products/engineering_analytics/backend/presentation/views/_base.pyindex ce1a512d0708..73489c059ce2 100644--- a/products/engineering_analytics/backend/presentation/views/_base.py+++ b/products/engineering_analytics/backend/presentation/views/_base.py@@ -86,7 +86,7 @@ _SOURCE_ID = OpenApiParameter(location=OpenApiParameter.QUERY,required=False,description="Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub "- "source when the team has more than one.",+ "source that the `sources` list reports as synced, when the team has more than one.",)_REPO = OpenApiParameter(diff --git a/products/engineering_analytics/backend/presentation/views/suite_health.py b/products/engineering_analytics/backend/presentation/views/suite_health.pyindex 3c74880be145..2d5b9199350d 100644--- a/products/engineering_analytics/backend/presentation/views/suite_health.py+++ b/products/engineering_analytics/backend/presentation/views/suite_health.py@@ -33,6 +33,24 @@ from products.engineering_analytics.backend.presentation.views._base import (_optional_int_param,)+_TEST = OpenApiParameter(+ name="test",+ type=OpenApiTypes.STR,+ location=OpenApiParameter.QUERY,+ required=False,+ description="Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or "+ "'posthog/api/test/test_user.py'. Applied before the limit, so a test past the cap is still found.",+)++_TEST_BRANCH = OpenApiParameter(+ name="branch",+ type=OpenApiTypes.STR,+ location=OpenApiParameter.QUERY,+ required=False,+ description="Optional exact branch name. Keeps only tests that failed on it, but the counts still "+ "cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.",+)+class SuiteHealthActionsMixin(EngineeringAnalyticsViewSetBase):READ_ACTIONS = ["flaky_tests", "broken_tests", "quarantine", "trunk_quarantine"]@@ -73,13 +91,25 @@ class SuiteHealthActionsMixin(EngineeringAnalyticsViewSetBase):enum=[runner.value for runner in CITestRunner],description="Optional test runner to return: 'pytest' or 'jest'.",),+ _TEST,+ _TEST_BRANCH,+ OpenApiParameter(+ name="pr_number",+ type=OpenApiTypes.INT,+ location=OpenApiParameter.QUERY,+ required=False,+ description="Optional pull request number. Keeps only tests that failed in that PR's CI runs, "+ "but the counts still cover every PR. Pass min_failed_prs=1 too, so a test that failed on "+ "this PR alone qualifies. Applied before the limit.",+ ),_SOURCE_ID,_REPO,],responses={200: FlakyTestListSerializer,400: OpenApiResponse(- description="Invalid date, threshold, limit, runner, or source_id, or a window longer than 30 days."+ description="Invalid date, threshold, limit, runner, pr_number, or source_id, or a window "+ "longer than 30 days."),},description=(@@ -103,17 +133,20 @@ class SuiteHealthActionsMixin(EngineeringAnalyticsViewSetBase):min_failed_prs=_optional_int_param(request, "min_failed_prs"),limit=_optional_int_param(request, "limit"),runner=_optional_enum_param(request, "runner", CITestRunner),+ test=request.query_params.get("test") or None,+ branch=request.query_params.get("branch") or None,+ pr_number=_optional_int_param(request, "pr_number"),source_id=request.query_params.get("source_id") or None,repo=request.query_params.get("repo") or None,user_access_control=self.user_access_control,)except ValueError as exc:- return _bad_request(exc, fallback="Invalid date, threshold, limit, runner, or source_id")+ return _bad_request(exc, fallback="Invalid date, threshold, limit, runner, pr_number, or source_id")return Response(FlakyTestListSerializer(instance=result).data)@extend_schema(operation_id="engineering_analytics_broken_tests",- parameters=[_SOURCE_ID, _REPO],+ parameters=[_TEST, _TEST_BRANCH, _SOURCE_ID, _REPO],responses={200: BrokenTestsResultSerializer,400: OpenApiResponse(description="Invalid source_id."),@@ -138,6 +171,8 @@ class SuiteHealthActionsMixin(EngineeringAnalyticsViewSetBase):try:result = api.get_broken_tests(team=self.team,+ test=request.query_params.get("test") or None,+ branch=request.query_params.get("branch") or None,source_id=request.query_params.get("source_id") or None,repo=request.query_params.get("repo") or None,user_access_control=self.user_access_control,diff --git a/products/engineering_analytics/backend/tests/test_broken_tests.py b/products/engineering_analytics/backend/tests/test_broken_tests.pyindex a32780aa4f02..342233cd83be 100644--- a/products/engineering_analytics/backend/tests/test_broken_tests.py+++ b/products/engineering_analytics/backend/tests/test_broken_tests.py@@ -7,6 +7,8 @@ import pytestfrom posthog.test.base import BaseTest, ClickhouseTestMixinfrom unittest import mock+from parameterized import parameterized+from posthog.clickhouse.client import sync_executefrom products.engineering_analytics.backend.facade.contracts import BROKEN_TEST_SPARKLINE_HOURS, BrokenTestState@@ -285,7 +287,7 @@ class TestBrokenTestsQueryOverClickHouse(ClickhouseTestMixin, BaseTest):payload = "".join(json.dumps({"team_id": self.team.id, **row}) + "\n" for row in rows)sync_execute(f"INSERT INTO logs FORMAT JSONEachRow\n{payload}")- def _failure_log(self, *, repo: str, test_id: str) -> dict[str, Any]:+ def _failure_log(self, *, repo: str, test_id: str, branch: str = "master") -> dict[str, Any]:# attributes_map_str keys carry the "__str" suffix the logs table strips for the queryable map.return {"timestamp": "2026-07-10 12:00:00.000000",@@ -293,7 +295,7 @@ class TestBrokenTestsQueryOverClickHouse(ClickhouseTestMixin, BaseTest):"service_name": CI_LOGS_SERVICE_NAME,"attributes_map_str": {"repo__str": repo,- "branch__str": "master",+ "branch__str": branch,"head_sha__str": "abc123","workflow_name__str": "Backend CI","job_name__str": "test (1)",@@ -330,3 +332,36 @@ class TestBrokenTestsQueryOverClickHouse(ClickhouseTestMixin, BaseTest):# only the selected repo's failure comes back.assert [row.test_id for row in result.rows] == ["posthog/api/test_foo.py::test_bar"]assert result.rows[0].repo == "PostHog/posthog"++ @parameterized.expand(+ [+ # The capped read keeps the wider-spread test, so only a filter applied before the cap finds the other one.+ ("unfiltered", None, None, ["posthog/api/test_foo.py::test_bar"], 2),+ ("test_substring", "TEST_BAZ", None, ["posthog/api/test_foo.py::test_baz"], 1),+ # A branch keeps the test that failed there and still counts its other branches.+ ("branch", None, "feature-y", ["posthog/api/test_foo.py::test_baz"], 1),+ ("branch_keeps_other_branch_counts", None, "feature-x", ["posthog/api/test_foo.py::test_bar"], 2),+ ]+ )+ def test_filters_apply_before_the_cap(+ self, _name: str, test: str | None, branch: str | None, expected: list[str], expected_branches: int+ ) -> None:+ bar, baz = "posthog/api/test_foo.py::test_bar", "posthog/api/test_foo.py::test_baz"+ self._insert_logs(+ [+ self._failure_log(repo="PostHog/posthog", test_id=bar, branch="master"),+ self._failure_log(repo="PostHog/posthog", test_id=bar, branch="feature-x"),+ self._failure_log(repo="PostHog/posthog", test_id=baz, branch="feature-y"),+ ]+ )+ result = query_broken_tests(+ curated=self._source(),+ date_from=datetime(2026, 7, 9, tzinfo=UTC),+ hourly_from=datetime(2026, 7, 9, tzinfo=UTC),+ window_days=2,+ limit=1,+ test=test,+ branch=branch,+ )+ assert [row.test_id for row in result.rows] == expected+ assert result.rows[0].branches == expected_branchesdiff --git a/products/engineering_analytics/backend/tests/test_flaky_tests.py b/products/engineering_analytics/backend/tests/test_flaky_tests.pyindex 3ed578f341ee..001d65380cb9 100644--- a/products/engineering_analytics/backend/tests/test_flaky_tests.py+++ b/products/engineering_analytics/backend/tests/test_flaky_tests.py@@ -593,6 +593,26 @@ class TestFlakyTestsAPI(ClickhouseTestMixin, APIBaseTest):assert data["items"][0]["runner"] == "jest"assert data["truncated"] is True+ @parameterized.expand(+ [+ ("test_substring", {"test": "TESTTHREE::test_fails"}, T_THREE_PRS, 3),+ # A pytest selector keeps '.py', which the nodeid drops, so it matches through the selector.+ ("pytest_selector", {"test": "test_injob.py::TestInJob"}, T_IN_JOB_RETRY, 0),+ # A PR or branch scope still counts the test's failures on every other PR.+ ("pr_number", {"pr_number": "502"}, T_THREE_PRS, 3),+ ("branch", {"branch": "f2"}, T_THREE_PRS, 3),+ # A test that failed on too few PRs needs the lower bar to show up for its PR.+ ("pr_number_below_the_bar", {"pr_number": "601", "min_failed_prs": "1"}, T_TWO_PRS, 2),+ ]+ )+ def test_test_and_scope_filters_apply_before_limit(+ self, _name: str, params: dict, expected: str, expected_failed_prs: int+ ) -> None:+ items = self._get(limit="1", **params)["items"]++ assert [item["nodeid"] for item in items] == [expected]+ assert items[0]["failed_pr_count"] == expected_failed_prs+@parameterized.expand([("window_over_30_days", {"date_from": "-45d"}),@@ -602,6 +622,7 @@ class TestFlakyTestsAPI(ClickhouseTestMixin, APIBaseTest):("oversized_limit", {"limit": "201"}),("non_integer_threshold", {"min_failed_prs": "lots"}),("unknown_runner", {"runner": "playwright"}),+ ("non_integer_pr_number", {"pr_number": "abc"}),])def test_invalid_params_return_400(self, _name: str, params: dict) -> None:diff --git a/products/engineering_analytics/backend/tests/test_logic_sources.py b/products/engineering_analytics/backend/tests/test_logic_sources.pyindex e9a68f6d7962..088850589f99 100644--- a/products/engineering_analytics/backend/tests/test_logic_sources.py+++ b/products/engineering_analytics/backend/tests/test_logic_sources.py@@ -203,6 +203,28 @@ class TestResolveGitHubTables(BaseTest):tables = resolve_github_tables(team=self.team)assert tables.pull_requests == "oldergithub_pull_requests"+ @parameterized.expand(+ [+ ("listed_source_connected", True, "livegithub_pull_requests"),+ ("fallback", False, "stalegithub_pull_requests"),+ ]+ )+ def test_default_prefers_the_source_the_list_reports_as_synced(+ self, _name: str, connect_live: bool, expected_table: str+ ) -> None:+ # The older source lists the repo but holds its tables as unattributed bare rows, so the list+ # reports it as not synced. Its tables still resolve, so only the listed state can rank it.+ stale = self._connect(prefix="stale", schemas=self._BOTH_SYNCED)+ ExternalDataSource.objects.filter(pk=stale.pk).update(job_inputs={"repositories": ["PostHog/posthog"]})+ if connect_live:+ self._connect(prefix="live", schemas=self._BOTH_SYNCED, repository="PostHog/posthog")++ listed = {entry.prefix: entry.synced for entry in list_github_sources(team=self.team)}+ tables = resolve_github_tables(team=self.team)++ assert listed["stale"] is False+ assert tables.pull_requests == expected_table+def test_skips_incomplete_source_for_a_complete_one(self) -> None:# The oldest source is missing an endpoint; resolution falls through to the complete one.self._connect(prefix="incomplete", schemas=[(PULL_REQUESTS_SCHEMA, True, True)])diff --git a/products/engineering_analytics/frontend/generated/api.schemas.ts b/products/engineering_analytics/frontend/generated/api.schemas.tsindex 1566648eab2f..cc22a01d76ba 100644--- a/products/engineering_analytics/frontend/generated/api.schemas.ts+++ b/products/engineering_analytics/frontend/generated/api.schemas.ts@@ -2699,7 +2699,7 @@ export type EngineeringAnalyticsAttentionPullRequestsParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2714,7 +2714,7 @@ export type EngineeringAnalyticsAuthorFrictionParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2729,7 +2729,7 @@ export type EngineeringAnalyticsAuthorFrictionDetailParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2756,7 +2756,7 @@ export type EngineeringAnalyticsAuthorLlmSpendParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2779,20 +2779,28 @@ export type EngineeringAnalyticsAuthorWorkflowCostsParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}export type EngineeringAnalyticsBrokenTestsParams = {+ /**+ * Optional exact branch name. Keeps only tests that failed on it, but the counts still cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.+ */+ branch?: string/*** 'owner/name' repository to scope to when the selected source syncs several repositories (from the `sources` list). Defaults to the source's first repository.*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string+ /**+ * Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or 'posthog/api/test/test_user.py'. Applied before the limit, so a test past the cap is still found.+ */+ test?: string}export type EngineeringAnalyticsCiCardsParams = {@@ -2801,7 +2809,7 @@ export type EngineeringAnalyticsCiCardsParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2828,7 +2836,7 @@ export type EngineeringAnalyticsCiFailureLogsParams = {*/repo: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2905,7 +2913,7 @@ export type EngineeringAnalyticsCurrentBranchHealthParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2932,7 +2940,7 @@ export type EngineeringAnalyticsDeliveryComparisonParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2959,7 +2967,7 @@ export type EngineeringAnalyticsDeliverySummaryParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -2990,7 +2998,7 @@ export type EngineeringAnalyticsDoraParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3005,6 +3013,10 @@ export const EngineeringAnalyticsDoraGranularity = {} as constexport type EngineeringAnalyticsFlakyTestsParams = {+ /**+ * Optional exact branch name. Keeps only tests that failed on it, but the counts still cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.+ */+ branch?: string/*** Window start: relative ('-7d', '-30d') or ISO8601. Defaults to -7d; the window may span at most 30 days.*/@@ -3021,6 +3033,10 @@ export type EngineeringAnalyticsFlakyTestsParams = {* A test with no recorded recovery qualifies once it failed on at least this many distinct pull requests in the window. Minimum 1. Defaults to 3.*/min_failed_prs?: number+ /**+ * Optional pull request number. Keeps only tests that failed in that PR's CI runs, but the counts still cover every PR. Pass min_failed_prs=1 too, so a test that failed on this PR alone qualifies. Applied before the limit.+ */+ pr_number?: number/*** 'owner/name' repository to scope to when the selected source syncs several repositories (from the `sources` list). Defaults to the source's first repository.*/@@ -3030,9 +3046,13 @@ export type EngineeringAnalyticsFlakyTestsParams = {*/runner?: EngineeringAnalyticsFlakyTestsRunner/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string+ /**+ * Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or 'posthog/api/test/test_user.py'. Applied before the limit, so a test past the cap is still found.+ */+ test?: string}export type EngineeringAnalyticsFlakyTestsRunner =@@ -3065,7 +3085,7 @@ export type EngineeringAnalyticsJobAggregatesParams = {*/run_scope?: EngineeringAnalyticsJobAggregatesRunScope/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3134,7 +3154,7 @@ export type EngineeringAnalyticsLlmSpendCoverageParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3157,7 +3177,7 @@ export type EngineeringAnalyticsMasterFailuresParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3172,7 +3192,7 @@ export type EngineeringAnalyticsPrCostParams = {*/repo: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3187,7 +3207,7 @@ export type EngineeringAnalyticsPrLifecycleParams = {*/repo: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3202,7 +3222,7 @@ export type EngineeringAnalyticsPrRunsParams = {*/repo: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3217,7 +3237,7 @@ export type EngineeringAnalyticsPullRequestFrictionParams = {*/repo: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3248,7 +3268,7 @@ export type EngineeringAnalyticsPullRequestTimelinesParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3279,7 +3299,7 @@ export type EngineeringAnalyticsPullRequestsParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3303,7 +3323,7 @@ export type EngineeringAnalyticsQuarantineParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3326,7 +3346,7 @@ export type EngineeringAnalyticsRepoOverviewParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3349,7 +3369,7 @@ export type EngineeringAnalyticsRepoRunActivityParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3364,7 +3384,7 @@ export type EngineeringAnalyticsResolveBranchParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3387,7 +3407,7 @@ export type EngineeringAnalyticsRunFailureLogsParams = {*/run_id: number/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3418,7 +3438,7 @@ export type EngineeringAnalyticsTeamCiActivityParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3453,7 +3473,7 @@ export type EngineeringAnalyticsTeamCiHealthParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3476,7 +3496,7 @@ export type EngineeringAnalyticsTeamMergeTrendParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3487,7 +3507,7 @@ export type EngineeringAnalyticsTrunkQuarantineParams = {*/repo?: string/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3514,7 +3534,7 @@ export type EngineeringAnalyticsWorkflowHealthParams = {*/run_scope?: EngineeringAnalyticsWorkflowHealthRunScope/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3551,7 +3571,7 @@ export type EngineeringAnalyticsWorkflowJobsParams = {*/run_id: number/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3578,7 +3598,7 @@ export type EngineeringAnalyticsWorkflowRunParams = {*/run_id: number/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string}@@ -3613,7 +3633,7 @@ export type EngineeringAnalyticsWorkflowRunActivityParams = {*/run_scope?: EngineeringAnalyticsWorkflowRunActivityRunScope/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3654,7 +3674,7 @@ export type EngineeringAnalyticsWorkflowRunnerCostsParams = {*/run_scope?: EngineeringAnalyticsWorkflowRunnerCostsRunScope/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**@@ -3695,7 +3715,7 @@ export type EngineeringAnalyticsWorkflowRunsParams = {*/run_scope?: EngineeringAnalyticsWorkflowRunsRunScope/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string/**diff --git a/products/engineering_analytics/mcp/tools.yaml b/products/engineering_analytics/mcp/tools.yamlindex 92cb21d8a9f2..99a36fec3ab1 100644--- a/products/engineering_analytics/mcp/tools.yaml+++ b/products/engineering_analytics/mcp/tools.yaml@@ -32,7 +32,9 @@ tools:Caveats: fingerprinting is pytest-only for now (jest/playwright/cargo failures aren't grouped yet), and thebreaking/resolved distinction needs the job-level source synced: without it those failures fall through toflaky/pr_only rather than being misreported. Counts are absolute, never rates (passing runs aren't in this- data).+ data). The list stops at 200 rows, so to ask about one test or one PR pass test (a test id substring) and/or+ branch (the PR's head branch): both apply before the cap, and a branch-scoped row still counts every branch,+ so its branches and master_hits show whether the failure also happens elsewhere.hooks: engineeringAnalytics/redactFailureLogsHooksfeature_flag: engineering-analyticsengineering-analytics-ci-failure-logs:@@ -115,7 +117,10 @@ tools:A CI setup break excludes every trial of the attempt, not only its failures: a run attempt whose testserrored in three or more jobs or for three or more owning teams, or a job attempt with 100 or more distinctfailed or errored tests. Counts are absolute, never rates, because fast passing runs are not emitted. Use- selector to run or quarantine the test with its runner; nodeid is only the stable grouping key.+ selector to run or quarantine the test with its runner; nodeid is only the stable grouping key. To ask about+ one test or one PR, pass test (a nodeid substring), branch, and/or pr_number: they apply before the limit,+ and the counts still cover every PR and branch, so a row shows whether the test also fails elsewhere. Add+ min_failed_prs=1 so a test that failed on that PR alone qualifies.feature_flag: engineering-analyticsengineering-analytics-pr-cost:operation: engineering_analytics_pr_cost@@ -176,9 +181,9 @@ tools:than one source or repo, then pass a chosen entry's id as source_id AND its repo as repo to thepull-requests, workflow-health, ci-cards, pr-lifecycle, or team-ci-health tools to read that specific repo:omitting repo on a multi-repo source reads the source's default repo, not the one you picked. With a single- source/repo you can skip it: the other tools default to the oldest connected source. The prefix also names- the underlying warehouse tables, which you can query directly with SQL or save as SQL insights and- subscriptions when the named tools don't fit. The source's original repo uses bare names (prefix ++ source/repo you can skip it: the other tools default to the oldest source whose entry is synced. The prefix+ also names the underlying warehouse tables, which you can query directly with SQL or save as SQL insights+ and subscriptions when the named tools don't fit. The source's original repo uses bare names (prefix +github_pull_requests / github_workflow_runs / github_workflow_jobs); every other repo of a multi-repo sourceis repo-qualified: the name `owner/repo.endpoint` is flattened for the table (each '/' becomes '_' and each'.' becomes '__', lower-cased), e.g. posthog/posthog.com's pull_requests is prefix +diff --git a/products/engineering_analytics/skills/investigating-ci-failures/SKILL.md b/products/engineering_analytics/skills/investigating-ci-failures/SKILL.mdindex 906d9022c8db..ae74ca21f712 100644--- a/products/engineering_analytics/skills/investigating-ci-failures/SKILL.md+++ b/products/engineering_analytics/skills/investigating-ci-failures/SKILL.md@@ -146,6 +146,7 @@ threshold aren't recorded, so there is no honest denominator.| "Why did MY PR's CI fail?" | `engineering-analytics-ci-failure-logs` MCP tool (PR-scoped, grouped) || "Who broke master / when did X start?" | The two views, workflow above || "Is X flaky?" | Shape from `ci_failures` + the flaky-tests tool |+| "Does test X fail on other branches?" | `test` (+ `branch` / `pr_number`) on the broken-tests or flaky-tests tool || "Is this setup/infra failure common?" | Job conclusions, query 7 (no test rows exist for it) || "What's failing on master right now?" | `breaking_master` rows + `breaking_master_jobs` from the broken-tests tool || "Is CI slow / expensive / PRs stuck?" | The `diagnosing-ci-and-merge-bottlenecks` skill |diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex a9cbaae345b0..cfcb89fccada 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -4944,7 +4944,7 @@}},"engineering-analytics-broken-tests": {- "description": "Live CI failures over the last 2 days, grouped into distinct failures (by failing test id + a normalized error signature) and classified by how each is behaving right now, most urgent first. Reach for this to answer \"what CI failures should I care about right now\": it is the triage counterpart to the test-health queue (which ranks week-long unreliability). Each row's state is the verdict: breaking_master (failing on the default branch and that job's latest run is still red, so trunk is broken now), blocking_merge_queue (failing only on merge-queue gate branches, so it stopped a merge on a commit that had already passed the PR's own CI: the conflict-with-trunk class the queue exists to catch), novel_burst (first seen within a day and already spreading across branches, not on trunk yet), potentially_resolved (hit trunk but that job is green again), flaky (sporadic across two or more branches over more than a day), or pr_only (confined to one branch: one PR's own problem). Also returns breaking_master_jobs, the default-branch jobs whose latest run is red. Pass a row's latest_run_id and latest_ci_engine to run-failure-logs to read the failing lines. Caveats: fingerprinting is pytest-only for now (jest/playwright/cargo failures aren't grouped yet), and the breaking/resolved distinction needs the job-level source synced: without it those failures fall through to flaky/pr_only rather than being misreported. Counts are absolute, never rates (passing runs aren't in this data).",+ "description": "Live CI failures over the last 2 days, grouped into distinct failures (by failing test id + a normalized error signature) and classified by how each is behaving right now, most urgent first. Reach for this to answer \"what CI failures should I care about right now\": it is the triage counterpart to the test-health queue (which ranks week-long unreliability). Each row's state is the verdict: breaking_master (failing on the default branch and that job's latest run is still red, so trunk is broken now), blocking_merge_queue (failing only on merge-queue gate branches, so it stopped a merge on a commit that had already passed the PR's own CI: the conflict-with-trunk class the queue exists to catch), novel_burst (first seen within a day and already spreading across branches, not on trunk yet), potentially_resolved (hit trunk but that job is green again), flaky (sporadic across two or more branches over more than a day), or pr_only (confined to one branch: one PR's own problem). Also returns breaking_master_jobs, the default-branch jobs whose latest run is red. Pass a row's latest_run_id and latest_ci_engine to run-failure-logs to read the failing lines. Caveats: fingerprinting is pytest-only for now (jest/playwright/cargo failures aren't grouped yet), and the breaking/resolved distinction needs the job-level source synced: without it those failures fall through to flaky/pr_only rather than being misreported. Counts are absolute, never rates (passing runs aren't in this data). The list stops at 200 rows, so to ask about one test or one PR pass test (a test id substring) and/or branch (the PR's head branch): both apply before the cap, and a branch-scoped row still counts every branch, so its branches and master_hits show whether the failure also happens elsewhere.","category": "Engineering analytics","feature": "engineering_analytics","summary": "Broken tests triage",@@ -4976,7 +4976,7 @@"feature_flag": "engineering-analytics"},"engineering-analytics-flaky-tests": {- "description": "Pytest and Jest tests worth acting on now, from the per-test CI spans over a window (date_from default -7d, maximum 30 days), ranked by blast radius: master failures first, then how many distinct PRs the test broke. Use this for \"what is this failing test costing us\" and to pick quarantine candidates. It does not measure flake rates. This data sees the main Backend pytest and Frontend Jest suites; package-specific runners are not included. Evidence is counted per CI run, never per span or run attempt: one run fans a test across matrix legs, and re-run attempts re-test the same commit. classification is confirmed_flake only when one commit both failed and passed the test (same_commit_recovery_run_count > 0): a \"Re-run failed jobs\" attempt went green on the same commit, or an in-job pytest retry (tests hand-marked @pytest.mark.flaky(reruns=N)) recovered it. quarantined means a tolerated failure was recorded while the test was masked. suspected_regression means only failures were recorded, which is absence of proof, not proof of a real break: treat it as real until a recovery proves otherwise. A test qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs (default 3). A CI setup break excludes every trial of the attempt, not only its failures: a run attempt whose tests errored in three or more jobs or for three or more owning teams, or a job attempt with 100 or more distinct failed or errored tests. Counts are absolute, never rates, because fast passing runs are not emitted. Use selector to run or quarantine the test with its runner; nodeid is only the stable grouping key.",+ "description": "Pytest and Jest tests worth acting on now, from the per-test CI spans over a window (date_from default -7d, maximum 30 days), ranked by blast radius: master failures first, then how many distinct PRs the test broke. Use this for \"what is this failing test costing us\" and to pick quarantine candidates. It does not measure flake rates. This data sees the main Backend pytest and Frontend Jest suites; package-specific runners are not included. Evidence is counted per CI run, never per span or run attempt: one run fans a test across matrix legs, and re-run attempts re-test the same commit. classification is confirmed_flake only when one commit both failed and passed the test (same_commit_recovery_run_count > 0): a \"Re-run failed jobs\" attempt went green on the same commit, or an in-job pytest retry (tests hand-marked @pytest.mark.flaky(reruns=N)) recovered it. quarantined means a tolerated failure was recorded while the test was masked. suspected_regression means only failures were recorded, which is absence of proof, not proof of a real break: treat it as real until a recovery proves otherwise. A test qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs (default 3). A CI setup break excludes every trial of the attempt, not only its failures: a run attempt whose tests errored in three or more jobs or for three or more owning teams, or a job attempt with 100 or more distinct failed or errored tests. Counts are absolute, never rates, because fast passing runs are not emitted. Use selector to run or quarantine the test with its runner; nodeid is only the stable grouping key. To ask about one test or one PR, pass test (a nodeid substring), branch, and/or pr_number: they apply before the limit, and the counts still cover every PR and branch, so a row shows whether the test also fails elsewhere. Add min_failed_prs=1 so a test that failed on that PR alone qualifies.","category": "Engineering analytics","feature": "engineering_analytics","summary": "Active test health queue",@@ -5024,7 +5024,7 @@"feature_flag": "engineering-analytics"},"engineering-analytics-sources": {- "description": "The team's selectable GitHub repositories, oldest source first: one entry per repository a source syncs, each with its source id, repo (owner/name), table prefix, and a synced flag. A source can sync several repositories, so entries can share an id and differ only by repo. Call this first when a team may have more than one source or repo, then pass a chosen entry's id as source_id AND its repo as repo to the pull-requests, workflow-health, ci-cards, pr-lifecycle, or team-ci-health tools to read that specific repo: omitting repo on a multi-repo source reads the source's default repo, not the one you picked. With a single source/repo you can skip it: the other tools default to the oldest connected source. The prefix also names the underlying warehouse tables, which you can query directly with SQL or save as SQL insights and subscriptions when the named tools don't fit. The source's original repo uses bare names (prefix + github_pull_requests / github_workflow_runs / github_workflow_jobs); every other repo of a multi-repo source is repo-qualified: the name `owner/repo.endpoint` is flattened for the table (each '/' becomes '_' and each '.' becomes '__', lower-cased), e.g. posthog/posthog.com's pull_requests is prefix + github_posthog_posthog__com__pull_requests: so pick the table for the repo you mean (timestamps land as strings; parse with parseDateTimeBestEffort).",+ "description": "The team's selectable GitHub repositories, oldest source first: one entry per repository a source syncs, each with its source id, repo (owner/name), table prefix, and a synced flag. A source can sync several repositories, so entries can share an id and differ only by repo. Call this first when a team may have more than one source or repo, then pass a chosen entry's id as source_id AND its repo as repo to the pull-requests, workflow-health, ci-cards, pr-lifecycle, or team-ci-health tools to read that specific repo: omitting repo on a multi-repo source reads the source's default repo, not the one you picked. With a single source/repo you can skip it: the other tools default to the oldest source whose entry is synced. The prefix also names the underlying warehouse tables, which you can query directly with SQL or save as SQL insights and subscriptions when the named tools don't fit. The source's original repo uses bare names (prefix + github_pull_requests / github_workflow_runs / github_workflow_jobs); every other repo of a multi-repo source is repo-qualified: the name `owner/repo.endpoint` is flattened for the table (each '/' becomes '_' and each '.' becomes '__', lower-cased), e.g. posthog/posthog.com's pull_requests is prefix + github_posthog_posthog__com__pull_requests: so pick the table for the repo you mean (timestamps land as strings; parse with parseDateTimeBestEffort).","category": "Engineering analytics","feature": "engineering_analytics","summary": "List connected GitHub sources",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 4443d5b4c031..d69b9e305e78 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -4973,7 +4973,7 @@}},"engineering-analytics-broken-tests": {- "description": "Live CI failures over the last 2 days, grouped into distinct failures (by failing test id + a normalized error signature) and classified by how each is behaving right now, most urgent first. Reach for this to answer \"what CI failures should I care about right now\": it is the triage counterpart to the test-health queue (which ranks week-long unreliability). Each row's state is the verdict: breaking_master (failing on the default branch and that job's latest run is still red, so trunk is broken now), blocking_merge_queue (failing only on merge-queue gate branches, so it stopped a merge on a commit that had already passed the PR's own CI: the conflict-with-trunk class the queue exists to catch), novel_burst (first seen within a day and already spreading across branches, not on trunk yet), potentially_resolved (hit trunk but that job is green again), flaky (sporadic across two or more branches over more than a day), or pr_only (confined to one branch: one PR's own problem). Also returns breaking_master_jobs, the default-branch jobs whose latest run is red. Pass a row's latest_run_id and latest_ci_engine to run-failure-logs to read the failing lines. Caveats: fingerprinting is pytest-only for now (jest/playwright/cargo failures aren't grouped yet), and the breaking/resolved distinction needs the job-level source synced: without it those failures fall through to flaky/pr_only rather than being misreported. Counts are absolute, never rates (passing runs aren't in this data).",+ "description": "Live CI failures over the last 2 days, grouped into distinct failures (by failing test id + a normalized error signature) and classified by how each is behaving right now, most urgent first. Reach for this to answer \"what CI failures should I care about right now\": it is the triage counterpart to the test-health queue (which ranks week-long unreliability). Each row's state is the verdict: breaking_master (failing on the default branch and that job's latest run is still red, so trunk is broken now), blocking_merge_queue (failing only on merge-queue gate branches, so it stopped a merge on a commit that had already passed the PR's own CI: the conflict-with-trunk class the queue exists to catch), novel_burst (first seen within a day and already spreading across branches, not on trunk yet), potentially_resolved (hit trunk but that job is green again), flaky (sporadic across two or more branches over more than a day), or pr_only (confined to one branch: one PR's own problem). Also returns breaking_master_jobs, the default-branch jobs whose latest run is red. Pass a row's latest_run_id and latest_ci_engine to run-failure-logs to read the failing lines. Caveats: fingerprinting is pytest-only for now (jest/playwright/cargo failures aren't grouped yet), and the breaking/resolved distinction needs the job-level source synced: without it those failures fall through to flaky/pr_only rather than being misreported. Counts are absolute, never rates (passing runs aren't in this data). The list stops at 200 rows, so to ask about one test or one PR pass test (a test id substring) and/or branch (the PR's head branch): both apply before the cap, and a branch-scoped row still counts every branch, so its branches and master_hits show whether the failure also happens elsewhere.","category": "Engineering analytics","feature": "engineering_analytics","summary": "Broken tests triage",@@ -5005,7 +5005,7 @@"feature_flag": "engineering-analytics"},"engineering-analytics-flaky-tests": {- "description": "Pytest and Jest tests worth acting on now, from the per-test CI spans over a window (date_from default -7d, maximum 30 days), ranked by blast radius: master failures first, then how many distinct PRs the test broke. Use this for \"what is this failing test costing us\" and to pick quarantine candidates. It does not measure flake rates. This data sees the main Backend pytest and Frontend Jest suites; package-specific runners are not included. Evidence is counted per CI run, never per span or run attempt: one run fans a test across matrix legs, and re-run attempts re-test the same commit. classification is confirmed_flake only when one commit both failed and passed the test (same_commit_recovery_run_count > 0): a \"Re-run failed jobs\" attempt went green on the same commit, or an in-job pytest retry (tests hand-marked @pytest.mark.flaky(reruns=N)) recovered it. quarantined means a tolerated failure was recorded while the test was masked. suspected_regression means only failures were recorded, which is absence of proof, not proof of a real break: treat it as real until a recovery proves otherwise. A test qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs (default 3). A CI setup break excludes every trial of the attempt, not only its failures: a run attempt whose tests errored in three or more jobs or for three or more owning teams, or a job attempt with 100 or more distinct failed or errored tests. Counts are absolute, never rates, because fast passing runs are not emitted. Use selector to run or quarantine the test with its runner; nodeid is only the stable grouping key.",+ "description": "Pytest and Jest tests worth acting on now, from the per-test CI spans over a window (date_from default -7d, maximum 30 days), ranked by blast radius: master failures first, then how many distinct PRs the test broke. Use this for \"what is this failing test costing us\" and to pick quarantine candidates. It does not measure flake rates. This data sees the main Backend pytest and Frontend Jest suites; package-specific runners are not included. Evidence is counted per CI run, never per span or run attempt: one run fans a test across matrix legs, and re-run attempts re-test the same commit. classification is confirmed_flake only when one commit both failed and passed the test (same_commit_recovery_run_count > 0): a \"Re-run failed jobs\" attempt went green on the same commit, or an in-job pytest retry (tests hand-marked @pytest.mark.flaky(reruns=N)) recovered it. quarantined means a tolerated failure was recorded while the test was masked. suspected_regression means only failures were recorded, which is absence of proof, not proof of a real break: treat it as real until a recovery proves otherwise. A test qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs (default 3). A CI setup break excludes every trial of the attempt, not only its failures: a run attempt whose tests errored in three or more jobs or for three or more owning teams, or a job attempt with 100 or more distinct failed or errored tests. Counts are absolute, never rates, because fast passing runs are not emitted. Use selector to run or quarantine the test with its runner; nodeid is only the stable grouping key. To ask about one test or one PR, pass test (a nodeid substring), branch, and/or pr_number: they apply before the limit, and the counts still cover every PR and branch, so a row shows whether the test also fails elsewhere. Add min_failed_prs=1 so a test that failed on that PR alone qualifies.","category": "Engineering analytics","feature": "engineering_analytics","summary": "Active test health queue",@@ -5053,7 +5053,7 @@"feature_flag": "engineering-analytics"},"engineering-analytics-sources": {- "description": "The team's selectable GitHub repositories, oldest source first: one entry per repository a source syncs, each with its source id, repo (owner/name), table prefix, and a synced flag. A source can sync several repositories, so entries can share an id and differ only by repo. Call this first when a team may have more than one source or repo, then pass a chosen entry's id as source_id AND its repo as repo to the pull-requests, workflow-health, ci-cards, pr-lifecycle, or team-ci-health tools to read that specific repo: omitting repo on a multi-repo source reads the source's default repo, not the one you picked. With a single source/repo you can skip it: the other tools default to the oldest connected source. The prefix also names the underlying warehouse tables, which you can query directly with SQL or save as SQL insights and subscriptions when the named tools don't fit. The source's original repo uses bare names (prefix + github_pull_requests / github_workflow_runs / github_workflow_jobs); every other repo of a multi-repo source is repo-qualified: the name `owner/repo.endpoint` is flattened for the table (each '/' becomes '_' and each '.' becomes '__', lower-cased), e.g. posthog/posthog.com's pull_requests is prefix + github_posthog_posthog__com__pull_requests: so pick the table for the repo you mean (timestamps land as strings; parse with parseDateTimeBestEffort).",+ "description": "The team's selectable GitHub repositories, oldest source first: one entry per repository a source syncs, each with its source id, repo (owner/name), table prefix, and a synced flag. A source can sync several repositories, so entries can share an id and differ only by repo. Call this first when a team may have more than one source or repo, then pass a chosen entry's id as source_id AND its repo as repo to the pull-requests, workflow-health, ci-cards, pr-lifecycle, or team-ci-health tools to read that specific repo: omitting repo on a multi-repo source reads the source's default repo, not the one you picked. With a single source/repo you can skip it: the other tools default to the oldest source whose entry is synced. The prefix also names the underlying warehouse tables, which you can query directly with SQL or save as SQL insights and subscriptions when the named tools don't fit. The source's original repo uses bare names (prefix + github_pull_requests / github_workflow_runs / github_workflow_jobs); every other repo of a multi-repo source is repo-qualified: the name `owner/repo.endpoint` is flattened for the table (each '/' becomes '_' and each '.' becomes '__', lower-cased), e.g. posthog/posthog.com's pull_requests is prefix + github_posthog_posthog__com__pull_requests: so pick the table for the repo you mean (timestamps land as strings; parse with parseDateTimeBestEffort).","category": "Engineering analytics","feature": "engineering_analytics","summary": "List connected GitHub sources",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 0b31c9dc7b27..b18323c090d0 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -134890,7 +134890,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -134905,7 +134905,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -134920,7 +134920,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -134947,7 +134947,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -134970,20 +134970,28 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};export type EngineeringAnalyticsBrokenTestsParams = {+ /**+ * Optional exact branch name. Keeps only tests that failed on it, but the counts still cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.+ */+ branch?: string;/*** 'owner/name' repository to scope to when the selected source syncs several repositories (from the `sources` list). Defaults to the source's first repository.*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;+ /**+ * Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or 'posthog/api/test/test_user.py'. Applied before the limit, so a test past the cap is still found.+ */+ test?: string;};export type EngineeringAnalyticsCiCardsParams = {@@ -134992,7 +135000,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135019,7 +135027,7 @@ export namespace Schemas {*/repo: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135096,7 +135104,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135123,7 +135131,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135150,7 +135158,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135181,7 +135189,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135196,6 +135204,10 @@ export namespace Schemas {} as const;export type EngineeringAnalyticsFlakyTestsParams = {+ /**+ * Optional exact branch name. Keeps only tests that failed on it, but the counts still cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.+ */+ branch?: string;/*** Window start: relative ('-7d', '-30d') or ISO8601. Defaults to -7d; the window may span at most 30 days.*/@@ -135212,6 +135224,10 @@ export namespace Schemas {* A test with no recorded recovery qualifies once it failed on at least this many distinct pull requests in the window. Minimum 1. Defaults to 3.*/min_failed_prs?: number;+ /**+ * Optional pull request number. Keeps only tests that failed in that PR's CI runs, but the counts still cover every PR. Pass min_failed_prs=1 too, so a test that failed on this PR alone qualifies. Applied before the limit.+ */+ pr_number?: number;/*** 'owner/name' repository to scope to when the selected source syncs several repositories (from the `sources` list). Defaults to the source's first repository.*/@@ -135221,9 +135237,13 @@ export namespace Schemas {*/runner?: EngineeringAnalyticsFlakyTestsRunner;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;+ /**+ * Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or 'posthog/api/test/test_user.py'. Applied before the limit, so a test past the cap is still found.+ */+ test?: string;};export type EngineeringAnalyticsFlakyTestsRunner = typeof EngineeringAnalyticsFlakyTestsRunner[keyof typeof EngineeringAnalyticsFlakyTestsRunner];@@ -135256,7 +135276,7 @@ export namespace Schemas {*/run_scope?: EngineeringAnalyticsJobAggregatesRunScope;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135325,7 +135345,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135348,7 +135368,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135363,7 +135383,7 @@ export namespace Schemas {*/repo: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135378,7 +135398,7 @@ export namespace Schemas {*/repo: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135393,7 +135413,7 @@ export namespace Schemas {*/repo: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135408,7 +135428,7 @@ export namespace Schemas {*/repo: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135439,7 +135459,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135470,7 +135490,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135494,7 +135514,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135517,7 +135537,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135540,7 +135560,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135555,7 +135575,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135578,7 +135598,7 @@ export namespace Schemas {*/run_id: number;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135609,7 +135629,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135644,7 +135664,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135667,7 +135687,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135678,7 +135698,7 @@ export namespace Schemas {*/repo?: string;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135705,7 +135725,7 @@ export namespace Schemas {*/run_scope?: EngineeringAnalyticsWorkflowHealthRunScope;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135742,7 +135762,7 @@ export namespace Schemas {*/run_id: number;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135769,7 +135789,7 @@ export namespace Schemas {*/run_id: number;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;};@@ -135804,7 +135824,7 @@ export namespace Schemas {*/run_scope?: EngineeringAnalyticsWorkflowRunActivityRunScope;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135845,7 +135865,7 @@ export namespace Schemas {*/run_scope?: EngineeringAnalyticsWorkflowRunnerCostsRunScope;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**@@ -135886,7 +135906,7 @@ export namespace Schemas {*/run_scope?: EngineeringAnalyticsWorkflowRunsRunScope;/**- * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.*/source_id?: string;/**diff --git a/services/mcp/src/generated/engineering_analytics/api.ts b/services/mcp/src/generated/engineering_analytics/api.tsindex 52b55899c63d..351bd948bd14 100644--- a/services/mcp/src/generated/engineering_analytics/api.ts+++ b/services/mcp/src/generated/engineering_analytics/api.ts@@ -20,6 +20,12 @@ export const EngineeringAnalyticsBrokenTestsParams = () => zod.object({})export const EngineeringAnalyticsBrokenTestsQueryParams = () => zod.object({+ branch: zod+ .string()+ .optional()+ .describe(+ 'Optional exact branch name. Keeps only tests that failed on it, but the counts still cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.'+ ),repo: zod.string().optional()@@ -30,7 +36,13 @@ export const EngineeringAnalyticsBrokenTestsQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'+ ),+ test: zod+ .string()+ .optional()+ .describe(+ "Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or 'posthog\/api\/test\/test_user.py'. Applied before the limit, so a test past the cap is still found."),})@@ -52,7 +64,7 @@ export const EngineeringAnalyticsCiFailureLogsQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),})@@ -68,6 +80,12 @@ export const EngineeringAnalyticsFlakyTestsParams = () => zod.object({})export const EngineeringAnalyticsFlakyTestsQueryParams = () => zod.object({+ branch: zod+ .string()+ .optional()+ .describe(+ 'Optional exact branch name. Keeps only tests that failed on it, but the counts still cover every branch, so a row shows whether the test also fails elsewhere. Applied before the limit.'+ ),date_from: zod.string().optional()@@ -82,6 +100,12 @@ export const EngineeringAnalyticsFlakyTestsQueryParams = () => zod.object({.describe('A test with no recorded recovery qualifies once it failed on at least this many distinct pull requests in the window. Minimum 1. Defaults to 3.'),+ pr_number: zod+ .number()+ .optional()+ .describe(+ "Optional pull request number. Keeps only tests that failed in that PR's CI runs, but the counts still cover every PR. Pass min_failed_prs=1 too, so a test that failed on this PR alone qualifies. Applied before the limit."+ ),repo: zod.string().optional()@@ -93,7 +117,13 @@ export const EngineeringAnalyticsFlakyTestsQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'+ ),+ test: zod+ .string()+ .optional()+ .describe(+ "Optional case-insensitive substring of the test id to keep, e.g. 'test_cohort' or 'posthog\/api\/test\/test_user.py'. Applied before the limit, so a test past the cap is still found."),})@@ -115,7 +145,7 @@ export const EngineeringAnalyticsPrCostQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),})@@ -137,7 +167,7 @@ export const EngineeringAnalyticsPrLifecycleQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),})@@ -178,7 +208,7 @@ export const EngineeringAnalyticsPullRequestsQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),state: zod.enum(['closed', 'merged', 'open'])@@ -215,7 +245,7 @@ export const EngineeringAnalyticsRunFailureLogsQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),})@@ -272,7 +302,7 @@ export const EngineeringAnalyticsTeamCiHealthQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),})@@ -312,7 +342,7 @@ export const EngineeringAnalyticsWorkflowHealthQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),workflow_name: zod.string()@@ -355,7 +385,7 @@ export const EngineeringAnalyticsWorkflowJobsQueryParams = () => zod.object({.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),})@@ -390,7 +420,7 @@ export const EngineeringAnalyticsWorkflowRunnerCostsQueryParams = () => zod.obje.string().optional().describe(- 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.'+ 'Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source that the `sources` list reports as synced, when the team has more than one.'),workflow_name: zod.string().describe('Workflow name to break down cost for.'),})diff --git a/services/mcp/src/tools/generated/engineering_analytics.ts b/services/mcp/src/tools/generated/engineering_analytics.tsindex 214191336646..30d98e49e24b 100644--- a/services/mcp/src/tools/generated/engineering_analytics.ts+++ b/services/mcp/src/tools/generated/engineering_analytics.ts@@ -29,8 +29,10 @@ const engineeringAnalyticsBrokenTests = (): ToolBase<method: 'GET',path: `/api/projects/${encodeURIComponent(String(projectId))}/engineering_analytics/broken_tests/`,query: {+ branch: params.branch,repo: params.repo,source_id: params.source_id,+ test: params.test,},})return result@@ -84,13 +86,16 @@ const engineeringAnalyticsFlakyTests = (): ToolBase<method: 'GET',path: `/api/projects/${encodeURIComponent(String(projectId))}/engineering_analytics/flaky_tests/`,query: {+ branch: params.branch,date_from: params.date_from,date_to: params.date_to,limit: params.limit,min_failed_prs: params.min_failed_prs,+ pr_number: params.pr_number,repo: params.repo,runner: params.runner,source_id: params.source_id,+ test: params.test,},})return await withPostHogUrl(context, result, '/engineering-analytics')