Skip to content

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

refactor(engineering-analytics): name enums through labeled classes (#114390)

Julian Bez69198fda7b58
diff --git a/.agents/skills/improving-drf-endpoints/SKILL.md b/.agents/skills/improving-drf-endpoints/SKILL.md
index 57df8f3be913..abc02a64b2ec 100644
--- a/.agents/skills/improving-drf-endpoints/SKILL.md
+++ b/.agents/skills/improving-drf-endpoints/SKILL.md
@@ -127,6 +127,8 @@ this — just register under `routers.projects` and the middleware handles the a
For products using the facade pattern (e.g., `visual_review`) with `DataclassSerializer` wrapping frozen dataclasses from `contracts.py`:
- Field types are auto-derived from the dataclass — fewer typing issues by design
+- Subclass `LabeledChoicesDataclassSerializer` from `posthog/api/dataclass_serializers.py`, not the library `DataclassSerializer`.
+ The library labels enum choices with member names, so a `LabeledStrEnum` field gets no class-derived OpenAPI name and falls back to the field name.
- Focus on **`help_text`** (dataclass fields don't carry it; add it on the serializer field overrides)
- **`@validated_request`** is already the standard pattern — verify response serializers are declared
- `@extend_schema` tags and descriptions still need to be set on viewset methods
diff --git a/posthog/api/dataclass_serializers.py b/posthog/api/dataclass_serializers.py
new file mode 100644
index 000000000000..5bccba37948f
--- /dev/null
+++ b/posthog/api/dataclass_serializers.py
@@ -0,0 +1,24 @@
+from typing import TypeVar
+
+from django.db.models import Choices
+
+from rest_framework_dataclasses.field_utils import TypeInfo
+from rest_framework_dataclasses.serializers import DataclassSerializer, SerializerFieldDefinition
+from rest_framework_dataclasses.types import Dataclass
+
+from posthog.enums import LabeledEnumType
+
+T = TypeVar("T", bound=Dataclass)
+
+
+# Enum fields carry the class labels, so posthog/openapi/enum_names.py names the OpenAPI enum after
+# the class. The library pairs each value with the member name ("OPEN"), and no class carries that
+# choice set. This is a comment and not a docstring because drf-spectacular copies a class docstring
+# into the component description of every subclass.
+class LabeledChoicesDataclassSerializer(DataclassSerializer[T]):
+ def build_enum_field(self, field_name: str, type_info: TypeInfo) -> SerializerFieldDefinition:
+ field_class, field_kwargs = super().build_enum_field(field_name, type_info)
+ enum_class = type_info.base_type
+ if isinstance(enum_class, LabeledEnumType) or issubclass(enum_class, Choices):
+ field_kwargs["choices"] = enum_class.choices
+ return field_class, field_kwargs
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 8e4c8e0958e4..0e9ea0a13123 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -692,17 +692,9 @@ SPECTACULAR_SETTINGS = {
"ConfidenceTierEnum": ["low", "medium", "high"],
#
# The definition site is a Django-free module, and no field builds these choices from a
- # posthog.enums labeled enum, so no name derives. The engineering_analytics fields go
- # through DataclassSerializer, which pairs each value with the member name, not a label.
- # The signals entries need a member order, or a name without the Enum suffix, that no
- # class derives.
+ # posthog.enums labeled enum, so no name derives. The signals entries need a member order,
+ # or a name without the Enum suffix, that no class derives.
"SignalSourceProductEnum": "products.signals.backend.enums.signal_source_product_choices",
- "EngineeringAnalyticsPRStateEnum": "products.engineering_analytics.backend.facade.contracts.PRState",
- "QuarantineModeEnum": "products.engineering_analytics.backend.facade.contracts.QuarantineMode",
- "CITestRunnerEnum": "products.engineering_analytics.backend.facade.contracts.CITestRunner",
- "PRTimelineSegmentKindEnum": "products.engineering_analytics.backend.facade.contracts.PRTimelineSegmentKind",
- "DeliveryScopeKindEnum": "products.engineering_analytics.backend.facade.contracts.DeliveryScopeKind",
- "FrictionGroupEnum": "products.engineering_analytics.backend.facade.contracts.FrictionGroup",
"TraceNodeKindEnum": "products.ai_observability.backend.facade.contracts.TRACE_NODE_KINDS",
"SignalSourceProduct": "products.signals.backend.enums.SIGNAL_SOURCE_PRODUCT_VALUES",
"SignalSourceType": "products.signals.backend.enums.SIGNAL_SOURCE_TYPE_VALUES",
diff --git a/products/engineering_analytics/backend/facade/contracts.py b/products/engineering_analytics/backend/facade/contracts.py
index 61b781501837..525a8613eb13 100644
--- a/products/engineering_analytics/backend/facade/contracts.py
+++ b/products/engineering_analytics/backend/facade/contracts.py
@@ -23,7 +23,6 @@ intentionally absent until the warehouse data that backs them lands.
from dataclasses import field
from datetime import date, datetime
-from enum import StrEnum
from pydantic.dataclasses import dataclass
@@ -62,10 +61,12 @@ ENGINEERING_ANALYTICS_FEATURE_FLAG = "engineering-analytics"
FRICTION_VIEW_FEATURE_FLAG = "engineering-analytics-friction"
-class CISignalsSyncStatus(StrEnum):
- RUNNING = "running"
- COMPLETED = "completed"
- FAILED = "failed"
+# The default labels would equal the choices of data_warehouse's backfill lifecycle state. Two classes with
+# identical choices get no class-derived OpenAPI name, so these labels must stay distinct.
+class CISignalsSyncStatus(LabeledStrEnum):
+ RUNNING = "running", "Sync Running"
+ COMPLETED = "completed", "Sync Completed"
+ FAILED = "failed", "Sync Failed"
@dataclass(frozen=True)
@@ -96,13 +97,13 @@ class UnknownDoraEnvironmentError(Exception):
self.environments = environments
-class PRState(StrEnum):
+class PRState(LabeledStrEnum):
OPEN = "open"
CLOSED = "closed"
MERGED = "merged"
-class WorkflowConclusion(StrEnum):
+class WorkflowConclusion(LabeledStrEnum):
SUCCESS = "success"
FAILURE = "failure"
CANCELLED = "cancelled"
@@ -111,7 +112,7 @@ class WorkflowConclusion(StrEnum):
NEUTRAL = "neutral"
-class MetricQuality(StrEnum):
+class MetricQuality(LabeledStrEnum):
"""How much to trust a metric, surfaced on a deep-tool return so an
autonomous caller can act on the result without paraphrasing a caveat.
@@ -128,7 +129,7 @@ class MetricQuality(StrEnum):
PARTIAL = "partial"
-class WorkflowHealthRunScope(StrEnum):
+class WorkflowHealthRunScope(LabeledStrEnum):
"""Which population of runs a workflow surface reports on.
- ``all``: every run in the window.
@@ -149,7 +150,7 @@ class WorkflowHealthRunScope(StrEnum):
MERGE_QUEUE = "merge_queue"
-class BrokenTestState(StrEnum):
+class BrokenTestState(LabeledStrEnum):
"""How a live CI-failure fingerprint is behaving right now — the broken-tests classifier's
verdict, ordered by triage urgency (``breaking_master`` on top, ``pr_only`` last). Inferred
from the failure fingerprints and the latest default-branch job status; see
@@ -175,37 +176,37 @@ class BrokenTestState(StrEnum):
NOVEL_BURST = "novel_burst"
POTENTIALLY_RESOLVED = "potentially_resolved"
FLAKY = "flaky"
- PR_ONLY = "pr_only"
+ PR_ONLY = "pr_only", "PR Only"
-class PRLifecycleEventKind(StrEnum):
+class PRLifecycleEventKind(LabeledStrEnum):
OPENED = "opened"
READY_FOR_REVIEW = "ready_for_review"
CONVERTED_TO_DRAFT = "converted_to_draft"
- CI_STARTED = "ci_started"
- CI_FINISHED = "ci_finished"
+ CI_STARTED = "ci_started", "CI Started"
+ CI_FINISHED = "ci_finished", "CI Finished"
MERGED = "merged"
CLOSED = "closed"
-class QuarantineMode(StrEnum):
+class QuarantineMode(LabeledStrEnum):
# "run": the test still executes but cannot fail the suite. "skip": not run at all.
RUN = "run"
SKIP = "skip"
-class CITestRunner(StrEnum):
+class CITestRunner(LabeledStrEnum):
PYTEST = "pytest"
JEST = "jest"
-class QuarantineRunner(StrEnum):
+class QuarantineRunner(LabeledStrEnum):
PYTEST = "pytest"
JEST = "jest"
PLAYWRIGHT = "playwright"
-class QuarantineLifecycle(StrEnum):
+class QuarantineLifecycle(LabeledStrEnum):
"""Where an entry sits relative to its expiry: ``active`` (more than 7 days
left), ``expiring_soon`` (7 days or fewer left), ``in_grace`` (expired up to
7 days ago — inert, but its removal is not yet mandatory), ``overdue``
@@ -218,14 +219,14 @@ class QuarantineLifecycle(StrEnum):
OVERDUE = "overdue"
-class QuarantineSelectorKind(StrEnum):
+class QuarantineSelectorKind(LabeledStrEnum):
PRODUCT = "product"
FILE = "file"
DIRECTORY = "directory"
TEST = "test"
-class QuarantineRequestAction(StrEnum):
+class QuarantineRequestAction(LabeledStrEnum):
"""What a write to the quarantine file does. ``quarantine`` adds (or replaces) an
entry and files a fresh tracking issue; ``extend`` re-stamps an existing entry's
expiry, reusing its issue; ``remove`` deletes the entry. All three open a PR.
@@ -643,7 +644,7 @@ FLAKY_TEST_SIGNAL_CAVEAT = (
)
-class FlakyTestClassification(StrEnum):
+class FlakyTestClassification(LabeledStrEnum):
# One commit both failed and passed the test: a re-run attempt going green, or an in-job retry.
CONFIRMED_FLAKE = "confirmed_flake"
# Only failures recorded, which is absence of proof, not proof of a regression.
@@ -1230,7 +1231,7 @@ class ReadyToMergeBucket:
p50_seconds: float | None
-class DeliveryStage(StrEnum):
+class DeliveryStage(LabeledStrEnum):
"""A pre-merge leg of a PR's path to production, named for the timestamps that bound it.
- ``OPEN_TO_GATE``: ``created_at`` to the PR's first merge-queue gate run starting; review,
@@ -1636,12 +1637,12 @@ class WorkflowJobAggregate:
estimated_cost_usd: float | None
-class DeliveryScopeKind(StrEnum):
+class DeliveryScopeKind(LabeledStrEnum):
"""Which pull requests a delivery read covers. A scope is always exactly one author, one GitHub
team, or one pull request, so no delivery read puts people side by side (SPEC §2)."""
AUTHOR = "author"
- GITHUB_TEAM = "github_team"
+ GITHUB_TEAM = "github_team", "GitHub Team"
PULL_REQUEST = "pull_request"
@@ -1742,7 +1743,7 @@ class DeliverySummary:
lead_time: DeliveryLeadTime
-class ComparisonTeamBasis(StrEnum):
+class ComparisonTeamBasis(LabeledStrEnum):
"""Why a delivery comparison shows the teams it shows. The candidates are the author's GitHub teams
with evidence of owning code (the ownership census or a review request), or every team of an author
without such a team."""
@@ -1793,10 +1794,10 @@ class TeamReadyToMergeMedians:
medians: ReadyToMergeMedians | None
-class FrictionGroup(StrEnum):
+class FrictionGroup(LabeledStrEnum):
"""The kinds of friction an author meets, each a share of the friction score."""
- CI = "ci"
+ CI = "ci", "CI"
REVIEW = "review"
QUEUE = "queue"
REWORK = "rework"
@@ -1928,7 +1929,7 @@ class DeliveryComparison:
pull_request: PullRequestReadyToMerge | None
-class PRTimelineSegmentKind(StrEnum):
+class PRTimelineSegmentKind(LabeledStrEnum):
"""What a pull request was waiting on during one stretch of its timeline. The red variants name
what turned the check green, which is evidence about the cause, not proof of it.
``logic/pr_timeline.py`` defines the precedence."""
@@ -1940,7 +1941,7 @@ class PRTimelineSegmentKind(StrEnum):
# Review state without review data: the stretch is neither CI nor the queue, but who it waits on
# is unknown.
REVIEW_STATE_UNKNOWN = "review_state_unknown"
- CI_RUNNING = "ci_running"
+ CI_RUNNING = "ci_running", "CI Running"
RED_PASSED_ON_RERUN = "red_passed_on_rerun"
RED_MASTER_BROKEN = "red_master_broken"
RED_FIXED_BY_PUSH = "red_fixed_by_push"
diff --git a/products/engineering_analytics/backend/presentation/serializers/_shared.py b/products/engineering_analytics/backend/presentation/serializers/_shared.py
index 3d03e1373fbe..8ce22af395e9 100644
--- a/products/engineering_analytics/backend/presentation/serializers/_shared.py
+++ b/products/engineering_analytics/backend/presentation/serializers/_shared.py
@@ -1,18 +1,11 @@
"""Serializers shared across domain modules, and their own leaves."""
-from rest_framework.fields import ChoiceField
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
-from products.engineering_analytics.backend.facade.contracts import CIEngine, CIFailureLogLine, CIJobFailureLog, RepoRef
+from products.engineering_analytics.backend.facade.contracts import CIFailureLogLine, CIJobFailureLog, RepoRef
-def ci_engine_field() -> ChoiceField:
- return ChoiceField(
- choices=CIEngine.choices, required=False, allow_null=True, help_text="CI execution engine; null when unknown."
- )
-
-
-class RepoRefSerializer(DataclassSerializer):
+class RepoRefSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = RepoRef
extra_kwargs = {
@@ -22,7 +15,7 @@ class RepoRefSerializer(DataclassSerializer):
}
-class CIFailureLogLineSerializer(DataclassSerializer):
+class CIFailureLogLineSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = CIFailureLogLine
extra_kwargs = {
@@ -35,8 +28,7 @@ class CIFailureLogLineSerializer(DataclassSerializer):
}
-class CIJobFailureLogSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
+class CIJobFailureLogSerializer(LabeledChoicesDataclassSerializer):
lines = CIFailureLogLineSerializer(
many=True, help_text="The thinned failure-log lines in original order, with omission markers."
)
@@ -44,6 +36,7 @@ class CIJobFailureLogSerializer(DataclassSerializer):
class Meta:
dataclass = CIJobFailureLog
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"job_id": {"help_text": "Integer job id of the failed job; unique only together with ci_engine."},
"run_id": {"help_text": "Workflow run id the job belongs to."},
"conclusion": {
diff --git a/products/engineering_analytics/backend/presentation/serializers/ci_signals.py b/products/engineering_analytics/backend/presentation/serializers/ci_signals.py
index 4007c0ac5ea2..dfb01aedcec1 100644
--- a/products/engineering_analytics/backend/presentation/serializers/ci_signals.py
+++ b/products/engineering_analytics/backend/presentation/serializers/ci_signals.py
@@ -1,12 +1,13 @@
"""Payloads for the atomic CI Signals configuration endpoint."""
from rest_framework import serializers
-from rest_framework_dataclasses.serializers import DataclassSerializer
+
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import CISignalsConfig
-class CISignalsConfigSerializer(DataclassSerializer):
+class CISignalsConfigSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = CISignalsConfig
extra_kwargs = {
diff --git a/products/engineering_analytics/backend/presentation/serializers/delivery.py b/products/engineering_analytics/backend/presentation/serializers/delivery.py
index bb59dc41839b..eee94cc3f991 100644
--- a/products/engineering_analytics/backend/presentation/serializers/delivery.py
+++ b/products/engineering_analytics/backend/presentation/serializers/delivery.py
@@ -1,7 +1,7 @@
"""Payloads for the delivery reads: a scope's delivery summary, its pull request timelines, and an author's
comparison with their team."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
DeliveryComparison,
@@ -27,7 +27,7 @@ _SCOPE_KIND_HELP = (
)
-class ScopeRepoFigureSerializer(DataclassSerializer):
+class ScopeRepoFigureSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = ScopeRepoFigure
extra_kwargs = {
@@ -47,7 +47,7 @@ def _figure(help_text: str) -> ScopeRepoFigureSerializer:
return ScopeRepoFigureSerializer(help_text=help_text)
-class DurationDistributionSerializer(DataclassSerializer):
+class DurationDistributionSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = DurationDistribution
extra_kwargs = {
@@ -63,7 +63,7 @@ class DurationDistributionSerializer(DataclassSerializer):
}
-class ScopeRepoDistributionSerializer(DataclassSerializer):
+class ScopeRepoDistributionSerializer(LabeledChoicesDataclassSerializer):
scope = DurationDistributionSerializer(help_text="The deployed pull requests in scope.")
repo = DurationDistributionSerializer(help_text="Every deployed pull request in the repository.")
@@ -71,7 +71,7 @@ class ScopeRepoDistributionSerializer(DataclassSerializer):
dataclass = ScopeRepoDistribution
-class DeliveryLeadTimeSerializer(DataclassSerializer):
+class DeliveryLeadTimeSerializer(LabeledChoicesDataclassSerializer):
open_to_deploy = ScopeRepoDistributionSerializer(
help_text="Open to the first successful deploy containing the merge, over PRs deployed in the window."
)
@@ -99,7 +99,7 @@ class DeliveryLeadTimeSerializer(DataclassSerializer):
}
-class DeliverySummarySerializer(DataclassSerializer):
+class DeliverySummarySerializer(LabeledChoicesDataclassSerializer):
cost_per_merged_pr_usd = _figure(
"Median estimated CI cost per merged PR, in USD, over every run linked to the PR (merge-queue gate runs "
"included) that started up to 30 days before the window. Null when the jobs table isn't synced."
@@ -176,7 +176,7 @@ class DeliverySummarySerializer(DataclassSerializer):
}
-class PRTimelineSegmentSerializer(DataclassSerializer):
+class PRTimelineSegmentSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PRTimelineSegment
extra_kwargs = {
@@ -194,7 +194,7 @@ class PRTimelineSegmentSerializer(DataclassSerializer):
}
-class PRTimelinePushSerializer(DataclassSerializer):
+class PRTimelinePushSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PRTimelinePush
extra_kwargs = {
@@ -205,7 +205,7 @@ class PRTimelinePushSerializer(DataclassSerializer):
}
-class PRTimelineRedTimeSerializer(DataclassSerializer):
+class PRTimelineRedTimeSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PRTimelineRedTime
extra_kwargs = {
@@ -214,7 +214,7 @@ class PRTimelineRedTimeSerializer(DataclassSerializer):
}
-class PRTimelineSerializer(DataclassSerializer):
+class PRTimelineSerializer(LabeledChoicesDataclassSerializer):
repo = RepoRefSerializer(help_text="The repository the pull request belongs to.")
pushes = PRTimelinePushSerializer(
many=True,
@@ -252,7 +252,7 @@ class PRTimelineSerializer(DataclassSerializer):
}
-class PullRequestTimelinesSerializer(DataclassSerializer):
+class PullRequestTimelinesSerializer(LabeledChoicesDataclassSerializer):
items = PRTimelineSerializer(
many=True,
help_text="The pull requests in scope, newest first: open PRs plus PRs merged in the window, or the one "
@@ -289,7 +289,7 @@ class PullRequestTimelinesSerializer(DataclassSerializer):
}
-class ReadyToMergeMediansSerializer(DataclassSerializer):
+class ReadyToMergeMediansSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = ReadyToMergeMedians
extra_kwargs = {
@@ -320,7 +320,7 @@ class ReadyToMergeMediansSerializer(DataclassSerializer):
}
-class PullRequestReadyToMergeSerializer(DataclassSerializer):
+class PullRequestReadyToMergeSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PullRequestReadyToMerge
extra_kwargs = {
@@ -344,7 +344,7 @@ class PullRequestReadyToMergeSerializer(DataclassSerializer):
}
-class TeamReadyToMergeMediansSerializer(DataclassSerializer):
+class TeamReadyToMergeMediansSerializer(LabeledChoicesDataclassSerializer):
medians = ReadyToMergeMediansSerializer(
allow_null=True,
help_text="Over the pull requests by the team's members, the same population as a github_team scope, "
@@ -358,7 +358,7 @@ class TeamReadyToMergeMediansSerializer(DataclassSerializer):
extra_kwargs = {"github_team": {"help_text": "The GitHub team slug."}}
-class DeliveryComparisonSerializer(DataclassSerializer):
+class DeliveryComparisonSerializer(LabeledChoicesDataclassSerializer):
author_medians = ReadyToMergeMediansSerializer(
help_text="Over the author's pull requests, without the pr_number pull request."
)
diff --git a/products/engineering_analytics/backend/presentation/serializers/dora.py b/products/engineering_analytics/backend/presentation/serializers/dora.py
index db796f6e6fb3..37d65a62d154 100644
--- a/products/engineering_analytics/backend/presentation/serializers/dora.py
+++ b/products/engineering_analytics/backend/presentation/serializers/dora.py
@@ -1,7 +1,8 @@
"""Payloads for the DORA deploy-metrics read."""
from rest_framework import serializers
-from rest_framework_dataclasses.serializers import DataclassSerializer
+
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
DeploymentFrequencyBucket,
@@ -20,7 +21,7 @@ class DoraEnvironmentQuerySerializer(serializers.Serializer):
)
-class DeploymentFrequencyBucketSerializer(DataclassSerializer):
+class DeploymentFrequencyBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = DeploymentFrequencyBucket
extra_kwargs = {
@@ -34,7 +35,7 @@ class DeploymentFrequencyBucketSerializer(DataclassSerializer):
}
-class LeadTimeBucketSerializer(DataclassSerializer):
+class LeadTimeBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = LeadTimeBucket
extra_kwargs = {
@@ -84,7 +85,7 @@ class LeadTimeBucketSerializer(DataclassSerializer):
}
-class DoraOverviewSerializer(DataclassSerializer):
+class DoraOverviewSerializer(LabeledChoicesDataclassSerializer):
deployment_frequency_series = DeploymentFrequencyBucketSerializer(
many=True,
help_text="Successful deployments per bucket across the window, oldest first, zero-filled, "
diff --git a/products/engineering_analytics/backend/presentation/serializers/friction.py b/products/engineering_analytics/backend/presentation/serializers/friction.py
index 42d6fb86fe7a..70e3ea00c23d 100644
--- a/products/engineering_analytics/backend/presentation/serializers/friction.py
+++ b/products/engineering_analytics/backend/presentation/serializers/friction.py
@@ -1,6 +1,6 @@
"""Payloads for the friction read: every author's friction as a multiple of the typical author."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
AuthorFriction,
@@ -14,7 +14,7 @@ from products.engineering_analytics.backend.facade.contracts import (
)
-class FrictionGroupShareSerializer(DataclassSerializer):
+class FrictionGroupShareSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = FrictionGroupShare
extra_kwargs = {
@@ -26,7 +26,7 @@ class FrictionGroupShareSerializer(DataclassSerializer):
}
-class AuthorFrictionSerializer(DataclassSerializer):
+class AuthorFrictionSerializer(LabeledChoicesDataclassSerializer):
groups = FrictionGroupShareSerializer(many=True, help_text="The score split by the kind of friction.")
class Meta:
@@ -52,7 +52,7 @@ class AuthorFrictionSerializer(DataclassSerializer):
}
-class TeamFrictionSerializer(DataclassSerializer):
+class TeamFrictionSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TeamFriction
extra_kwargs = {
@@ -65,7 +65,7 @@ class TeamFrictionSerializer(DataclassSerializer):
}
-class PullRequestFrictionItemSerializer(DataclassSerializer):
+class PullRequestFrictionItemSerializer(LabeledChoicesDataclassSerializer):
groups = FrictionGroupShareSerializer(many=True, help_text="The pull request's friction split by kind.")
class Meta:
@@ -79,7 +79,7 @@ class PullRequestFrictionItemSerializer(DataclassSerializer):
}
-class AuthorFrictionListSerializer(DataclassSerializer):
+class AuthorFrictionListSerializer(LabeledChoicesDataclassSerializer):
items = AuthorFrictionSerializer(many=True, help_text="Authors by friction, most first.")
teams = TeamFrictionSerializer(
many=True, help_text="Teams with at least 3 scored members, by median member friction, most first."
@@ -104,7 +104,7 @@ class AuthorFrictionListSerializer(DataclassSerializer):
}
-class AuthorFrictionDetailSerializer(DataclassSerializer):
+class AuthorFrictionDetailSerializer(LabeledChoicesDataclassSerializer):
author = AuthorFrictionSerializer(
allow_null=True, help_text="The author's score and rank. Null below 3 merged pull requests in the window."
)
@@ -130,7 +130,7 @@ class AuthorFrictionDetailSerializer(DataclassSerializer):
}
-class PullRequestFrictionBreakdownSerializer(DataclassSerializer):
+class PullRequestFrictionBreakdownSerializer(LabeledChoicesDataclassSerializer):
groups = FrictionGroupShareSerializer(many=True, help_text="The pull request's friction split by kind.")
class Meta:
@@ -155,7 +155,7 @@ class PullRequestFrictionBreakdownSerializer(DataclassSerializer):
}
-class PullRequestFrictionDetailSerializer(DataclassSerializer):
+class PullRequestFrictionDetailSerializer(LabeledChoicesDataclassSerializer):
pull_request = PullRequestFrictionBreakdownSerializer(
allow_null=True,
help_text="Null when the pull request did not merge in the window, or a bot authored it.",
diff --git a/products/engineering_analytics/backend/presentation/serializers/pull_requests.py b/products/engineering_analytics/backend/presentation/serializers/pull_requests.py
index f0f1d9738074..6974dc635786 100644
--- a/products/engineering_analytics/backend/presentation/serializers/pull_requests.py
+++ b/products/engineering_analytics/backend/presentation/serializers/pull_requests.py
@@ -1,6 +1,6 @@
"""Payloads for PR-scoped reads: backlog cards, lists, lifecycle, logs, and cost."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
AttentionPullRequestList,
@@ -23,11 +23,10 @@ from products.engineering_analytics.backend.facade.contracts import (
from products.engineering_analytics.backend.presentation.serializers._shared import (
CIJobFailureLogSerializer,
RepoRefSerializer,
- ci_engine_field,
)
-class AuthorSerializer(DataclassSerializer):
+class AuthorSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = Author
extra_kwargs = {
@@ -38,7 +37,7 @@ class AuthorSerializer(DataclassSerializer):
}
-class PullRequestSerializer(DataclassSerializer):
+class PullRequestSerializer(LabeledChoicesDataclassSerializer):
author = AuthorSerializer(help_text="The pull request author.")
repo = RepoRefSerializer(help_text="Repository the pull request belongs to.")
@@ -56,12 +55,11 @@ class PullRequestSerializer(DataclassSerializer):
}
-class PRLifecycleEventSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
-
+class PRLifecycleEventSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PRLifecycleEvent
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"kind": {
"help_text": "Event kind: opened, ready_for_review, converted_to_draft, ci_started, "
"ci_finished, merged, or closed."
@@ -79,7 +77,7 @@ class PRLifecycleEventSerializer(DataclassSerializer):
}
-class PRLifecycleSerializer(DataclassSerializer):
+class PRLifecycleSerializer(LabeledChoicesDataclassSerializer):
pull_request = PullRequestSerializer(help_text="The pull request header.")
events = PRLifecycleEventSerializer(many=True, help_text="Lifecycle events ordered by time.")
@@ -92,7 +90,7 @@ class PRLifecycleSerializer(DataclassSerializer):
}
-class CIFailureLogsSerializer(DataclassSerializer):
+class CIFailureLogsSerializer(LabeledChoicesDataclassSerializer):
repo = RepoRefSerializer(help_text="Repository the pull request belongs to.")
jobs = CIJobFailureLogSerializer(
many=True, help_text="Failed CI jobs with their thinned failure logs, grouped by job."
@@ -113,7 +111,7 @@ class CIFailureLogsSerializer(DataclassSerializer):
}
-class WorkflowCostSerializer(DataclassSerializer):
+class WorkflowCostSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = WorkflowCost
extra_kwargs = {
@@ -129,12 +127,11 @@ class WorkflowCostSerializer(DataclassSerializer):
}
-class RunCostSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
-
+class RunCostSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = RunCost
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"run_id": {"help_text": "Integer run id this cost is for; unique only together with ci_engine."},
"run_attempt": {"help_text": "Re-run attempt number; 1 for the first attempt."},
"billable_minutes": {"help_text": "Billable (self-hosted) minutes for this run attempt."},
@@ -145,7 +142,7 @@ class RunCostSerializer(DataclassSerializer):
}
-class PRLLMSpendSerializer(DataclassSerializer):
+class PRLLMSpendSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PRLLMSpend
extra_kwargs = {
@@ -161,7 +158,7 @@ class PRLLMSpendSerializer(DataclassSerializer):
}
-class PRCostSummarySerializer(DataclassSerializer):
+class PRCostSummarySerializer(LabeledChoicesDataclassSerializer):
by_workflow = WorkflowCostSerializer(many=True, help_text="Same spend broken down per workflow.")
by_run = RunCostSerializer(
many=True, help_text="Same spend broken down per workflow run, keyed by (run_id, run_attempt)."
@@ -200,7 +197,7 @@ class PRCostSummarySerializer(DataclassSerializer):
}
-class CIStatusRollupSerializer(DataclassSerializer):
+class CIStatusRollupSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = CIStatusRollup
extra_kwargs = {
@@ -220,7 +217,7 @@ class CIStatusRollupSerializer(DataclassSerializer):
}
-class PushCISampleSerializer(DataclassSerializer):
+class PushCISampleSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PushCISample
extra_kwargs = {
@@ -238,7 +235,7 @@ class PushCISampleSerializer(DataclassSerializer):
}
-class PullRequestListItemSerializer(DataclassSerializer):
+class PullRequestListItemSerializer(LabeledChoicesDataclassSerializer):
author = AuthorSerializer(help_text="The pull request author.")
repo = RepoRefSerializer(help_text="Repository the pull request belongs to.")
ci = CIStatusRollupSerializer(help_text="CI status from the latest workflow runs on the head SHA.")
@@ -290,7 +287,7 @@ class PullRequestListItemSerializer(DataclassSerializer):
}
-class PullRequestListSerializer(DataclassSerializer):
+class PullRequestListSerializer(LabeledChoicesDataclassSerializer):
items = PullRequestListItemSerializer(
many=True, help_text="This page of pull requests, newest first, capped at `limit`."
)
@@ -306,7 +303,7 @@ class PullRequestListSerializer(DataclassSerializer):
}
-class AttentionPullRequestListSerializer(DataclassSerializer):
+class AttentionPullRequestListSerializer(LabeledChoicesDataclassSerializer):
items = PullRequestListItemSerializer(
many=True, help_text="Open pull requests needing attention, failing CI first, then newest, capped at `limit`."
)
@@ -321,7 +318,7 @@ class AttentionPullRequestListSerializer(DataclassSerializer):
}
-class BranchPRMatchSerializer(DataclassSerializer):
+class BranchPRMatchSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = BranchPRMatch
extra_kwargs = {
@@ -338,7 +335,7 @@ class BranchPRMatchSerializer(DataclassSerializer):
}
-class CICardSummarySerializer(DataclassSerializer):
+class CICardSummarySerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = CICardSummary
extra_kwargs = {
diff --git a/products/engineering_analytics/backend/presentation/serializers/sources.py b/products/engineering_analytics/backend/presentation/serializers/sources.py
index 785a19ff4ba1..753364685d2c 100644
--- a/products/engineering_analytics/backend/presentation/serializers/sources.py
+++ b/products/engineering_analytics/backend/presentation/serializers/sources.py
@@ -1,11 +1,11 @@
"""Payload for the GitHub source/repo picker."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import GitHubSource
-class GitHubSourceSerializer(DataclassSerializer):
+class GitHubSourceSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = GitHubSource
extra_kwargs = {
diff --git a/products/engineering_analytics/backend/presentation/serializers/suite_health.py b/products/engineering_analytics/backend/presentation/serializers/suite_health.py
index 7bf1537b9e34..ef4725c94c1b 100644
--- a/products/engineering_analytics/backend/presentation/serializers/suite_health.py
+++ b/products/engineering_analytics/backend/presentation/serializers/suite_health.py
@@ -1,6 +1,6 @@
"""Payloads for test-health reads and the quarantine sidecar."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
BrokenTestRow,
@@ -15,10 +15,10 @@ from products.engineering_analytics.backend.facade.contracts import (
TrunkQuarantinedTest,
TrunkQuarantineTeamDebt,
)
-from products.engineering_analytics.backend.presentation.serializers._shared import RepoRefSerializer, ci_engine_field
+from products.engineering_analytics.backend.presentation.serializers._shared import RepoRefSerializer
-class FlakyTestItemSerializer(DataclassSerializer):
+class FlakyTestItemSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = FlakyTestItem
extra_kwargs = {
@@ -65,7 +65,7 @@ class FlakyTestItemSerializer(DataclassSerializer):
}
-class TrunkQuarantinedTestSerializer(DataclassSerializer):
+class TrunkQuarantinedTestSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TrunkQuarantinedTest
extra_kwargs = {
@@ -95,7 +95,7 @@ class TrunkQuarantinedTestSerializer(DataclassSerializer):
}
-class TrunkQuarantineTeamDebtSerializer(DataclassSerializer):
+class TrunkQuarantineTeamDebtSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TrunkQuarantineTeamDebt
extra_kwargs = {
@@ -106,7 +106,7 @@ class TrunkQuarantineTeamDebtSerializer(DataclassSerializer):
}
-class TrunkQuarantineDebtSerializer(DataclassSerializer):
+class TrunkQuarantineDebtSerializer(LabeledChoicesDataclassSerializer):
teams = TrunkQuarantineTeamDebtSerializer(
many=True,
help_text="Per-team rollup, most indebted first: overdue count, then test count, then oldest age.",
@@ -142,7 +142,7 @@ class TrunkQuarantineDebtSerializer(DataclassSerializer):
}
-class FlakyTestListSerializer(DataclassSerializer):
+class FlakyTestListSerializer(LabeledChoicesDataclassSerializer):
items = FlakyTestItemSerializer(
many=True,
help_text="Tests worth acting on now, ranked by blast radius: master failures, then PRs hit, then runs. "
@@ -161,12 +161,11 @@ class FlakyTestListSerializer(DataclassSerializer):
}
-class BrokenTestRowSerializer(DataclassSerializer):
- latest_ci_engine = ci_engine_field()
-
+class BrokenTestRowSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = BrokenTestRow
extra_kwargs = {
+ "latest_ci_engine": {"help_text": "CI execution engine; null when unknown."},
"fingerprint": {
"help_text": "Stable identity of this distinct failure: the failing test's node id plus a "
"normalized error signature, so the same failure across runs groups into one row.",
@@ -211,7 +210,7 @@ class BrokenTestRowSerializer(DataclassSerializer):
}
-class BrokenTestsResultSerializer(DataclassSerializer):
+class BrokenTestsResultSerializer(LabeledChoicesDataclassSerializer):
rows = BrokenTestRowSerializer(
many=True,
help_text="Classified failures ranked by triage urgency: breaking trunk first, single-PR failures last.",
@@ -232,7 +231,7 @@ class BrokenTestsResultSerializer(DataclassSerializer):
}
-class QuarantineEntrySerializer(DataclassSerializer):
+class QuarantineEntrySerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = QuarantineEntry
extra_kwargs = {
@@ -260,7 +259,7 @@ class QuarantineEntrySerializer(DataclassSerializer):
}
-class QuarantineFileSerializer(DataclassSerializer):
+class QuarantineFileSerializer(LabeledChoicesDataclassSerializer):
entries = QuarantineEntrySerializer(
many=True,
help_text="Quarantined selectors, most urgent first (overdue, in_grace, expiring_soon, active), "
@@ -290,7 +289,7 @@ class QuarantineFileSerializer(DataclassSerializer):
}
-class QuarantineRequestSerializer(DataclassSerializer):
+class QuarantineRequestSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = QuarantineRequest
extra_kwargs = {
@@ -348,7 +347,7 @@ class QuarantineRequestSerializer(DataclassSerializer):
}
-class QuarantineRequestResultSerializer(DataclassSerializer):
+class QuarantineRequestResultSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = QuarantineRequestResult
extra_kwargs = {
diff --git a/products/engineering_analytics/backend/presentation/serializers/teams.py b/products/engineering_analytics/backend/presentation/serializers/teams.py
index aab8b54f7aa1..33629dc63798 100644
--- a/products/engineering_analytics/backend/presentation/serializers/teams.py
+++ b/products/engineering_analytics/backend/presentation/serializers/teams.py
@@ -1,6 +1,6 @@
"""Payloads for team-level rollups: CI health, activity, and merge trend."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
TeamCIActivity,
@@ -12,7 +12,7 @@ from products.engineering_analytics.backend.facade.contracts import (
)
-class TeamCIHealthItemSerializer(DataclassSerializer):
+class TeamCIHealthItemSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TeamCIHealthItem
extra_kwargs = {
@@ -68,7 +68,7 @@ class TeamCIHealthItemSerializer(DataclassSerializer):
}
-class TeamCIHealthListSerializer(DataclassSerializer):
+class TeamCIHealthListSerializer(LabeledChoicesDataclassSerializer):
items = TeamCIHealthItemSerializer(
many=True,
help_text="Owning teams ranked by current flaky + failure signal, heaviest first, capped at `limit`. "
@@ -86,7 +86,7 @@ class TeamCIHealthListSerializer(DataclassSerializer):
}
-class TeamTestSignalSerializer(DataclassSerializer):
+class TeamTestSignalSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TeamTestSignal
extra_kwargs = {
@@ -104,7 +104,7 @@ class TeamTestSignalSerializer(DataclassSerializer):
}
-class TeamCIActivitySerializer(DataclassSerializer):
+class TeamCIActivitySerializer(LabeledChoicesDataclassSerializer):
tests = TeamTestSignalSerializer(
many=True,
help_text="The team's owned tests with signal in either window, ranked by the stronger window's count "
@@ -119,7 +119,7 @@ class TeamCIActivitySerializer(DataclassSerializer):
}
-class TeamMergeTrendPointSerializer(DataclassSerializer):
+class TeamMergeTrendPointSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TeamMergeTrendPoint
extra_kwargs = {
@@ -136,7 +136,7 @@ class TeamMergeTrendPointSerializer(DataclassSerializer):
}
-class TeamMergeTrendSerializer(DataclassSerializer):
+class TeamMergeTrendSerializer(LabeledChoicesDataclassSerializer):
points = TeamMergeTrendPointSerializer(
many=True,
help_text="Daily median and average open→merge over the PRs this team's members merged, ascending "
diff --git a/products/engineering_analytics/backend/presentation/serializers/workflows.py b/products/engineering_analytics/backend/presentation/serializers/workflows.py
index 29957ed5ac72..56db700dfcba 100644
--- a/products/engineering_analytics/backend/presentation/serializers/workflows.py
+++ b/products/engineering_analytics/backend/presentation/serializers/workflows.py
@@ -1,6 +1,6 @@
"""Payloads for workflow/run/job-scoped reads: health, activity, jobs, costs, and master state."""
-from rest_framework_dataclasses.serializers import DataclassSerializer
+from posthog.api.dataclass_serializers import LabeledChoicesDataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
CostPerMergeBucket,
@@ -26,17 +26,16 @@ from products.engineering_analytics.backend.facade.contracts import (
from products.engineering_analytics.backend.presentation.serializers._shared import (
CIJobFailureLogSerializer,
RepoRefSerializer,
- ci_engine_field,
)
-class WorkflowRunDetailSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
+class WorkflowRunDetailSerializer(LabeledChoicesDataclassSerializer):
repo = RepoRefSerializer(help_text="Repository the run belongs to.")
class Meta:
dataclass = WorkflowRunDetail
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"native_workflow_run_id": {"help_text": "Source-native workflow run id; use with ci_engine for identity."},
"native_run_id": {"help_text": "Source-native run id; use with ci_engine for identity."},
"id": {"help_text": "Integer run id; unique only together with ci_engine."},
@@ -80,12 +79,11 @@ class WorkflowRunDetailSerializer(DataclassSerializer):
}
-class WorkflowRunActivityPointSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
-
+class WorkflowRunActivityPointSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = WorkflowRunActivityPoint
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"run_id": {"help_text": "Integer run id; unique only together with ci_engine."},
"conclusion": {
"help_text": "Run conclusion ('success', 'failure', 'timed_out', 'cancelled', 'skipped', ...), "
@@ -106,7 +104,7 @@ class WorkflowRunActivityPointSerializer(DataclassSerializer):
}
-class WorkflowRunActivitySerializer(DataclassSerializer):
+class WorkflowRunActivitySerializer(LabeledChoicesDataclassSerializer):
points = WorkflowRunActivityPointSerializer(
many=True, help_text="Per-run chart points, newest first, capped at `limit`."
)
@@ -122,12 +120,11 @@ class WorkflowRunActivitySerializer(DataclassSerializer):
}
-class WorkflowJobSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
-
+class WorkflowJobSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = WorkflowJob
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"native_attempt_id": {"help_text": "Source-native attempt id; use with ci_engine for identity."},
"native_job_id": {"help_text": "Source-native job id; use with ci_engine for identity."},
"native_workflow_run_id": {"help_text": "Source-native workflow run id; use with ci_engine for identity."},
@@ -161,7 +158,7 @@ class WorkflowJobSerializer(DataclassSerializer):
}
-class WorkflowRunnerCostSerializer(DataclassSerializer):
+class WorkflowRunnerCostSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = WorkflowRunnerCost
extra_kwargs = {
@@ -176,7 +173,7 @@ class WorkflowRunnerCostSerializer(DataclassSerializer):
}
-class WorkflowHealthBucketSerializer(DataclassSerializer):
+class WorkflowHealthBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = WorkflowHealthBucket
extra_kwargs = {
@@ -193,8 +190,7 @@ class WorkflowHealthBucketSerializer(DataclassSerializer):
}
-class WorkflowHealthItemSerializer(DataclassSerializer):
- latest_ci_engine = ci_engine_field()
+class WorkflowHealthItemSerializer(LabeledChoicesDataclassSerializer):
repo = RepoRefSerializer(help_text="Repository the workflow runs in.")
buckets = WorkflowHealthBucketSerializer(
many=True, help_text="Run history across the whole window, oldest first, zero-filled, bucketed by granularity."
@@ -203,6 +199,7 @@ class WorkflowHealthItemSerializer(DataclassSerializer):
class Meta:
dataclass = WorkflowHealthItem
extra_kwargs = {
+ "latest_ci_engine": {"help_text": "CI execution engine; null when unknown."},
"workflow_name": {"help_text": "GitHub Actions workflow name."},
"run_count": {"help_text": "Total runs started in the window."},
"successful_run_count": {"help_text": "Completed runs with conclusion 'success'."},
@@ -277,7 +274,7 @@ class WorkflowHealthItemSerializer(DataclassSerializer):
}
-class CostPerMergeBucketSerializer(DataclassSerializer):
+class CostPerMergeBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = CostPerMergeBucket
extra_kwargs = {
@@ -299,7 +296,7 @@ class CostPerMergeBucketSerializer(DataclassSerializer):
}
-class TimeToGreenBucketSerializer(DataclassSerializer):
+class TimeToGreenBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = TimeToGreenBucket
extra_kwargs = {
@@ -316,7 +313,7 @@ class TimeToGreenBucketSerializer(DataclassSerializer):
}
-class PassRateBucketSerializer(DataclassSerializer):
+class PassRateBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = PassRateBucket
extra_kwargs = {
@@ -332,7 +329,7 @@ class PassRateBucketSerializer(DataclassSerializer):
}
-class OpenToMergeBucketSerializer(DataclassSerializer):
+class OpenToMergeBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = OpenToMergeBucket
extra_kwargs = {
@@ -347,7 +344,7 @@ class OpenToMergeBucketSerializer(DataclassSerializer):
}
-class ReadyToMergeBucketSerializer(DataclassSerializer):
+class ReadyToMergeBucketSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = ReadyToMergeBucket
extra_kwargs = {
@@ -363,7 +360,7 @@ class ReadyToMergeBucketSerializer(DataclassSerializer):
}
-class DeliveryStageTimingSerializer(DataclassSerializer):
+class DeliveryStageTimingSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = DeliveryStageTiming
extra_kwargs = {
@@ -389,7 +386,7 @@ class DeliveryStageTimingSerializer(DataclassSerializer):
}
-class DeliveryPipelineSerializer(DataclassSerializer):
+class DeliveryPipelineSerializer(LabeledChoicesDataclassSerializer):
stages = DeliveryStageTimingSerializer(
many=True,
help_text="The legs, ordered open to merge. A leg with nothing observed still appears, "
@@ -407,7 +404,7 @@ class DeliveryPipelineSerializer(DataclassSerializer):
}
-class RepoOverviewSerializer(DataclassSerializer):
+class RepoOverviewSerializer(LabeledChoicesDataclassSerializer):
cost_series = CostPerMergeBucketSerializer(
many=True,
help_text="CI cost per merged PR across the window, oldest first, zero-filled, bucketed by "
@@ -649,7 +646,7 @@ class RepoOverviewSerializer(DataclassSerializer):
}
-class CurrentBranchHealthSerializer(DataclassSerializer):
+class CurrentBranchHealthSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = CurrentBranchHealth
extra_kwargs = {
@@ -667,13 +664,13 @@ class CurrentBranchHealthSerializer(DataclassSerializer):
}
-class MasterFailureGroupSerializer(DataclassSerializer):
- latest_ci_engine = ci_engine_field()
+class MasterFailureGroupSerializer(LabeledChoicesDataclassSerializer):
repo = RepoRefSerializer(help_text="Repository the failures occurred in.")
class Meta:
dataclass = MasterFailureGroup
extra_kwargs = {
+ "latest_ci_engine": {"help_text": "CI execution engine; null when unknown."},
"workflow_name": {"help_text": "GitHub Actions workflow name the failing runs belong to."},
"failed_job": {
"help_text": "De-sharded failing job name (matrix '(G/N)' suffix stripped): the group's failure "
@@ -687,8 +684,7 @@ class MasterFailureGroupSerializer(DataclassSerializer):
}
-class RunFailureLogsSerializer(DataclassSerializer):
- ci_engine = ci_engine_field()
+class RunFailureLogsSerializer(LabeledChoicesDataclassSerializer):
jobs = CIJobFailureLogSerializer(
many=True, help_text="Failed CI jobs of this run with their thinned failure logs, grouped by job."
)
@@ -696,6 +692,7 @@ class RunFailureLogsSerializer(DataclassSerializer):
class Meta:
dataclass = RunFailureLogs
extra_kwargs = {
+ "ci_engine": {"help_text": "CI execution engine; null when unknown."},
"run_id": {"help_text": "Workflow run id the failure logs are for."},
"logs_available": {
"help_text": "False when no failure logs were found: the run didn't fail, or its logs aged out of "
@@ -705,7 +702,7 @@ class RunFailureLogsSerializer(DataclassSerializer):
}
-class WorkflowJobAggregateSerializer(DataclassSerializer):
+class WorkflowJobAggregateSerializer(LabeledChoicesDataclassSerializer):
class Meta:
dataclass = WorkflowJobAggregate
extra_kwargs = {
diff --git a/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx b/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx
index 6d282c4e5900..68f5ad1b536f 100644
--- a/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx
+++ b/products/engineering_analytics/frontend/components/DeliveryPipeline.tsx
@@ -3,7 +3,7 @@
import { LemonCard, LemonSkeleton, Tooltip } from '@posthog/lemon-ui'
import type { DeliveryPipelineApi, DeliveryStageTimingApi } from '../generated/api.schemas'
-import { DeliveryStageTimingStageEnumApi } from '../generated/api.schemas'
+import { DeliveryStageEnumApi } from '../generated/api.schemas'
import { compactAgeLabel, compactCount } from '../lib/format'
import { ShareRow } from './ShareRow'
@@ -14,13 +14,13 @@ interface LegCopy {
}
const LEG_COPY: Record<DeliveryStageTimingApi['stage'], LegCopy> = {
- [DeliveryStageTimingStageEnumApi.OpenToGate]: {
+ [DeliveryStageEnumApi.OpenToGate]: {
label: 'Open to merge queue',
sub: 'Review, changes, and waiting for a slot',
tooltip:
'From the PR opening to its first merge queue gate run starting. Nothing records when a PR joined the queue, so this is the earliest queue activity we can see and everything before it is folded in.',
},
- [DeliveryStageTimingStageEnumApi.GateToMerge]: {
+ [DeliveryStageEnumApi.GateToMerge]: {
label: 'In the merge queue',
sub: 'Gate runs until the PR merges',
tooltip: 'From the first gate run starting to the PR merging. Retried attempts are included.',
diff --git a/products/engineering_analytics/frontend/generated/api.schemas.ts b/products/engineering_analytics/frontend/generated/api.schemas.ts
index f1f3ee25ac7b..178959d894e8 100644
--- a/products/engineering_analytics/frontend/generated/api.schemas.ts
+++ b/products/engineering_analytics/frontend/generated/api.schemas.ts
@@ -59,14 +59,13 @@ export interface PushCISampleApi {
}
/**
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged
*/
-export type EngineeringAnalyticsPRStateEnumApi =
- (typeof EngineeringAnalyticsPRStateEnumApi)[keyof typeof EngineeringAnalyticsPRStateEnumApi]
+export type PRStateEnumApi = (typeof PRStateEnumApi)[keyof typeof PRStateEnumApi]
-export const EngineeringAnalyticsPRStateEnumApi = {
+export const PRStateEnumApi = {
Open: 'open',
Closed: 'closed',
Merged: 'merged',
@@ -87,10 +86,10 @@ export interface PullRequestListItemApi {
title: string
/** Derived state: 'open', 'closed', or 'merged'.
*
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED */
- state: EngineeringAnalyticsPRStateEnumApi
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged */
+ state: PRStateEnumApi
/** True if the pull request is a draft. */
is_draft: boolean
/** When the pull request was opened. */
@@ -139,9 +138,9 @@ export interface AttentionPullRequestListApi {
/**
* * `ci` - CI
- * * `review` - REVIEW
- * * `queue` - QUEUE
- * * `rework` - REWORK
+ * * `review` - Review
+ * * `queue` - Queue
+ * * `rework` - Rework
*/
export type FrictionGroupEnumApi = (typeof FrictionGroupEnumApi)[keyof typeof FrictionGroupEnumApi]
@@ -156,9 +155,9 @@ export interface FrictionGroupShareApi {
/** ci (red CI and CI waits), review (waiting for the first approval), queue (merge-queue time and kickouts), or rework (own failures and extra pushes).
*
* * `ci` - CI
- * * `review` - REVIEW
- * * `queue` - QUEUE
- * * `rework` - REWORK */
+ * * `review` - Review
+ * * `queue` - Queue
+ * * `rework` - Rework */
group: FrictionGroupEnumApi
/** This group's part of the score, in the same 'x typical' unit. The parts add up. */
score: number
@@ -267,27 +266,16 @@ export interface WorkflowCostApi {
}
/**
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI
+ * * `breaking_master` - Breaking Master
+ * * `blocking_merge_queue` - Blocking Merge Queue
+ * * `novel_burst` - Novel Burst
+ * * `potentially_resolved` - Potentially Resolved
+ * * `flaky` - Flaky
+ * * `pr_only` - PR Only
*/
-export type CIEngineEnumApi = (typeof CIEngineEnumApi)[keyof typeof CIEngineEnumApi]
-
-export const CIEngineEnumApi = {
- GithubActions: 'github_actions',
- DepotCi: 'depot_ci',
-} as const
+export type BrokenTestStateEnumApi = (typeof BrokenTestStateEnumApi)[keyof typeof BrokenTestStateEnumApi]
-/**
- * * `breaking_master` - BREAKING_MASTER
- * * `blocking_merge_queue` - BLOCKING_MERGE_QUEUE
- * * `novel_burst` - NOVEL_BURST
- * * `potentially_resolved` - POTENTIALLY_RESOLVED
- * * `flaky` - FLAKY
- * * `pr_only` - PR_ONLY
- */
-export type BrokenTestRowStateEnumApi = (typeof BrokenTestRowStateEnumApi)[keyof typeof BrokenTestRowStateEnumApi]
-
-export const BrokenTestRowStateEnumApi = {
+export const BrokenTestStateEnumApi = {
BreakingMaster: 'breaking_master',
BlockingMergeQueue: 'blocking_merge_queue',
NovelBurst: 'novel_burst',
@@ -296,12 +284,18 @@ export const BrokenTestRowStateEnumApi = {
PrOnly: 'pr_only',
} as const
+/**
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI
+ */
+export type CIEngineEnumApi = (typeof CIEngineEnumApi)[keyof typeof CIEngineEnumApi]
+
+export const CIEngineEnumApi = {
+ GithubActions: 'github_actions',
+ DepotCi: 'depot_ci',
+} as const
+
export interface BrokenTestRowApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- latest_ci_engine?: CIEngineEnumApi | null
/** Stable identity of this distinct failure: the failing test's node id plus a normalized error signature, so the same failure across runs groups into one row. */
fingerprint: string
/** The pytest node id from the CI 'FAILED <id>' line: the failing test. */
@@ -314,13 +308,13 @@ export interface BrokenTestRowApi {
repo: string
/** The classifier's verdict on how this failure is behaving right now: 'breaking_master' (failing on trunk, latest trunk run still red), 'blocking_merge_queue' (stopped a merge on a commit that already passed the PR's own CI, trunk still green), 'novel_burst' (new within a day and spreading across branches, not on trunk yet), 'potentially_resolved' (hit trunk but trunk is green again), 'flaky' (sporadic across branches over more than a day), or 'pr_only' (confined to one branch: one PR's own problem).
*
- * * `breaking_master` - BREAKING_MASTER
- * * `blocking_merge_queue` - BLOCKING_MERGE_QUEUE
- * * `novel_burst` - NOVEL_BURST
- * * `potentially_resolved` - POTENTIALLY_RESOLVED
- * * `flaky` - FLAKY
- * * `pr_only` - PR_ONLY */
- state: BrokenTestRowStateEnumApi
+ * * `breaking_master` - Breaking Master
+ * * `blocking_merge_queue` - Blocking Merge Queue
+ * * `novel_burst` - Novel Burst
+ * * `potentially_resolved` - Potentially Resolved
+ * * `flaky` - Flaky
+ * * `pr_only` - PR Only */
+ state: BrokenTestStateEnumApi
/** Earliest failure line for this fingerprint in the analysis window. */
first_seen: string
/** Most recent failure line for this fingerprint in the analysis window. */
@@ -337,6 +331,11 @@ export interface BrokenTestRowApi {
latest_branch: string
/** Hourly failure counts over the last 24 hours, oldest first (fixed 24-slot array), for the row sparkline. All zeros when nothing failed in the last day. */
trend_24h?: number[]
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ latest_ci_engine?: CIEngineEnumApi | null
}
export interface BrokenTestsResultApi {
@@ -353,13 +352,13 @@ export interface BrokenTestsResultApi {
}
/**
- * * `running` - RUNNING
- * * `completed` - COMPLETED
- * * `failed` - FAILED
+ * * `running` - Sync Running
+ * * `completed` - Sync Completed
+ * * `failed` - Sync Failed
*/
-export type SyncStatusEnumApi = (typeof SyncStatusEnumApi)[keyof typeof SyncStatusEnumApi]
+export type CISignalsSyncStatusEnumApi = (typeof CISignalsSyncStatusEnumApi)[keyof typeof CISignalsSyncStatusEnumApi]
-export const SyncStatusEnumApi = {
+export const CISignalsSyncStatusEnumApi = {
Running: 'running',
Completed: 'completed',
Failed: 'failed',
@@ -372,10 +371,10 @@ export interface CISignalsConfigApi {
enabled: boolean
/** Aggregate sync status for pull requests, workflow runs, and workflow jobs.
*
- * * `running` - RUNNING
- * * `completed` - COMPLETED
- * * `failed` - FAILED */
- sync_status: SyncStatusEnumApi | null
+ * * `running` - Sync Running
+ * * `completed` - Sync Completed
+ * * `failed` - Sync Failed */
+ sync_status: CISignalsSyncStatusEnumApi | null
}
export interface CISignalsConfigUpdateApi {
@@ -405,11 +404,6 @@ export interface CIFailureLogLineApi {
}
export interface CIJobFailureLogApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
/** The thinned failure-log lines in original order, with omission markers. */
lines: CIFailureLogLineApi[]
/** Integer job id of the failed job; unique only together with ci_engine. */
@@ -426,6 +420,11 @@ export interface CIJobFailureLogApi {
line_count: number
/** True when the job had more failure lines than the per-job cap. */
truncated: boolean
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
}
export interface CIFailureLogsApi {
@@ -517,15 +516,15 @@ export interface PullRequestReadyToMergeApi {
}
/**
- * * `pull_request` - PULL_REQUEST
- * * `review_requests` - REVIEW_REQUESTS
- * * `only_team` - ONLY_TEAM
- * * `all_teams` - ALL_TEAMS
- * * `no_team` - NO_TEAM
+ * * `pull_request` - Pull Request
+ * * `review_requests` - Review Requests
+ * * `only_team` - Only Team
+ * * `all_teams` - All Teams
+ * * `no_team` - No Team
*/
-export type TeamBasisEnumApi = (typeof TeamBasisEnumApi)[keyof typeof TeamBasisEnumApi]
+export type ComparisonTeamBasisEnumApi = (typeof ComparisonTeamBasisEnumApi)[keyof typeof ComparisonTeamBasisEnumApi]
-export const TeamBasisEnumApi = {
+export const ComparisonTeamBasisEnumApi = {
PullRequest: 'pull_request',
ReviewRequests: 'review_requests',
OnlyTeam: 'only_team',
@@ -552,12 +551,12 @@ export interface DeliveryComparisonApi {
ready_data_available: boolean
/** How the teams were picked from the author's teams that own code: pull_request (the pr_number asked the team to review); review_requests (the team the author's pull requests asked to review most often in the window, with ties kept); only_team (the author is in one team); all_teams (no review request points at one team); no_team (no team, or no membership data).
*
- * * `pull_request` - PULL_REQUEST
- * * `review_requests` - REVIEW_REQUESTS
- * * `only_team` - ONLY_TEAM
- * * `all_teams` - ALL_TEAMS
- * * `no_team` - NO_TEAM */
- team_basis: TeamBasisEnumApi
+ * * `pull_request` - Pull Request
+ * * `review_requests` - Review Requests
+ * * `only_team` - Only Team
+ * * `all_teams` - All Teams
+ * * `no_team` - No Team */
+ team_basis: ComparisonTeamBasisEnumApi
}
export interface ScopeRepoFigureApi {
@@ -643,9 +642,9 @@ export interface DeliveryLeadTimeApi {
}
/**
- * * `author` - AUTHOR
- * * `github_team` - GITHUB_TEAM
- * * `pull_request` - PULL_REQUEST
+ * * `author` - Author
+ * * `github_team` - GitHub Team
+ * * `pull_request` - Pull Request
*/
export type DeliveryScopeKindEnumApi = (typeof DeliveryScopeKindEnumApi)[keyof typeof DeliveryScopeKindEnumApi]
@@ -682,9 +681,9 @@ export interface DeliverySummaryApi {
lead_time: DeliveryLeadTimeApi
/** What the read covers: 'author' (one GitHub login), 'github_team' (the members of one GitHub team, through the team membership table), or 'pull_request' (one pull request).
*
- * * `author` - AUTHOR
- * * `github_team` - GITHUB_TEAM
- * * `pull_request` - PULL_REQUEST */
+ * * `author` - Author
+ * * `github_team` - GitHub Team
+ * * `pull_request` - Pull Request */
scope_kind: DeliveryScopeKindEnumApi
/** The GitHub login or GitHub team slug the summary is for. */
scope: string
@@ -872,8 +871,8 @@ export interface DoraOverviewApi {
}
/**
- * * `pytest` - PYTEST
- * * `jest` - JEST
+ * * `pytest` - Pytest
+ * * `jest` - Jest
*/
export type CITestRunnerEnumApi = (typeof CITestRunnerEnumApi)[keyof typeof CITestRunnerEnumApi]
@@ -883,14 +882,14 @@ export const CITestRunnerEnumApi = {
} as const
/**
- * * `confirmed_flake` - CONFIRMED_FLAKE
- * * `suspected_regression` - SUSPECTED_REGRESSION
- * * `quarantined` - QUARANTINED
+ * * `confirmed_flake` - Confirmed Flake
+ * * `suspected_regression` - Suspected Regression
+ * * `quarantined` - Quarantined
*/
-export type FlakyTestItemClassificationEnumApi =
- (typeof FlakyTestItemClassificationEnumApi)[keyof typeof FlakyTestItemClassificationEnumApi]
+export type FlakyTestClassificationEnumApi =
+ (typeof FlakyTestClassificationEnumApi)[keyof typeof FlakyTestClassificationEnumApi]
-export const FlakyTestItemClassificationEnumApi = {
+export const FlakyTestClassificationEnumApi = {
ConfirmedFlake: 'confirmed_flake',
SuspectedRegression: 'suspected_regression',
Quarantined: 'quarantined',
@@ -899,8 +898,8 @@ export const FlakyTestItemClassificationEnumApi = {
export interface FlakyTestItemApi {
/** Test runner that emitted this signal: 'pytest' or 'jest'.
*
- * * `pytest` - PYTEST
- * * `jest` - JEST */
+ * * `pytest` - Pytest
+ * * `jest` - Jest */
runner: CITestRunnerEnumApi
/** Runner-specific stable test identity (the CI span name). This is a grouping key, not necessarily runnable; use `selector` to run or quarantine the test. */
nodeid: string
@@ -908,10 +907,10 @@ export interface FlakyTestItemApi {
selector: string
/** confirmed_flake: one commit both failed and passed the test (a re-run attempt went green, or an in-job retry recovered it), so it is provably nondeterministic. quarantined: a tolerated failure was recorded while it was masked. suspected_regression: only failures were recorded, which is absence of proof, not proof that it is a real break.
*
- * * `confirmed_flake` - CONFIRMED_FLAKE
- * * `suspected_regression` - SUSPECTED_REGRESSION
- * * `quarantined` - QUARANTINED */
- classification: FlakyTestItemClassificationEnumApi
+ * * `confirmed_flake` - Confirmed Flake
+ * * `suspected_regression` - Suspected Regression
+ * * `quarantined` - Quarantined */
+ classification: FlakyTestClassificationEnumApi
/** Runs where one commit both failed and passed the test: 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. A pass in a different run is a different commit and never counts. */
same_commit_recovery_run_count: number
/** Distinct CI runs whose recorded outcome was failed or error. A run counts once however many matrix legs it failed in. */
@@ -984,11 +983,6 @@ export interface WorkflowJobAggregateApi {
}
export interface MasterFailureGroupApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- latest_ci_engine?: CIEngineEnumApi | null
/** Repository the failures occurred in. */
repo: RepoRefApi
/** GitHub Actions workflow name the failing runs belong to. */
@@ -1003,14 +997,14 @@ export interface MasterFailureGroupApi {
last_seen: string
/** Run id of the newest failing run: the drill-down anchor. */
latest_run_id: number
-}
-
-export interface RunCostApi {
/** CI execution engine; null when unknown.
*
* * `github_actions` - GitHub Actions
* * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
+ latest_ci_engine?: CIEngineEnumApi | null
+}
+
+export interface RunCostApi {
/** Integer run id this cost is for; unique only together with ci_engine. */
run_id: number
/** Re-run attempt number; 1 for the first attempt. */
@@ -1022,6 +1016,11 @@ export interface RunCostApi {
* @nullable
*/
estimated_cost_usd: number | null
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
}
export interface PRLLMSpendApi {
@@ -1072,10 +1071,10 @@ export interface PullRequestApi {
title: string
/** Derived state: 'open', 'closed', or 'merged'.
*
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED */
- state: EngineeringAnalyticsPRStateEnumApi
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged */
+ state: PRStateEnumApi
/** True if the pull request is a draft. */
is_draft: boolean
/** When the pull request was opened. */
@@ -1093,13 +1092,13 @@ export interface PullRequestApi {
}
/**
- * * `opened` - OPENED
- * * `ready_for_review` - READY_FOR_REVIEW
- * * `converted_to_draft` - CONVERTED_TO_DRAFT
- * * `ci_started` - CI_STARTED
- * * `ci_finished` - CI_FINISHED
- * * `merged` - MERGED
- * * `closed` - CLOSED
+ * * `opened` - Opened
+ * * `ready_for_review` - Ready For Review
+ * * `converted_to_draft` - Converted To Draft
+ * * `ci_started` - CI Started
+ * * `ci_finished` - CI Finished
+ * * `merged` - Merged
+ * * `closed` - Closed
*/
export type PRLifecycleEventKindEnumApi = (typeof PRLifecycleEventKindEnumApi)[keyof typeof PRLifecycleEventKindEnumApi]
@@ -1114,20 +1113,15 @@ export const PRLifecycleEventKindEnumApi = {
} as const
export interface PRLifecycleEventApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
/** Event kind: opened, ready_for_review, converted_to_draft, ci_started, ci_finished, merged, or closed.
*
- * * `opened` - OPENED
- * * `ready_for_review` - READY_FOR_REVIEW
- * * `converted_to_draft` - CONVERTED_TO_DRAFT
- * * `ci_started` - CI_STARTED
- * * `ci_finished` - CI_FINISHED
- * * `merged` - MERGED
- * * `closed` - CLOSED */
+ * * `opened` - Opened
+ * * `ready_for_review` - Ready For Review
+ * * `converted_to_draft` - Converted To Draft
+ * * `ci_started` - CI Started
+ * * `ci_finished` - CI Finished
+ * * `merged` - Merged
+ * * `closed` - Closed */
kind: PRLifecycleEventKindEnumApi
/** When the event occurred. */
at: string
@@ -1141,12 +1135,17 @@ export interface PRLifecycleEventApi {
* @nullable
*/
run_id?: number | null
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
}
/**
- * * `precise` - PRECISE
- * * `coarse` - COARSE
- * * `partial` - PARTIAL
+ * * `precise` - Precise
+ * * `coarse` - Coarse
+ * * `partial` - Partial
*/
export type MetricQualityEnumApi = (typeof MetricQualityEnumApi)[keyof typeof MetricQualityEnumApi]
@@ -1163,18 +1162,13 @@ export interface PRLifecycleApi {
events: PRLifecycleEventApi[]
/** Always 'partial': CI events only; reviews and comments are not yet available.
*
- * * `precise` - PRECISE
- * * `coarse` - COARSE
- * * `partial` - PARTIAL */
+ * * `precise` - Precise
+ * * `coarse` - Coarse
+ * * `partial` - Partial */
metric_quality?: MetricQualityEnumApi
}
export interface WorkflowRunDetailApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
/** Repository the run belongs to. */
repo: RepoRefApi
/** Integer run id; unique only together with ci_engine. */
@@ -1218,6 +1212,11 @@ export interface WorkflowRunDetailApi {
commit_pr_number: number | null
/** True when a merge queue pushed this run to gate pr_number, rather than the author pushing it. Count it when measuring CI; drop it when counting what the author did. */
is_merge_queue: boolean
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
/**
* Source-native run id; use with ci_engine for identity.
* @nullable
@@ -1288,18 +1287,18 @@ export interface PRTimelinePushApi {
}
/**
- * * `draft` - DRAFT
- * * `waiting_for_review` - WAITING_FOR_REVIEW
- * * `changes_requested` - CHANGES_REQUESTED
- * * `approved_not_enqueued` - APPROVED_NOT_ENQUEUED
- * * `review_state_unknown` - REVIEW_STATE_UNKNOWN
- * * `ci_running` - CI_RUNNING
- * * `red_passed_on_rerun` - RED_PASSED_ON_RERUN
- * * `red_master_broken` - RED_MASTER_BROKEN
- * * `red_fixed_by_push` - RED_FIXED_BY_PUSH
- * * `red_not_provable` - RED_NOT_PROVABLE
- * * `merge_queue` - MERGE_QUEUE
- * * `out_of_merge_queue` - OUT_OF_MERGE_QUEUE
+ * * `draft` - Draft
+ * * `waiting_for_review` - Waiting For Review
+ * * `changes_requested` - Changes Requested
+ * * `approved_not_enqueued` - Approved Not Enqueued
+ * * `review_state_unknown` - Review State Unknown
+ * * `ci_running` - CI Running
+ * * `red_passed_on_rerun` - Red Passed On Rerun
+ * * `red_master_broken` - Red Master Broken
+ * * `red_fixed_by_push` - Red Fixed By Push
+ * * `red_not_provable` - Red Not Provable
+ * * `merge_queue` - Merge Queue
+ * * `out_of_merge_queue` - Out Of Merge Queue
*/
export type PRTimelineSegmentKindEnumApi =
(typeof PRTimelineSegmentKindEnumApi)[keyof typeof PRTimelineSegmentKindEnumApi]
@@ -1322,18 +1321,18 @@ export const PRTimelineSegmentKindEnumApi = {
export interface PRTimelineSegmentApi {
/** What the PR waited on: draft; waiting_for_review (no approval yet, or re-review after a push); changes_requested (no push since); approved_not_enqueued (approved, with no failing or running check); review_state_unknown (reviews not synced); ci_running; red_passed_on_rerun (the failed workflows passed a re-run of the same commit); red_master_broken (the failed jobs also failed on the default branch within 12 hours); red_fixed_by_push (a later commit arrived); red_not_provable; merge_queue (every queue state collapsed); out_of_merge_queue (open PR, Trunk says failed or cancelled).
*
- * * `draft` - DRAFT
- * * `waiting_for_review` - WAITING_FOR_REVIEW
- * * `changes_requested` - CHANGES_REQUESTED
- * * `approved_not_enqueued` - APPROVED_NOT_ENQUEUED
- * * `review_state_unknown` - REVIEW_STATE_UNKNOWN
- * * `ci_running` - CI_RUNNING
- * * `red_passed_on_rerun` - RED_PASSED_ON_RERUN
- * * `red_master_broken` - RED_MASTER_BROKEN
- * * `red_fixed_by_push` - RED_FIXED_BY_PUSH
- * * `red_not_provable` - RED_NOT_PROVABLE
- * * `merge_queue` - MERGE_QUEUE
- * * `out_of_merge_queue` - OUT_OF_MERGE_QUEUE */
+ * * `draft` - Draft
+ * * `waiting_for_review` - Waiting For Review
+ * * `changes_requested` - Changes Requested
+ * * `approved_not_enqueued` - Approved Not Enqueued
+ * * `review_state_unknown` - Review State Unknown
+ * * `ci_running` - CI Running
+ * * `red_passed_on_rerun` - Red Passed On Rerun
+ * * `red_master_broken` - Red Master Broken
+ * * `red_fixed_by_push` - Red Fixed By Push
+ * * `red_not_provable` - Red Not Provable
+ * * `merge_queue` - Merge Queue
+ * * `out_of_merge_queue` - Out Of Merge Queue */
kind: PRTimelineSegmentKindEnumApi
/** Segment start. */
started_at: string
@@ -1356,10 +1355,10 @@ export interface PRTimelineApi {
author: AuthorApi
/** open, merged, or closed. Author and team scopes list open and merged PRs only; a pull_request scope returns the PR whatever its state.
*
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED */
- state: EngineeringAnalyticsPRStateEnumApi
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged */
+ state: PRStateEnumApi
/** True when the PR is a draft right now. */
is_draft: boolean
/** When the PR was opened. */
@@ -1386,18 +1385,18 @@ export interface PRTimelineApi {
export interface PRTimelineRedTimeApi {
/** The red segment cause.
*
- * * `draft` - DRAFT
- * * `waiting_for_review` - WAITING_FOR_REVIEW
- * * `changes_requested` - CHANGES_REQUESTED
- * * `approved_not_enqueued` - APPROVED_NOT_ENQUEUED
- * * `review_state_unknown` - REVIEW_STATE_UNKNOWN
- * * `ci_running` - CI_RUNNING
- * * `red_passed_on_rerun` - RED_PASSED_ON_RERUN
- * * `red_master_broken` - RED_MASTER_BROKEN
- * * `red_fixed_by_push` - RED_FIXED_BY_PUSH
- * * `red_not_provable` - RED_NOT_PROVABLE
- * * `merge_queue` - MERGE_QUEUE
- * * `out_of_merge_queue` - OUT_OF_MERGE_QUEUE */
+ * * `draft` - Draft
+ * * `waiting_for_review` - Waiting For Review
+ * * `changes_requested` - Changes Requested
+ * * `approved_not_enqueued` - Approved Not Enqueued
+ * * `review_state_unknown` - Review State Unknown
+ * * `ci_running` - CI Running
+ * * `red_passed_on_rerun` - Red Passed On Rerun
+ * * `red_master_broken` - Red Master Broken
+ * * `red_fixed_by_push` - Red Fixed By Push
+ * * `red_not_provable` - Red Not Provable
+ * * `merge_queue` - Merge Queue
+ * * `out_of_merge_queue` - Out Of Merge Queue */
kind: PRTimelineSegmentKindEnumApi
/** Average seconds per merged pull request attributed to this cause. */
seconds_per_merged_pr: number
@@ -1410,9 +1409,9 @@ export interface PullRequestTimelinesApi {
red_seconds_per_merged_pr: PRTimelineRedTimeApi[]
/** What the read covers: 'author' (one GitHub login), 'github_team' (the members of one GitHub team, through the team membership table), or 'pull_request' (one pull request).
*
- * * `author` - AUTHOR
- * * `github_team` - GITHUB_TEAM
- * * `pull_request` - PULL_REQUEST */
+ * * `author` - Author
+ * * `github_team` - GitHub Team
+ * * `pull_request` - Pull Request */
scope_kind: DeliveryScopeKindEnumApi
/** The GitHub login, GitHub team slug, or 'owner/name#number' the timelines are for. */
scope: string
@@ -1444,8 +1443,8 @@ export interface PullRequestListApi {
}
/**
- * * `run` - RUN
- * * `skip` - SKIP
+ * * `run` - Run
+ * * `skip` - Skip
*/
export type QuarantineModeEnumApi = (typeof QuarantineModeEnumApi)[keyof typeof QuarantineModeEnumApi]
@@ -1455,14 +1454,14 @@ export const QuarantineModeEnumApi = {
} as const
/**
- * * `active` - ACTIVE
- * * `expiring_soon` - EXPIRING_SOON
- * * `in_grace` - IN_GRACE
- * * `overdue` - OVERDUE
+ * * `active` - Active
+ * * `expiring_soon` - Expiring Soon
+ * * `in_grace` - In Grace
+ * * `overdue` - Overdue
*/
-export type LifecycleEnumApi = (typeof LifecycleEnumApi)[keyof typeof LifecycleEnumApi]
+export type QuarantineLifecycleEnumApi = (typeof QuarantineLifecycleEnumApi)[keyof typeof QuarantineLifecycleEnumApi]
-export const LifecycleEnumApi = {
+export const QuarantineLifecycleEnumApi = {
Active: 'active',
ExpiringSoon: 'expiring_soon',
InGrace: 'in_grace',
@@ -1470,14 +1469,15 @@ export const LifecycleEnumApi = {
} as const
/**
- * * `product` - PRODUCT
- * * `file` - FILE
- * * `directory` - DIRECTORY
- * * `test` - TEST
+ * * `product` - Product
+ * * `file` - File
+ * * `directory` - Directory
+ * * `test` - Test
*/
-export type SelectorKindEnumApi = (typeof SelectorKindEnumApi)[keyof typeof SelectorKindEnumApi]
+export type QuarantineSelectorKindEnumApi =
+ (typeof QuarantineSelectorKindEnumApi)[keyof typeof QuarantineSelectorKindEnumApi]
-export const SelectorKindEnumApi = {
+export const QuarantineSelectorKindEnumApi = {
Product: 'product',
File: 'file',
Directory: 'directory',
@@ -1501,25 +1501,25 @@ export interface QuarantineEntryApi {
expires: string
/** 'run' (the test still executes but cannot fail the suite) or 'skip' (not run at all).
*
- * * `run` - RUN
- * * `skip` - SKIP */
+ * * `run` - Run
+ * * `skip` - Skip */
mode: QuarantineModeEnumApi
/** Expiry classification: 'active' (>7 days left), 'expiring_soon' (0-7 days left), 'in_grace' (expired up to 7 days ago), 'overdue' (expired beyond the grace period).
*
- * * `active` - ACTIVE
- * * `expiring_soon` - EXPIRING_SOON
- * * `in_grace` - IN_GRACE
- * * `overdue` - OVERDUE */
- lifecycle: LifecycleEnumApi
+ * * `active` - Active
+ * * `expiring_soon` - Expiring Soon
+ * * `in_grace` - In Grace
+ * * `overdue` - Overdue */
+ lifecycle: QuarantineLifecycleEnumApi
/** Days until the entry expires; negative once past expiry. */
days_until_expiry: number
/** What the selector covers: 'test' (contains '::'), 'file', 'directory', or 'product'.
*
- * * `product` - PRODUCT
- * * `file` - FILE
- * * `directory` - DIRECTORY
- * * `test` - TEST */
- selector_kind: SelectorKindEnumApi
+ * * `product` - Product
+ * * `file` - File
+ * * `directory` - Directory
+ * * `test` - Test */
+ selector_kind: QuarantineSelectorKindEnumApi
}
export interface QuarantineFileApi {
@@ -1540,28 +1540,27 @@ export interface QuarantineFileApi {
}
/**
- * * `quarantine` - QUARANTINE
- * * `extend` - EXTEND
- * * `remove` - REMOVE
+ * * `quarantine` - Quarantine
+ * * `extend` - Extend
+ * * `remove` - Remove
*/
-export type QuarantineRequestOperationEnumApi =
- (typeof QuarantineRequestOperationEnumApi)[keyof typeof QuarantineRequestOperationEnumApi]
+export type QuarantineRequestActionEnumApi =
+ (typeof QuarantineRequestActionEnumApi)[keyof typeof QuarantineRequestActionEnumApi]
-export const QuarantineRequestOperationEnumApi = {
+export const QuarantineRequestActionEnumApi = {
Quarantine: 'quarantine',
Extend: 'extend',
Remove: 'remove',
} as const
/**
- * * `pytest` - PYTEST
- * * `jest` - JEST
- * * `playwright` - PLAYWRIGHT
+ * * `pytest` - Pytest
+ * * `jest` - Jest
+ * * `playwright` - Playwright
*/
-export type QuarantineRequestRunnerEnumApi =
- (typeof QuarantineRequestRunnerEnumApi)[keyof typeof QuarantineRequestRunnerEnumApi]
+export type QuarantineRunnerEnumApi = (typeof QuarantineRunnerEnumApi)[keyof typeof QuarantineRunnerEnumApi]
-export const QuarantineRequestRunnerEnumApi = {
+export const QuarantineRunnerEnumApi = {
Pytest: 'pytest',
Jest: 'jest',
Playwright: 'playwright',
@@ -1570,18 +1569,18 @@ export const QuarantineRequestRunnerEnumApi = {
export interface QuarantineRequestApi {
/** What to do: 'quarantine' (add or replace an entry and file a tracking issue), 'extend' (re-stamp an existing entry's expiry, reusing its issue), or 'remove' (delete the entry). All three open a pull request.
*
- * * `quarantine` - QUARANTINE
- * * `extend` - EXTEND
- * * `remove` - REMOVE */
- operation: QuarantineRequestOperationEnumApi
+ * * `quarantine` - Quarantine
+ * * `extend` - Extend
+ * * `remove` - Remove */
+ operation: QuarantineRequestActionEnumApi
/** Test selector to act on: an exact test id, a file, a directory, a class prefix, or 'product:<dashed-name>'. */
selector: string
/** Test runner the selector targets: 'pytest', 'jest', or 'playwright'. Existing entries and Jest file extensions are inferred for older clients that omit it; other selectors default to 'pytest'.
*
- * * `pytest` - PYTEST
- * * `jest` - JEST
- * * `playwright` - PLAYWRIGHT */
- runner?: QuarantineRequestRunnerEnumApi | null
+ * * `pytest` - Pytest
+ * * `jest` - Jest
+ * * `playwright` - Playwright */
+ runner?: QuarantineRunnerEnumApi | null
/**
* Optional 'owner/name' repository override; defaults to the team's most active repo.
* @nullable
@@ -1600,8 +1599,8 @@ export interface QuarantineRequestApi {
expires?: string | null
/** 'run' (the test still executes but cannot fail the suite) or 'skip' (not run at all). Defaults to 'run'.
*
- * * `run` - RUN
- * * `skip` - SKIP */
+ * * `run` - Run
+ * * `skip` - Skip */
mode?: QuarantineModeEnumApi
}
@@ -1662,13 +1661,12 @@ export interface OpenToMergeBucketApi {
}
/**
- * * `open_to_gate` - OPEN_TO_GATE
- * * `gate_to_merge` - GATE_TO_MERGE
+ * * `open_to_gate` - Open To Gate
+ * * `gate_to_merge` - Gate To Merge
*/
-export type DeliveryStageTimingStageEnumApi =
- (typeof DeliveryStageTimingStageEnumApi)[keyof typeof DeliveryStageTimingStageEnumApi]
+export type DeliveryStageEnumApi = (typeof DeliveryStageEnumApi)[keyof typeof DeliveryStageEnumApi]
-export const DeliveryStageTimingStageEnumApi = {
+export const DeliveryStageEnumApi = {
OpenToGate: 'open_to_gate',
GateToMerge: 'gate_to_merge',
} as const
@@ -1676,9 +1674,9 @@ export const DeliveryStageTimingStageEnumApi = {
export interface DeliveryStageTimingApi {
/** Which leg this is: 'open_to_gate' (created_at to the PR's first merge-queue gate run starting) or 'gate_to_merge' (that gate run to merged_at). The post-merge leg is the DORA endpoint's median_merge_to_deploy_seconds.
*
- * * `open_to_gate` - OPEN_TO_GATE
- * * `gate_to_merge` - GATE_TO_MERGE */
- stage: DeliveryStageTimingStageEnumApi
+ * * `open_to_gate` - Open To Gate
+ * * `gate_to_merge` - Gate To Merge */
+ stage: DeliveryStageEnumApi
/**
* Median seconds for this leg. Null when no PR in the window has both of its bounds observed.
* @nullable
@@ -1928,11 +1926,6 @@ export interface RepoOverviewApi {
}
export interface WorkflowRunActivityPointApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
/** Integer run id; unique only together with ci_engine. */
run_id: number
/**
@@ -1953,6 +1946,11 @@ export interface WorkflowRunActivityPointApi {
pr_number: number
/** Head commit SHA of the run/commit, or '' when unknown. */
head_sha: string
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
}
export interface WorkflowRunActivityApi {
@@ -1982,11 +1980,6 @@ export interface BranchPRMatchApi {
}
export interface RunFailureLogsApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
/** Failed CI jobs of this run with their thinned failure logs, grouped by job. */
jobs: CIJobFailureLogApi[]
/** Workflow run id the failure logs are for. */
@@ -1995,6 +1988,11 @@ export interface RunFailureLogsApi {
logs_available: boolean
/** True when the overall line cap across all jobs was hit. */
truncated: boolean
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
}
export interface GitHubSourceApi {
@@ -2011,8 +2009,8 @@ export interface GitHubSourceApi {
export interface TeamTestSignalApi {
/** Test runner that emitted this signal: 'pytest' or 'jest'.
*
- * * `pytest` - PYTEST
- * * `jest` - JEST */
+ * * `pytest` - Pytest
+ * * `jest` - Jest */
runner: CITestRunnerEnumApi
/** Runner-specific test identity (the CI span name), a stable grouping key. */
nodeid: string
@@ -2195,11 +2193,6 @@ export interface WorkflowHealthBucketApi {
}
export interface WorkflowHealthItemApi {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- latest_ci_engine?: CIEngineEnumApi | null
/** Repository the workflow runs in. */
repo: RepoRefApi
/** Run history across the whole window, oldest first, zero-filled, bucketed by granularity. */
@@ -2269,14 +2262,14 @@ export interface WorkflowHealthItemApi {
percentile_run_count?: number
/** Runs on merge-queue gate branches (trunk-merge/**) in the window, counted regardless of branch or run_scope. Non-zero marks a workflow the queue runs before a merge lands, the closest available proxy for a required check. */
merge_queue_run_count?: number
-}
-
-export interface WorkflowJobApi {
/** CI execution engine; null when unknown.
*
* * `github_actions` - GitHub Actions
* * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnumApi | null
+ latest_ci_engine?: CIEngineEnumApi | null
+}
+
+export interface WorkflowJobApi {
/** Integer job id; unique only together with ci_engine. */
id: number
/** The workflow run id this job belongs to. */
@@ -2314,6 +2307,11 @@ export interface WorkflowJobApi {
* @nullable
*/
estimated_cost_usd: number | null
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnumApi | null
/**
* Source-native run id; use with ci_engine for identity.
* @nullable
diff --git a/products/engineering_analytics/frontend/generated/api.zod.ts b/products/engineering_analytics/frontend/generated/api.zod.ts
index 185836a5a290..cc3e3a93491e 100644
--- a/products/engineering_analytics/frontend/generated/api.zod.ts
+++ b/products/engineering_analytics/frontend/generated/api.zod.ts
@@ -23,9 +23,9 @@ export const EngineeringAnalyticsCiSignalsConfigUpdateBody = /* @__PURE__ */ zod
export const EngineeringAnalyticsQuarantineRequestBody = /* @__PURE__ */ zod.object({
operation: zod
.enum(['quarantine', 'extend', 'remove'])
- .describe('\* `quarantine` - QUARANTINE\n\* `extend` - EXTEND\n\* `remove` - REMOVE')
+ .describe('\* `quarantine` - Quarantine\n\* `extend` - Extend\n\* `remove` - Remove')
.describe(
- "What to do: 'quarantine' (add or replace an entry and file a tracking issue), 'extend' (re-stamp an existing entry's expiry, reusing its issue), or 'remove' (delete the entry). All three open a pull request.\n\n\* `quarantine` - QUARANTINE\n\* `extend` - EXTEND\n\* `remove` - REMOVE"
+ "What to do: 'quarantine' (add or replace an entry and file a tracking issue), 'extend' (re-stamp an existing entry's expiry, reusing its issue), or 'remove' (delete the entry). All three open a pull request.\n\n\* `quarantine` - Quarantine\n\* `extend` - Extend\n\* `remove` - Remove"
),
selector: zod
.string()
@@ -36,12 +36,12 @@ export const EngineeringAnalyticsQuarantineRequestBody = /* @__PURE__ */ zod.obj
.union([
zod
.enum(['pytest', 'jest', 'playwright'])
- .describe('\* `pytest` - PYTEST\n\* `jest` - JEST\n\* `playwright` - PLAYWRIGHT'),
+ .describe('\* `pytest` - Pytest\n\* `jest` - Jest\n\* `playwright` - Playwright'),
zod.null(),
])
.optional()
.describe(
- "Test runner the selector targets: 'pytest', 'jest', or 'playwright'. Existing entries and Jest file extensions are inferred for older clients that omit it; other selectors default to 'pytest'.\n\n\* `pytest` - PYTEST\n\* `jest` - JEST\n\* `playwright` - PLAYWRIGHT"
+ "Test runner the selector targets: 'pytest', 'jest', or 'playwright'. Existing entries and Jest file extensions are inferred for older clients that omit it; other selectors default to 'pytest'.\n\n\* `pytest` - Pytest\n\* `jest` - Jest\n\* `playwright` - Playwright"
),
repo: zod
.string()
@@ -71,9 +71,9 @@ export const EngineeringAnalyticsQuarantineRequestBody = /* @__PURE__ */ zod.obj
),
mode: zod
.enum(['run', 'skip'])
- .describe('\* `run` - RUN\n\* `skip` - SKIP')
+ .describe('\* `run` - Run\n\* `skip` - Skip')
.optional()
.describe(
- "'run' (the test still executes but cannot fail the suite) or 'skip' (not run at all). Defaults to 'run'.\n\n\* `run` - RUN\n\* `skip` - SKIP"
+ "'run' (the test still executes but cannot fail the suite) or 'skip' (not run at all). Defaults to 'run'.\n\n\* `run` - Run\n\* `skip` - Skip"
),
})
diff --git a/products/signals/frontend/inbox/components/config/AgentsRoster.tsx b/products/signals/frontend/inbox/components/config/AgentsRoster.tsx
index 72ec7baadd5f..680136761900 100644
--- a/products/signals/frontend/inbox/components/config/AgentsRoster.tsx
+++ b/products/signals/frontend/inbox/components/config/AgentsRoster.tsx
@@ -18,7 +18,7 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonTagType } from 'lib/lemon-ui/LemonTag/LemonTag'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import type { SyncStatusEnumApi } from 'products/engineering_analytics/frontend/generated/api.schemas'
+import type { CISignalsSyncStatusEnumApi } from 'products/engineering_analytics/frontend/generated/api.schemas'
import { sourceSteeringIsSet } from '../../logics/sourceSteeringModalLogic'
import { signalSourcesLogic } from '../../signalSourcesLogic'
@@ -75,7 +75,7 @@ const ENTITY_VISIBLE_LIMIT = 8
function resolveAgentStatus(
armed: boolean,
- syncStatus: SignalSourceConfigStatus | SyncStatusEnumApi | null | undefined
+ syncStatus: SignalSourceConfigStatus | CISignalsSyncStatusEnumApi | null | undefined
): AgentRosterStatus {
if (syncStatus === SignalSourceConfigStatus.FAILED) {
return 'sync_failed'
@@ -111,7 +111,7 @@ interface AgentSourceState {
loading: boolean
/** True for data-warehouse sources that haven't been connected yet – shows a Connect button. */
requiresSetup: boolean
- syncStatus: SignalSourceConfigStatus | SyncStatusEnumApi | null | undefined
+ syncStatus: SignalSourceConfigStatus | CISignalsSyncStatusEnumApi | null | undefined
entities: RosterEntity[]
/** The entity list is still loading, so the count would read as a wrong zero. */
entitiesLoading: boolean
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 86ed88119e58..f286cd20c903 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -13167,14 +13167,14 @@ export namespace Schemas {
}
/**
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged
*/
- export type EngineeringAnalyticsPRStateEnum = typeof EngineeringAnalyticsPRStateEnum[keyof typeof EngineeringAnalyticsPRStateEnum];
+ export type PRStateEnum = typeof PRStateEnum[keyof typeof PRStateEnum];
- export const EngineeringAnalyticsPRStateEnum = {
+ export const PRStateEnum = {
Open: 'open',
Closed: 'closed',
Merged: 'merged',
@@ -13195,10 +13195,10 @@ export namespace Schemas {
title: string;
/** Derived state: 'open', 'closed', or 'merged'.
*
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED */
- state: EngineeringAnalyticsPRStateEnum;
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged */
+ state: PRStateEnum;
/** True if the pull request is a draft. */
is_draft: boolean;
/** When the pull request was opened. */
@@ -13369,9 +13369,9 @@ export namespace Schemas {
/**
* * `ci` - CI
- * * `review` - REVIEW
- * * `queue` - QUEUE
- * * `rework` - REWORK
+ * * `review` - Review
+ * * `queue` - Queue
+ * * `rework` - Rework
*/
export type FrictionGroupEnum = typeof FrictionGroupEnum[keyof typeof FrictionGroupEnum];
@@ -13387,9 +13387,9 @@ export namespace Schemas {
/** ci (red CI and CI waits), review (waiting for the first approval), queue (merge-queue time and kickouts), or rework (own failures and extra pushes).
*
* * `ci` - CI
- * * `review` - REVIEW
- * * `queue` - QUEUE
- * * `rework` - REWORK */
+ * * `review` - Review
+ * * `queue` - Queue
+ * * `rework` - Rework */
group: FrictionGroupEnum;
/** This group's part of the score, in the same 'x typical' unit. The parts add up. */
score: number;
@@ -18831,29 +18831,17 @@ export namespace Schemas {
}
/**
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI
+ * * `breaking_master` - Breaking Master
+ * * `blocking_merge_queue` - Blocking Merge Queue
+ * * `novel_burst` - Novel Burst
+ * * `potentially_resolved` - Potentially Resolved
+ * * `flaky` - Flaky
+ * * `pr_only` - PR Only
*/
- export type CIEngineEnum = typeof CIEngineEnum[keyof typeof CIEngineEnum];
+ export type BrokenTestStateEnum = typeof BrokenTestStateEnum[keyof typeof BrokenTestStateEnum];
- export const CIEngineEnum = {
- GithubActions: 'github_actions',
- DepotCi: 'depot_ci',
- } as const;
-
- /**
- * * `breaking_master` - BREAKING_MASTER
- * * `blocking_merge_queue` - BLOCKING_MERGE_QUEUE
- * * `novel_burst` - NOVEL_BURST
- * * `potentially_resolved` - POTENTIALLY_RESOLVED
- * * `flaky` - FLAKY
- * * `pr_only` - PR_ONLY
- */
- export type BrokenTestRowStateEnum = typeof BrokenTestRowStateEnum[keyof typeof BrokenTestRowStateEnum];
-
-
- export const BrokenTestRowStateEnum = {
+ export const BrokenTestStateEnum = {
BreakingMaster: 'breaking_master',
BlockingMergeQueue: 'blocking_merge_queue',
NovelBurst: 'novel_burst',
@@ -18862,12 +18850,19 @@ export namespace Schemas {
PrOnly: 'pr_only',
} as const;
+ /**
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI
+ */
+ export type CIEngineEnum = typeof CIEngineEnum[keyof typeof CIEngineEnum];
+
+
+ export const CIEngineEnum = {
+ GithubActions: 'github_actions',
+ DepotCi: 'depot_ci',
+ } as const;
+
export interface BrokenTestRow {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- latest_ci_engine?: CIEngineEnum | null;
/** Stable identity of this distinct failure: the failing test's node id plus a normalized error signature, so the same failure across runs groups into one row. */
fingerprint: string;
/** The pytest node id from the CI 'FAILED <id>' line: the failing test. */
@@ -18880,13 +18875,13 @@ export namespace Schemas {
repo: string;
/** The classifier's verdict on how this failure is behaving right now: 'breaking_master' (failing on trunk, latest trunk run still red), 'blocking_merge_queue' (stopped a merge on a commit that already passed the PR's own CI, trunk still green), 'novel_burst' (new within a day and spreading across branches, not on trunk yet), 'potentially_resolved' (hit trunk but trunk is green again), 'flaky' (sporadic across branches over more than a day), or 'pr_only' (confined to one branch: one PR's own problem).
*
- * * `breaking_master` - BREAKING_MASTER
- * * `blocking_merge_queue` - BLOCKING_MERGE_QUEUE
- * * `novel_burst` - NOVEL_BURST
- * * `potentially_resolved` - POTENTIALLY_RESOLVED
- * * `flaky` - FLAKY
- * * `pr_only` - PR_ONLY */
- state: BrokenTestRowStateEnum;
+ * * `breaking_master` - Breaking Master
+ * * `blocking_merge_queue` - Blocking Merge Queue
+ * * `novel_burst` - Novel Burst
+ * * `potentially_resolved` - Potentially Resolved
+ * * `flaky` - Flaky
+ * * `pr_only` - PR Only */
+ state: BrokenTestStateEnum;
/** Earliest failure line for this fingerprint in the analysis window. */
first_seen: string;
/** Most recent failure line for this fingerprint in the analysis window. */
@@ -18903,6 +18898,11 @@ export namespace Schemas {
latest_branch: string;
/** Hourly failure counts over the last 24 hours, oldest first (fixed 24-slot array), for the row sparkline. All zeros when nothing failed in the last day. */
trend_24h?: number[];
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ latest_ci_engine?: CIEngineEnum | null;
}
export interface BrokenTestsResult {
@@ -19391,11 +19391,6 @@ export namespace Schemas {
}
export interface CIJobFailureLog {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
/** The thinned failure-log lines in original order, with omission markers. */
lines: CIFailureLogLine[];
/** Integer job id of the failed job; unique only together with ci_engine. */
@@ -19412,6 +19407,11 @@ export namespace Schemas {
line_count: number;
/** True when the job had more failure lines than the per-job cap. */
truncated: boolean;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
}
export interface CIFailureLogs {
@@ -19495,14 +19495,14 @@ export namespace Schemas {
}
/**
- * * `running` - RUNNING
- * * `completed` - COMPLETED
- * * `failed` - FAILED
+ * * `running` - Sync Running
+ * * `completed` - Sync Completed
+ * * `failed` - Sync Failed
*/
- export type SyncStatusEnum = typeof SyncStatusEnum[keyof typeof SyncStatusEnum];
+ export type CISignalsSyncStatusEnum = typeof CISignalsSyncStatusEnum[keyof typeof CISignalsSyncStatusEnum];
- export const SyncStatusEnum = {
+ export const CISignalsSyncStatusEnum = {
Running: 'running',
Completed: 'completed',
Failed: 'failed',
@@ -19515,10 +19515,10 @@ export namespace Schemas {
enabled: boolean;
/** Aggregate sync status for pull requests, workflow runs, and workflow jobs.
*
- * * `running` - RUNNING
- * * `completed` - COMPLETED
- * * `failed` - FAILED */
- sync_status: SyncStatusEnum | null;
+ * * `running` - Sync Running
+ * * `completed` - Sync Completed
+ * * `failed` - Sync Failed */
+ sync_status: CISignalsSyncStatusEnum | null;
}
export interface CISignalsConfigUpdate {
@@ -19527,8 +19527,8 @@ export namespace Schemas {
}
/**
- * * `pytest` - PYTEST
- * * `jest` - JEST
+ * * `pytest` - Pytest
+ * * `jest` - Jest
*/
export type CITestRunnerEnum = typeof CITestRunnerEnum[keyof typeof CITestRunnerEnum];
@@ -24099,6 +24099,24 @@ export namespace Schemas {
value: string;
}
+ /**
+ * * `pull_request` - Pull Request
+ * * `review_requests` - Review Requests
+ * * `only_team` - Only Team
+ * * `all_teams` - All Teams
+ * * `no_team` - No Team
+ */
+ export type ComparisonTeamBasisEnum = typeof ComparisonTeamBasisEnum[keyof typeof ComparisonTeamBasisEnum];
+
+
+ export const ComparisonTeamBasisEnum = {
+ PullRequest: 'pull_request',
+ ReviewRequests: 'review_requests',
+ OnlyTeam: 'only_team',
+ AllTeams: 'all_teams',
+ NoTeam: 'no_team',
+ } as const;
+
export interface CompleteRunInput {
/**
* Numeric GitHub Actions job ID of the CI job that completes the run, from `${{ job.check_run_id }}`. Recompute re-runs this job, so it re-reads the verdict without capturing the snapshots again. Omit it outside GitHub Actions.
@@ -34708,24 +34726,6 @@ export namespace Schemas {
before_first_approval_share: number | null;
}
- /**
- * * `pull_request` - PULL_REQUEST
- * * `review_requests` - REVIEW_REQUESTS
- * * `only_team` - ONLY_TEAM
- * * `all_teams` - ALL_TEAMS
- * * `no_team` - NO_TEAM
- */
- export type TeamBasisEnum = typeof TeamBasisEnum[keyof typeof TeamBasisEnum];
-
-
- export const TeamBasisEnum = {
- PullRequest: 'pull_request',
- ReviewRequests: 'review_requests',
- OnlyTeam: 'only_team',
- AllTeams: 'all_teams',
- NoTeam: 'no_team',
- } as const;
-
export interface DeliveryComparison {
/** Over the author's pull requests, without the pr_number pull request. */
author_medians: ReadyToMergeMedians;
@@ -34745,12 +34745,12 @@ export namespace Schemas {
ready_data_available: boolean;
/** How the teams were picked from the author's teams that own code: pull_request (the pr_number asked the team to review); review_requests (the team the author's pull requests asked to review most often in the window, with ties kept); only_team (the author is in one team); all_teams (no review request points at one team); no_team (no team, or no membership data).
*
- * * `pull_request` - PULL_REQUEST
- * * `review_requests` - REVIEW_REQUESTS
- * * `only_team` - ONLY_TEAM
- * * `all_teams` - ALL_TEAMS
- * * `no_team` - NO_TEAM */
- team_basis: TeamBasisEnum;
+ * * `pull_request` - Pull Request
+ * * `review_requests` - Review Requests
+ * * `only_team` - Only Team
+ * * `all_teams` - All Teams
+ * * `no_team` - No Team */
+ team_basis: ComparisonTeamBasisEnum;
}
/**
@@ -34839,13 +34839,13 @@ export namespace Schemas {
}
/**
- * * `open_to_gate` - OPEN_TO_GATE
- * * `gate_to_merge` - GATE_TO_MERGE
+ * * `open_to_gate` - Open To Gate
+ * * `gate_to_merge` - Gate To Merge
*/
- export type DeliveryStageTimingStageEnum = typeof DeliveryStageTimingStageEnum[keyof typeof DeliveryStageTimingStageEnum];
+ export type DeliveryStageEnum = typeof DeliveryStageEnum[keyof typeof DeliveryStageEnum];
- export const DeliveryStageTimingStageEnum = {
+ export const DeliveryStageEnum = {
OpenToGate: 'open_to_gate',
GateToMerge: 'gate_to_merge',
} as const;
@@ -34853,9 +34853,9 @@ export namespace Schemas {
export interface DeliveryStageTiming {
/** Which leg this is: 'open_to_gate' (created_at to the PR's first merge-queue gate run starting) or 'gate_to_merge' (that gate run to merged_at). The post-merge leg is the DORA endpoint's median_merge_to_deploy_seconds.
*
- * * `open_to_gate` - OPEN_TO_GATE
- * * `gate_to_merge` - GATE_TO_MERGE */
- stage: DeliveryStageTimingStageEnum;
+ * * `open_to_gate` - Open To Gate
+ * * `gate_to_merge` - Gate To Merge */
+ stage: DeliveryStageEnum;
/**
* Median seconds for this leg. Null when no PR in the window has both of its bounds observed.
* @nullable
@@ -34878,9 +34878,9 @@ export namespace Schemas {
}
/**
- * * `author` - AUTHOR
- * * `github_team` - GITHUB_TEAM
- * * `pull_request` - PULL_REQUEST
+ * * `author` - Author
+ * * `github_team` - GitHub Team
+ * * `pull_request` - Pull Request
*/
export type DeliveryScopeKindEnum = typeof DeliveryScopeKindEnum[keyof typeof DeliveryScopeKindEnum];
@@ -34931,9 +34931,9 @@ export namespace Schemas {
lead_time: DeliveryLeadTime;
/** What the read covers: 'author' (one GitHub login), 'github_team' (the members of one GitHub team, through the team membership table), or 'pull_request' (one pull request).
*
- * * `author` - AUTHOR
- * * `github_team` - GITHUB_TEAM
- * * `pull_request` - PULL_REQUEST */
+ * * `author` - Author
+ * * `github_team` - GitHub Team
+ * * `pull_request` - Pull Request */
scope_kind: DeliveryScopeKindEnum;
/** The GitHub login or GitHub team slug the summary is for. */
scope: string;
@@ -51861,14 +51861,14 @@ export namespace Schemas {
}
/**
- * * `confirmed_flake` - CONFIRMED_FLAKE
- * * `suspected_regression` - SUSPECTED_REGRESSION
- * * `quarantined` - QUARANTINED
+ * * `confirmed_flake` - Confirmed Flake
+ * * `suspected_regression` - Suspected Regression
+ * * `quarantined` - Quarantined
*/
- export type FlakyTestItemClassificationEnum = typeof FlakyTestItemClassificationEnum[keyof typeof FlakyTestItemClassificationEnum];
+ export type FlakyTestClassificationEnum = typeof FlakyTestClassificationEnum[keyof typeof FlakyTestClassificationEnum];
- export const FlakyTestItemClassificationEnum = {
+ export const FlakyTestClassificationEnum = {
ConfirmedFlake: 'confirmed_flake',
SuspectedRegression: 'suspected_regression',
Quarantined: 'quarantined',
@@ -51877,8 +51877,8 @@ export namespace Schemas {
export interface FlakyTestItem {
/** Test runner that emitted this signal: 'pytest' or 'jest'.
*
- * * `pytest` - PYTEST
- * * `jest` - JEST */
+ * * `pytest` - Pytest
+ * * `jest` - Jest */
runner: CITestRunnerEnum;
/** Runner-specific stable test identity (the CI span name). This is a grouping key, not necessarily runnable; use `selector` to run or quarantine the test. */
nodeid: string;
@@ -51886,10 +51886,10 @@ export namespace Schemas {
selector: string;
/** confirmed_flake: one commit both failed and passed the test (a re-run attempt went green, or an in-job retry recovered it), so it is provably nondeterministic. quarantined: a tolerated failure was recorded while it was masked. suspected_regression: only failures were recorded, which is absence of proof, not proof that it is a real break.
*
- * * `confirmed_flake` - CONFIRMED_FLAKE
- * * `suspected_regression` - SUSPECTED_REGRESSION
- * * `quarantined` - QUARANTINED */
- classification: FlakyTestItemClassificationEnum;
+ * * `confirmed_flake` - Confirmed Flake
+ * * `suspected_regression` - Suspected Regression
+ * * `quarantined` - Quarantined */
+ classification: FlakyTestClassificationEnum;
/** Runs where one commit both failed and passed the test: 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. A pass in a different run is a different commit and never counts. */
same_commit_recovery_run_count: number;
/** Distinct CI runs whose recorded outcome was failed or error. A run counts once however many matrix legs it failed in. */
@@ -60578,22 +60578,6 @@ export namespace Schemas {
PosthogAspnetcore: 'posthog-aspnetcore',
} as const;
- /**
- * * `active` - ACTIVE
- * * `expiring_soon` - EXPIRING_SOON
- * * `in_grace` - IN_GRACE
- * * `overdue` - OVERDUE
- */
- export type LifecycleEnum = typeof LifecycleEnum[keyof typeof LifecycleEnum];
-
-
- export const LifecycleEnum = {
- Active: 'active',
- ExpiringSoon: 'expiring_soon',
- InGrace: 'in_grace',
- Overdue: 'overdue',
- } as const;
-
/**
* * `awaiting_generation` - awaiting_generation
* * `generating` - generating
@@ -64570,11 +64554,6 @@ export namespace Schemas {
}
export interface MasterFailureGroup {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- latest_ci_engine?: CIEngineEnum | null;
/** Repository the failures occurred in. */
repo: RepoRef;
/** GitHub Actions workflow name the failing runs belong to. */
@@ -64589,6 +64568,11 @@ export namespace Schemas {
last_seen: string;
/** Run id of the newest failing run: the drill-down anchor. */
latest_run_id: number;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ latest_ci_engine?: CIEngineEnum | null;
}
export interface SpecificityMetadata {
@@ -65280,9 +65264,9 @@ export namespace Schemas {
} as const;
/**
- * * `precise` - PRECISE
- * * `coarse` - COARSE
- * * `partial` - PARTIAL
+ * * `precise` - Precise
+ * * `coarse` - Coarse
+ * * `partial` - Partial
*/
export type MetricQualityEnum = typeof MetricQualityEnum[keyof typeof MetricQualityEnum];
@@ -68032,11 +68016,6 @@ export namespace Schemas {
}
export interface RunCost {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
/** Integer run id this cost is for; unique only together with ci_engine. */
run_id: number;
/** Re-run attempt number; 1 for the first attempt. */
@@ -68048,6 +68027,11 @@ export namespace Schemas {
* @nullable
*/
estimated_cost_usd: number | null;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
}
export interface PRLLMSpend {
@@ -68098,10 +68082,10 @@ export namespace Schemas {
title: string;
/** Derived state: 'open', 'closed', or 'merged'.
*
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED */
- state: EngineeringAnalyticsPRStateEnum;
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged */
+ state: PRStateEnum;
/** True if the pull request is a draft. */
is_draft: boolean;
/** When the pull request was opened. */
@@ -68119,13 +68103,13 @@ export namespace Schemas {
}
/**
- * * `opened` - OPENED
- * * `ready_for_review` - READY_FOR_REVIEW
- * * `converted_to_draft` - CONVERTED_TO_DRAFT
- * * `ci_started` - CI_STARTED
- * * `ci_finished` - CI_FINISHED
- * * `merged` - MERGED
- * * `closed` - CLOSED
+ * * `opened` - Opened
+ * * `ready_for_review` - Ready For Review
+ * * `converted_to_draft` - Converted To Draft
+ * * `ci_started` - CI Started
+ * * `ci_finished` - CI Finished
+ * * `merged` - Merged
+ * * `closed` - Closed
*/
export type PRLifecycleEventKindEnum = typeof PRLifecycleEventKindEnum[keyof typeof PRLifecycleEventKindEnum];
@@ -68141,20 +68125,15 @@ export namespace Schemas {
} as const;
export interface PRLifecycleEvent {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
/** Event kind: opened, ready_for_review, converted_to_draft, ci_started, ci_finished, merged, or closed.
*
- * * `opened` - OPENED
- * * `ready_for_review` - READY_FOR_REVIEW
- * * `converted_to_draft` - CONVERTED_TO_DRAFT
- * * `ci_started` - CI_STARTED
- * * `ci_finished` - CI_FINISHED
- * * `merged` - MERGED
- * * `closed` - CLOSED */
+ * * `opened` - Opened
+ * * `ready_for_review` - Ready For Review
+ * * `converted_to_draft` - Converted To Draft
+ * * `ci_started` - CI Started
+ * * `ci_finished` - CI Finished
+ * * `merged` - Merged
+ * * `closed` - Closed */
kind: PRLifecycleEventKindEnum;
/** When the event occurred. */
at: string;
@@ -68168,6 +68147,11 @@ export namespace Schemas {
* @nullable
*/
run_id?: number | null;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
}
export interface PRLifecycle {
@@ -68177,9 +68161,9 @@ export namespace Schemas {
events: PRLifecycleEvent[];
/** Always 'partial': CI events only; reviews and comments are not yet available.
*
- * * `precise` - PRECISE
- * * `coarse` - COARSE
- * * `partial` - PARTIAL */
+ * * `precise` - Precise
+ * * `coarse` - Coarse
+ * * `partial` - Partial */
metric_quality?: MetricQualityEnum;
}
@@ -68191,18 +68175,18 @@ export namespace Schemas {
}
/**
- * * `draft` - DRAFT
- * * `waiting_for_review` - WAITING_FOR_REVIEW
- * * `changes_requested` - CHANGES_REQUESTED
- * * `approved_not_enqueued` - APPROVED_NOT_ENQUEUED
- * * `review_state_unknown` - REVIEW_STATE_UNKNOWN
- * * `ci_running` - CI_RUNNING
- * * `red_passed_on_rerun` - RED_PASSED_ON_RERUN
- * * `red_master_broken` - RED_MASTER_BROKEN
- * * `red_fixed_by_push` - RED_FIXED_BY_PUSH
- * * `red_not_provable` - RED_NOT_PROVABLE
- * * `merge_queue` - MERGE_QUEUE
- * * `out_of_merge_queue` - OUT_OF_MERGE_QUEUE
+ * * `draft` - Draft
+ * * `waiting_for_review` - Waiting For Review
+ * * `changes_requested` - Changes Requested
+ * * `approved_not_enqueued` - Approved Not Enqueued
+ * * `review_state_unknown` - Review State Unknown
+ * * `ci_running` - CI Running
+ * * `red_passed_on_rerun` - Red Passed On Rerun
+ * * `red_master_broken` - Red Master Broken
+ * * `red_fixed_by_push` - Red Fixed By Push
+ * * `red_not_provable` - Red Not Provable
+ * * `merge_queue` - Merge Queue
+ * * `out_of_merge_queue` - Out Of Merge Queue
*/
export type PRTimelineSegmentKindEnum = typeof PRTimelineSegmentKindEnum[keyof typeof PRTimelineSegmentKindEnum];
@@ -68225,18 +68209,18 @@ export namespace Schemas {
export interface PRTimelineSegment {
/** What the PR waited on: draft; waiting_for_review (no approval yet, or re-review after a push); changes_requested (no push since); approved_not_enqueued (approved, with no failing or running check); review_state_unknown (reviews not synced); ci_running; red_passed_on_rerun (the failed workflows passed a re-run of the same commit); red_master_broken (the failed jobs also failed on the default branch within 12 hours); red_fixed_by_push (a later commit arrived); red_not_provable; merge_queue (every queue state collapsed); out_of_merge_queue (open PR, Trunk says failed or cancelled).
*
- * * `draft` - DRAFT
- * * `waiting_for_review` - WAITING_FOR_REVIEW
- * * `changes_requested` - CHANGES_REQUESTED
- * * `approved_not_enqueued` - APPROVED_NOT_ENQUEUED
- * * `review_state_unknown` - REVIEW_STATE_UNKNOWN
- * * `ci_running` - CI_RUNNING
- * * `red_passed_on_rerun` - RED_PASSED_ON_RERUN
- * * `red_master_broken` - RED_MASTER_BROKEN
- * * `red_fixed_by_push` - RED_FIXED_BY_PUSH
- * * `red_not_provable` - RED_NOT_PROVABLE
- * * `merge_queue` - MERGE_QUEUE
- * * `out_of_merge_queue` - OUT_OF_MERGE_QUEUE */
+ * * `draft` - Draft
+ * * `waiting_for_review` - Waiting For Review
+ * * `changes_requested` - Changes Requested
+ * * `approved_not_enqueued` - Approved Not Enqueued
+ * * `review_state_unknown` - Review State Unknown
+ * * `ci_running` - CI Running
+ * * `red_passed_on_rerun` - Red Passed On Rerun
+ * * `red_master_broken` - Red Master Broken
+ * * `red_fixed_by_push` - Red Fixed By Push
+ * * `red_not_provable` - Red Not Provable
+ * * `merge_queue` - Merge Queue
+ * * `out_of_merge_queue` - Out Of Merge Queue */
kind: PRTimelineSegmentKindEnum;
/** Segment start. */
started_at: string;
@@ -68259,10 +68243,10 @@ export namespace Schemas {
author: Author;
/** open, merged, or closed. Author and team scopes list open and merged PRs only; a pull_request scope returns the PR whatever its state.
*
- * * `open` - OPEN
- * * `closed` - CLOSED
- * * `merged` - MERGED */
- state: EngineeringAnalyticsPRStateEnum;
+ * * `open` - Open
+ * * `closed` - Closed
+ * * `merged` - Merged */
+ state: PRStateEnum;
/** True when the PR is a draft right now. */
is_draft: boolean;
/** When the PR was opened. */
@@ -68289,18 +68273,18 @@ export namespace Schemas {
export interface PRTimelineRedTime {
/** The red segment cause.
*
- * * `draft` - DRAFT
- * * `waiting_for_review` - WAITING_FOR_REVIEW
- * * `changes_requested` - CHANGES_REQUESTED
- * * `approved_not_enqueued` - APPROVED_NOT_ENQUEUED
- * * `review_state_unknown` - REVIEW_STATE_UNKNOWN
- * * `ci_running` - CI_RUNNING
- * * `red_passed_on_rerun` - RED_PASSED_ON_RERUN
- * * `red_master_broken` - RED_MASTER_BROKEN
- * * `red_fixed_by_push` - RED_FIXED_BY_PUSH
- * * `red_not_provable` - RED_NOT_PROVABLE
- * * `merge_queue` - MERGE_QUEUE
- * * `out_of_merge_queue` - OUT_OF_MERGE_QUEUE */
+ * * `draft` - Draft
+ * * `waiting_for_review` - Waiting For Review
+ * * `changes_requested` - Changes Requested
+ * * `approved_not_enqueued` - Approved Not Enqueued
+ * * `review_state_unknown` - Review State Unknown
+ * * `ci_running` - CI Running
+ * * `red_passed_on_rerun` - Red Passed On Rerun
+ * * `red_master_broken` - Red Master Broken
+ * * `red_fixed_by_push` - Red Fixed By Push
+ * * `red_not_provable` - Red Not Provable
+ * * `merge_queue` - Merge Queue
+ * * `out_of_merge_queue` - Out Of Merge Queue */
kind: PRTimelineSegmentKindEnum;
/** Average seconds per merged pull request attributed to this cause. */
seconds_per_merged_pr: number;
@@ -89068,9 +89052,9 @@ export namespace Schemas {
red_seconds_per_merged_pr: PRTimelineRedTime[];
/** What the read covers: 'author' (one GitHub login), 'github_team' (the members of one GitHub team, through the team membership table), or 'pull_request' (one pull request).
*
- * * `author` - AUTHOR
- * * `github_team` - GITHUB_TEAM
- * * `pull_request` - PULL_REQUEST */
+ * * `author` - Author
+ * * `github_team` - GitHub Team
+ * * `pull_request` - Pull Request */
scope_kind: DeliveryScopeKindEnum;
/** The GitHub login, GitHub team slug, or 'owner/name#number' the timelines are for. */
scope: string;
@@ -89093,8 +89077,8 @@ export namespace Schemas {
}
/**
- * * `run` - RUN
- * * `skip` - SKIP
+ * * `run` - Run
+ * * `skip` - Skip
*/
export type QuarantineModeEnum = typeof QuarantineModeEnum[keyof typeof QuarantineModeEnum];
@@ -89105,15 +89089,31 @@ export namespace Schemas {
} as const;
/**
- * * `product` - PRODUCT
- * * `file` - FILE
- * * `directory` - DIRECTORY
- * * `test` - TEST
+ * * `active` - Active
+ * * `expiring_soon` - Expiring Soon
+ * * `in_grace` - In Grace
+ * * `overdue` - Overdue
+ */
+ export type QuarantineLifecycleEnum = typeof QuarantineLifecycleEnum[keyof typeof QuarantineLifecycleEnum];
+
+
+ export const QuarantineLifecycleEnum = {
+ Active: 'active',
+ ExpiringSoon: 'expiring_soon',
+ InGrace: 'in_grace',
+ Overdue: 'overdue',
+ } as const;
+
+ /**
+ * * `product` - Product
+ * * `file` - File
+ * * `directory` - Directory
+ * * `test` - Test
*/
- export type SelectorKindEnum = typeof SelectorKindEnum[keyof typeof SelectorKindEnum];
+ export type QuarantineSelectorKindEnum = typeof QuarantineSelectorKindEnum[keyof typeof QuarantineSelectorKindEnum];
- export const SelectorKindEnum = {
+ export const QuarantineSelectorKindEnum = {
Product: 'product',
File: 'file',
Directory: 'directory',
@@ -89137,25 +89137,25 @@ export namespace Schemas {
expires: string;
/** 'run' (the test still executes but cannot fail the suite) or 'skip' (not run at all).
*
- * * `run` - RUN
- * * `skip` - SKIP */
+ * * `run` - Run
+ * * `skip` - Skip */
mode: QuarantineModeEnum;
/** Expiry classification: 'active' (>7 days left), 'expiring_soon' (0-7 days left), 'in_grace' (expired up to 7 days ago), 'overdue' (expired beyond the grace period).
*
- * * `active` - ACTIVE
- * * `expiring_soon` - EXPIRING_SOON
- * * `in_grace` - IN_GRACE
- * * `overdue` - OVERDUE */
- lifecycle: LifecycleEnum;
+ * * `active` - Active
+ * * `expiring_soon` - Expiring Soon
+ * * `in_grace` - In Grace
+ * * `overdue` - Overdue */
+ lifecycle: QuarantineLifecycleEnum;
/** Days until the entry expires; negative once past expiry. */
days_until_expiry: number;
/** What the selector covers: 'test' (contains '::'), 'file', 'directory', or 'product'.
*
- * * `product` - PRODUCT
- * * `file` - FILE
- * * `directory` - DIRECTORY
- * * `test` - TEST */
- selector_kind: SelectorKindEnum;
+ * * `product` - Product
+ * * `file` - File
+ * * `directory` - Directory
+ * * `test` - Test */
+ selector_kind: QuarantineSelectorKindEnum;
}
export interface QuarantineFile {
@@ -89269,28 +89269,28 @@ export namespace Schemas {
}
/**
- * * `quarantine` - QUARANTINE
- * * `extend` - EXTEND
- * * `remove` - REMOVE
+ * * `quarantine` - Quarantine
+ * * `extend` - Extend
+ * * `remove` - Remove
*/
- export type QuarantineRequestOperationEnum = typeof QuarantineRequestOperationEnum[keyof typeof QuarantineRequestOperationEnum];
+ export type QuarantineRequestActionEnum = typeof QuarantineRequestActionEnum[keyof typeof QuarantineRequestActionEnum];
- export const QuarantineRequestOperationEnum = {
+ export const QuarantineRequestActionEnum = {
Quarantine: 'quarantine',
Extend: 'extend',
Remove: 'remove',
} as const;
/**
- * * `pytest` - PYTEST
- * * `jest` - JEST
- * * `playwright` - PLAYWRIGHT
+ * * `pytest` - Pytest
+ * * `jest` - Jest
+ * * `playwright` - Playwright
*/
- export type QuarantineRequestRunnerEnum = typeof QuarantineRequestRunnerEnum[keyof typeof QuarantineRequestRunnerEnum];
+ export type QuarantineRunnerEnum = typeof QuarantineRunnerEnum[keyof typeof QuarantineRunnerEnum];
- export const QuarantineRequestRunnerEnum = {
+ export const QuarantineRunnerEnum = {
Pytest: 'pytest',
Jest: 'jest',
Playwright: 'playwright',
@@ -89299,18 +89299,18 @@ export namespace Schemas {
export interface QuarantineRequest {
/** What to do: 'quarantine' (add or replace an entry and file a tracking issue), 'extend' (re-stamp an existing entry's expiry, reusing its issue), or 'remove' (delete the entry). All three open a pull request.
*
- * * `quarantine` - QUARANTINE
- * * `extend` - EXTEND
- * * `remove` - REMOVE */
- operation: QuarantineRequestOperationEnum;
+ * * `quarantine` - Quarantine
+ * * `extend` - Extend
+ * * `remove` - Remove */
+ operation: QuarantineRequestActionEnum;
/** Test selector to act on: an exact test id, a file, a directory, a class prefix, or 'product:<dashed-name>'. */
selector: string;
/** Test runner the selector targets: 'pytest', 'jest', or 'playwright'. Existing entries and Jest file extensions are inferred for older clients that omit it; other selectors default to 'pytest'.
*
- * * `pytest` - PYTEST
- * * `jest` - JEST
- * * `playwright` - PLAYWRIGHT */
- runner?: QuarantineRequestRunnerEnum | null;
+ * * `pytest` - Pytest
+ * * `jest` - Jest
+ * * `playwright` - Playwright */
+ runner?: QuarantineRunnerEnum | null;
/**
* Optional 'owner/name' repository override; defaults to the team's most active repo.
* @nullable
@@ -89329,8 +89329,8 @@ export namespace Schemas {
expires?: string | null;
/** 'run' (the test still executes but cannot fail the suite) or 'skip' (not run at all). Defaults to 'run'.
*
- * * `run` - RUN
- * * `skip` - SKIP */
+ * * `run` - Run
+ * * `skip` - Skip */
mode?: QuarantineModeEnum;
}
@@ -95042,11 +95042,6 @@ export namespace Schemas {
}
export interface RunFailureLogs {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
/** Failed CI jobs of this run with their thinned failure logs, grouped by job. */
jobs: CIJobFailureLog[];
/** Workflow run id the failure logs are for. */
@@ -95055,6 +95050,11 @@ export namespace Schemas {
logs_available: boolean;
/** True when the overall line cap across all jobs was hit. */
truncated: boolean;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
}
export interface RunInsightsResponse {
@@ -107882,8 +107882,8 @@ export namespace Schemas {
export interface TeamTestSignal {
/** Test runner that emitted this signal: 'pytest' or 'jest'.
*
- * * `pytest` - PYTEST
- * * `jest` - JEST */
+ * * `pytest` - Pytest
+ * * `jest` - Jest */
runner: CITestRunnerEnum;
/** Runner-specific test identity (the CI span name), a stable grouping key. */
nodeid: string;
@@ -111233,11 +111233,6 @@ export namespace Schemas {
}
export interface WorkflowHealthItem {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- latest_ci_engine?: CIEngineEnum | null;
/** Repository the workflow runs in. */
repo: RepoRef;
/** Run history across the whole window, oldest first, zero-filled, bucketed by granularity. */
@@ -111307,14 +111302,14 @@ export namespace Schemas {
percentile_run_count?: number;
/** Runs on merge-queue gate branches (trunk-merge/**) in the window, counted regardless of branch or run_scope. Non-zero marks a workflow the queue runs before a merge lands, the closest available proxy for a required check. */
merge_queue_run_count?: number;
- }
-
- export interface WorkflowJob {
/** CI execution engine; null when unknown.
*
* * `github_actions` - GitHub Actions
* * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
+ latest_ci_engine?: CIEngineEnum | null;
+ }
+
+ export interface WorkflowJob {
/** Integer job id; unique only together with ci_engine. */
id: number;
/** The workflow run id this job belongs to. */
@@ -111352,6 +111347,11 @@ export namespace Schemas {
* @nullable
*/
estimated_cost_usd: number | null;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
/**
* Source-native run id; use with ci_engine for identity.
* @nullable
@@ -111558,11 +111558,6 @@ export namespace Schemas {
}
export interface WorkflowRunActivityPoint {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
/** Integer run id; unique only together with ci_engine. */
run_id: number;
/**
@@ -111583,6 +111578,11 @@ export namespace Schemas {
pr_number: number;
/** Head commit SHA of the run/commit, or '' when unknown. */
head_sha: string;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
}
export interface WorkflowRunActivity {
@@ -111595,11 +111595,6 @@ export namespace Schemas {
}
export interface WorkflowRunDetail {
- /** CI execution engine; null when unknown.
- *
- * * `github_actions` - GitHub Actions
- * * `depot_ci` - Depot CI */
- ci_engine?: CIEngineEnum | null;
/** Repository the run belongs to. */
repo: RepoRef;
/** Integer run id; unique only together with ci_engine. */
@@ -111643,6 +111638,11 @@ export namespace Schemas {
commit_pr_number: number | null;
/** True when a merge queue pushed this run to gate pr_number, rather than the author pushing it. Count it when measuring CI; drop it when counting what the author did. */
is_merge_queue: boolean;
+ /** CI execution engine; null when unknown.
+ *
+ * * `github_actions` - GitHub Actions
+ * * `depot_ci` - Depot CI */
+ ci_engine?: CIEngineEnum | null;
/**
* Source-native run id; use with ci_engine for identity.
* @nullable