Skip to content

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

feat(engineering-analytics): stack the three lead-time box plots on the Health tab (#91029)

Paul D'Ambrad51adf3e5737
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 2c02e97a8364..d8c4ab0612f2 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6401,17 +6401,17 @@ snapshots:
scenes-app-discussions--threads--light:
hash: v1.k794b7964.28ac830bf83be5cbb6d7a397d67c9b9c61711904a822de38402b82220b0f7a49.7wENY7hvo1-qAJwq5fcsvKGJsfRAF_vDkpnM8iqFZcc
scenes-app-engineering-analytics-health--health--dark:
- hash: v1.k794b7964.b8902c89008241c64ee3bfdcb8c44487b554e2497a8584f97cc67f43cb4c1c69.QPnLLWzp2_Ws0wFksijbEcIvTfD8Fb874rD2NISaVEE
+ hash: v1.k794b7964.0698630f83c06821e9d53560c494f1af19db540011811a1dcdc991ba671d17e1.wGW1HadqzVFD6pQY0t78xDUa_2cRYoVdw3TlTut2Msw
scenes-app-engineering-analytics-health--health--light:
- hash: v1.k794b7964.459fb12016f38047bfbf269d4635f49f6e66f5f92957d1ad9530d3471a8154ae.xBetEUqMF_2UZCjM3dC_O-XVan0KimokVlMyt70U144
+ hash: v1.k794b7964.6cbd8e6f7aa43598813da531f94c49b5183eb94657fde7220b5b93827c2416a8.6RZB5K8kWBt7BSu7ISVkrceeM8SrqyjEnXzL0wMol8Y
scenes-app-engineering-analytics-health--health-without-deploy-data--dark:
- hash: v1.k794b7964.58b497c9d65b91a820cd6fbf7decc0627b6006946df570824ec6f3a68e49c230.MKWpeh48gtixnh7IiCceKSqs7MGfIZOC5hnQgArT4CE
+ hash: v1.k794b7964.e64ec2c7f4ed0762b6d3ce9d75ee14d005480b50c9717ff2186760ee44d1ed4e.TqU2tqFhhU9TAMa5r5bYL4sATkxF2gVcbY1KwoBgefE
scenes-app-engineering-analytics-health--health-without-deploy-data--light:
- hash: v1.k794b7964.83590800de556a39cd9e85c19cde97d011a2e56765b06dc765868b03dd886097.3Ilkg3NQEt-PVwQaBuo6EVIwqwPH_1o7MFPzNddaPPI
- scenes-app-engineering-analytics-merge-to-deploy-box-plot--default--dark:
- hash: v1.k794b7964.1c0d26b47aadd2aa58a53db3c1c43d50bf74204bf46fa0aa1206e77a96049c07.hdnRtkYHoot4Nik9IeOYVGzQP5bsA0b93Jb6jkvZ-h0
- scenes-app-engineering-analytics-merge-to-deploy-box-plot--default--light:
- hash: v1.k794b7964.f9dd9678e343abe67837ac9177e67678b401b1a483b2737ab864c68b4e709e96.wQEuD6-8vgiJ-VBOdfNXccMoMwGBy2OLrzoGnFq_hSU
+ hash: v1.k794b7964.ba70bf7cbfe68960e5f69d0113958817c0730924483b2d2754d6fb4f69d75521.G4uDkutjqMoenrNbQXODQ8R5Zh3E-CMqWOGIW02FCOo
+ scenes-app-engineering-analytics-lead-time-box-plot--default--dark:
+ hash: v1.k794b7964.a88a986e975778b0ad232c7e8f75211b0d66acb126082b2f781fd9d5641ff28d.P4_7HWOcC-Z8pGr_2GTGkAc_fzupx_TRaZdlauEmVQE
+ scenes-app-engineering-analytics-lead-time-box-plot--default--light:
+ hash: v1.k794b7964.040d7b8b88503881e75c0e7d6c0bc8588c6096f1315f75b5071c2721d13f567a.jAkjFsaMTKwsbxZsBriJ6JoPzwYGQSXgG9ERQd0H06E
scenes-app-engineering-analytics-repo-overview--repo-overview--dark:
hash: v1.k794b7964.93f0784927beb8f29f7060b98795fc4200dc169ef7f5da3fe255cf5e143c0ff3.-5znSrlummkvLSBLsYSKNzJ3Co4GxMNxsndYCtHeMms
scenes-app-engineering-analytics-repo-overview--repo-overview--light:
diff --git a/products/engineering_analytics/backend/facade/contracts.py b/products/engineering_analytics/backend/facade/contracts.py
index 501e4157bf1f..8fd0863113ed 100644
--- a/products/engineering_analytics/backend/facade/contracts.py
+++ b/products/engineering_analytics/backend/facade/contracts.py
@@ -1232,13 +1232,13 @@ class DeploymentFrequencyBucket:
@dataclass(frozen=True)
-class MergeToDeployBucket:
- """One time bucket of per-PR merge-to-deploy seconds — the box-plot distribution of how long
- merged PRs waited until the first successful deployment containing their merge (resolved
- through the deploy's head commit; bots and drafts excluded, per the locked cycle-time
- recipe). Keyed on deploy time: a PR lands in the bucket its deploy succeeded in. The measure
- is named for exactly what it is: merge to deploy, not the full commit-to-deploy DORA lead
- time (pre-merge time is on the other cards).
+class LeadTimeBucket:
+ """One time bucket of a per-PR duration distribution over deployed PRs — the box-plot shape
+ behind the three lead-time stages (open to merge, merge to deploy, open to deploy). All
+ three series measure the SAME population: merged PRs attributed to a successful deployment
+ (containment resolved through the deploy's head commit; bots and drafts excluded, per the
+ locked cycle-time recipe), keyed on deploy time — a PR lands in the bucket its deploy
+ succeeded in, so the stages decompose against each other bucket by bucket.
Buckets where nothing deployed carry ``deployed_pr_count`` 0 and null stats (a gap).
"""
@@ -1246,8 +1246,8 @@ class MergeToDeployBucket:
bucket_start: datetime
# PRs whose first post-merge successful deployment landed in this bucket.
deployed_pr_count: int
- # Distribution of merged_at → first successful deploy, in seconds, over those PRs — the
- # six-number summary a box plot draws (box p25→p75, median line, mean marker, whiskers).
+ # Distribution of the stage's duration, in seconds, over those PRs — the six-number
+ # summary a box plot draws (box p25→p75, median line, mean marker, whiskers).
min_seconds: float | None
p25_seconds: float | None
p50_seconds: float | None
@@ -1330,8 +1330,14 @@ class DoraOverview:
# Successful deployments per bucket across the window, oldest first, zero-filled.
deployment_frequency_series: list[DeploymentFrequencyBucket]
# Merge-to-deploy distribution per bucket across the window, oldest first — the box-plot series.
- merge_to_deploy_series: list[MergeToDeployBucket]
- # Bucket width of both series, chosen to fit the window: 'hour', 'day', or 'week'.
+ merge_to_deploy_series: list[LeadTimeBucket]
+ # Open-to-merge distribution over the SAME deployed PRs and buckets as merge_to_deploy_series,
+ # so the two stages compare bucket by bucket. Not the all-merged-PRs cycle time.
+ open_to_merge_series: list[LeadTimeBucket]
+ # Open-to-deploy distribution over the same deployed PRs and buckets: the full open → first
+ # successful deploy span the two stages above compose into.
+ open_to_deploy_series: list[LeadTimeBucket]
+ # Bucket width of every series, chosen to fit the window: 'hour', 'day', or 'week'.
series_granularity: str
diff --git a/products/engineering_analytics/backend/logic/queries/dora.py b/products/engineering_analytics/backend/logic/queries/dora.py
index 6fb5f253377f..94091900203f 100644
--- a/products/engineering_analytics/backend/logic/queries/dora.py
+++ b/products/engineering_analytics/backend/logic/queries/dora.py
@@ -36,7 +36,7 @@ from posthog.dataclasses import frozen
from products.engineering_analytics.backend.facade.contracts import (
DeploymentFrequencyBucket,
DoraOverview,
- MergeToDeployBucket,
+ LeadTimeBucket,
)
from products.engineering_analytics.backend.logic.queries._buckets import (
Granularity,
@@ -179,6 +179,7 @@ _DEPLOYED_PRS_CTE = """
deployed_prs AS (
SELECT
pr.number AS number,
+ pr.created_at AS created_at,
pr.merged_at AS merged_at,
min(h.first_success_at) AS deployed_at
FROM __PR_SOURCE__ AS pr
@@ -189,11 +190,20 @@ _DEPLOYED_PRS_CTE = """
AND NOT pr.is_draft
__TEAM_FILTER__
AND h.head_merged_at >= pr.merged_at
- GROUP BY pr.number, pr.merged_at
+ GROUP BY pr.number, pr.created_at, pr.merged_at
)
"""
-_LEAD_TIME_INNER = "SELECT deployed_at, dateDiff('second', merged_at, deployed_at) AS lead_seconds FROM deployed_prs"
+# The three lead-time stages, one row per deployed PR: the box-plot series all read the SAME
+# population, so open → merge and merge → deploy visually compose into open → deploy.
+_LEAD_TIME_INNER = """
+ SELECT
+ deployed_at,
+ dateDiff('second', merged_at, deployed_at) AS lead_seconds,
+ dateDiff('second', created_at, merged_at) AS open_to_merge_seconds,
+ dateDiff('second', created_at, deployed_at) AS open_to_deploy_seconds
+ FROM deployed_prs
+"""
# The two one-row CROSS JOIN halves put attribution coverage on the same round trip: how many
# PRs merged in the window at all (same bot/draft/team recipe), and how many of those an
@@ -228,16 +238,28 @@ _LEAD_TIME_HEADLINE_SELECT = f"""
) AS merged
"""
+
+def _box_stat_columns(column: str, prefix: str) -> str:
+ """The six-number box-plot summary of ``column``, aliased under ``prefix``."""
+ return (
+ f"min({column}) AS {prefix}_min, quantile(0.25)({column}) AS {prefix}_p25, "
+ f"quantile(0.5)({column}) AS {prefix}_p50, avg({column}) AS {prefix}_mean, "
+ f"quantile(0.75)({column}) AS {prefix}_p75, max({column}) AS {prefix}_max"
+ )
+
+
+# The three lead-time stages, in the order their six-stat columns appear in
+# _LEAD_TIME_SERIES_SELECT. _lead_time_bucket's ``stage`` index walks this same list, so the
+# SQL column order and the Python row-slice order can't drift independently.
+_LEAD_TIME_STAGES = (("mtd", "lead_seconds"), ("otm", "open_to_merge_seconds"), ("otd", "open_to_deploy_seconds"))
+_STAGE_STAT_WIDTH = 6 # min, p25, p50, mean, p75, max
+_STAGE_MERGE_TO_DEPLOY, _STAGE_OPEN_TO_MERGE, _STAGE_OPEN_TO_DEPLOY = range(len(_LEAD_TIME_STAGES))
+
_LEAD_TIME_SERIES_SELECT = f"""
SELECT
__BUCKET_FN__ AS bucket_start,
count() AS deployed_pr_count,
- min(lead_seconds) AS min_seconds,
- quantile(0.25)(lead_seconds) AS p25_seconds,
- quantile(0.5)(lead_seconds) AS p50_seconds,
- avg(lead_seconds) AS mean_seconds,
- quantile(0.75)(lead_seconds) AS p75_seconds,
- max(lead_seconds) AS max_seconds
+ {", ".join(_box_stat_columns(column, prefix) for prefix, column in _LEAD_TIME_STAGES)}
FROM ({_LEAD_TIME_INNER})
WHERE deployed_at >= {{date_from}} __DATE_TO_DEPLOYED__
GROUP BY bucket_start
@@ -358,6 +380,8 @@ def _empty_overview(
latest_deploy_status_at=None,
deployment_frequency_series=[],
merge_to_deploy_series=[],
+ open_to_merge_series=[],
+ open_to_deploy_series=[],
series_granularity=granularity,
)
@@ -446,7 +470,9 @@ class _LeadTime:
# PRs merged in the window (the locked recipe), and how many of those a deploy attributed.
merged_count: int
attributed_count: int
- series: list[MergeToDeployBucket]
+ series: list[LeadTimeBucket]
+ open_to_merge_series: list[LeadTimeBucket]
+ open_to_deploy_series: list[LeadTimeBucket]
@property
def unattributed_share(self) -> float | None:
@@ -461,6 +487,8 @@ _EMPTY_LEAD_TIME = _LeadTime(
merged_count=0,
attributed_count=0,
series=[],
+ open_to_merge_series=[],
+ open_to_deploy_series=[],
)
@@ -499,6 +527,8 @@ def _query_lead_time(scan: _DoraScan, *, github_team: str | None, members_source
)
rows = scan.run(series_sql, query_type="engineering_analytics.dora_lead_time_series")
stats_by_bucket = {normalize_bucket(row[0], scan.granularity): row[1:] for row in (rows.results or [])}
+ buckets = scan.window_buckets()
+ # Row layout mirrors _LEAD_TIME_SERIES_SELECT: count, then a six-stat slice per stage.
return _LeadTime(
deployed_count=int(deployed_cur or 0),
deployed_count_prev=int(deployed_prev or 0),
@@ -506,7 +536,15 @@ def _query_lead_time(scan: _DoraScan, *, github_team: str | None, members_source
median_seconds_prev=opt_float(median_prev),
merged_count=int(merged_cur or 0),
attributed_count=int(attributed_cur or 0),
- series=[_lead_time_bucket(bucket, stats_by_bucket.get(bucket)) for bucket in scan.window_buckets()],
+ series=[
+ _lead_time_bucket(bucket, stats_by_bucket.get(bucket), stage=_STAGE_MERGE_TO_DEPLOY) for bucket in buckets
+ ],
+ open_to_merge_series=[
+ _lead_time_bucket(bucket, stats_by_bucket.get(bucket), stage=_STAGE_OPEN_TO_MERGE) for bucket in buckets
+ ],
+ open_to_deploy_series=[
+ _lead_time_bucket(bucket, stats_by_bucket.get(bucket), stage=_STAGE_OPEN_TO_DEPLOY) for bucket in buckets
+ ],
)
@@ -600,13 +638,17 @@ def query_dora_overview(
latest_deploy_status_at=outcomes.latest_status_at,
deployment_frequency_series=_query_frequency_series(scan),
merge_to_deploy_series=lead.series,
+ open_to_merge_series=lead.open_to_merge_series,
+ open_to_deploy_series=lead.open_to_deploy_series,
series_granularity=granularity,
)
-def _lead_time_bucket(bucket: datetime, stats: tuple[Any, Any, Any, Any, Any, Any, Any] | None) -> MergeToDeployBucket:
+def _lead_time_bucket(bucket: datetime, stats: tuple[Any, ...] | None, *, stage: int) -> LeadTimeBucket:
+ """One stage's bucket off a series row: ``stats`` is (count, then a _STAGE_STAT_WIDTH-wide
+ slice per stage, in _LEAD_TIME_STAGES order); ``stage`` picks which slice."""
if not stats:
- return MergeToDeployBucket(
+ return LeadTimeBucket(
bucket_start=bucket,
deployed_pr_count=0,
min_seconds=None,
@@ -616,8 +658,10 @@ def _lead_time_bucket(bucket: datetime, stats: tuple[Any, Any, Any, Any, Any, An
p75_seconds=None,
max_seconds=None,
)
- n, min_s, p25, p50, mean, p75, max_s = stats
- return MergeToDeployBucket(
+ n = stats[0]
+ offset = 1 + stage * _STAGE_STAT_WIDTH
+ min_s, p25, p50, mean, p75, max_s = stats[offset : offset + _STAGE_STAT_WIDTH]
+ return LeadTimeBucket(
bucket_start=bucket,
deployed_pr_count=int(n or 0),
min_seconds=opt_float(min_s),
diff --git a/products/engineering_analytics/backend/presentation/serializers/dora.py b/products/engineering_analytics/backend/presentation/serializers/dora.py
index 35cd65da0e21..3cbde9b79584 100644
--- a/products/engineering_analytics/backend/presentation/serializers/dora.py
+++ b/products/engineering_analytics/backend/presentation/serializers/dora.py
@@ -5,7 +5,7 @@ from rest_framework_dataclasses.serializers import DataclassSerializer
from products.engineering_analytics.backend.facade.contracts import (
DeploymentFrequencyBucket,
DoraOverview,
- MergeToDeployBucket,
+ LeadTimeBucket,
)
@@ -23,9 +23,9 @@ class DeploymentFrequencyBucketSerializer(DataclassSerializer):
}
-class MergeToDeployBucketSerializer(DataclassSerializer):
+class LeadTimeBucketSerializer(DataclassSerializer):
class Meta:
- dataclass = MergeToDeployBucket
+ dataclass = LeadTimeBucket
extra_kwargs = {
"bucket_start": {
"help_text": "Bucket start, aligned to series_granularity (top of hour, midnight, or Monday). "
@@ -33,30 +33,31 @@ class MergeToDeployBucketSerializer(DataclassSerializer):
},
"deployed_pr_count": {
"help_text": "PRs whose first post-merge successful deployment landed in this bucket "
- "(bots and drafts excluded; narrowed by github_team when given)."
+ "(bots and drafts excluded; narrowed by github_team when given). The same population "
+ "backs every lead-time series, so the stages compare bucket by bucket."
},
"min_seconds": {
- "help_text": "Fastest merge-to-deploy in this bucket, in seconds. Null when nothing deployed.",
+ "help_text": "Fastest duration for this stage in this bucket, in seconds. Null when nothing deployed.",
"allow_null": True,
},
"p25_seconds": {
- "help_text": "25th percentile merge-to-deploy seconds. Null when nothing deployed.",
+ "help_text": "25th percentile of the stage's duration, in seconds. Null when nothing deployed.",
"allow_null": True,
},
"p50_seconds": {
- "help_text": "Median merge-to-deploy seconds. Null when nothing deployed.",
+ "help_text": "Median of the stage's duration, in seconds. Null when nothing deployed.",
"allow_null": True,
},
"mean_seconds": {
- "help_text": "Mean merge-to-deploy seconds. Null when nothing deployed.",
+ "help_text": "Mean of the stage's duration, in seconds. Null when nothing deployed.",
"allow_null": True,
},
"p75_seconds": {
- "help_text": "75th percentile merge-to-deploy seconds. Null when nothing deployed.",
+ "help_text": "75th percentile of the stage's duration, in seconds. Null when nothing deployed.",
"allow_null": True,
},
"max_seconds": {
- "help_text": "Slowest merge-to-deploy in this bucket, in seconds. Null when nothing deployed.",
+ "help_text": "Slowest duration for this stage in this bucket, in seconds. Null when nothing deployed.",
"allow_null": True,
},
}
@@ -68,12 +69,24 @@ class DoraOverviewSerializer(DataclassSerializer):
help_text="Successful deployments per bucket across the window, oldest first, zero-filled, "
"bucketed by series_granularity. Empty when the deploy tables aren't synced.",
)
- merge_to_deploy_series = MergeToDeployBucketSerializer(
+ merge_to_deploy_series = LeadTimeBucketSerializer(
many=True,
help_text="Merge-to-deploy distribution per bucket across the window, oldest first — the box-plot "
"series (min/p25/p50/mean/p75/max seconds per bucket). Empty when the deploy tables aren't synced, "
"or when github_team was passed without membership data synced.",
)
+ open_to_merge_series = LeadTimeBucketSerializer(
+ many=True,
+ help_text="Open-to-merge distribution over the SAME deployed PRs and buckets as "
+ "merge_to_deploy_series, so the two stages compare bucket by bucket. Not the "
+ "all-merged-PRs cycle time. Empty in the same cases as merge_to_deploy_series.",
+ )
+ open_to_deploy_series = LeadTimeBucketSerializer(
+ many=True,
+ help_text="Open-to-deploy distribution over the same deployed PRs and buckets: the full "
+ "open to first-successful-deploy span the two stages above compose into. Empty in the "
+ "same cases as merge_to_deploy_series.",
+ )
class Meta:
dataclass = DoraOverview
@@ -175,6 +188,6 @@ class DoraOverviewSerializer(DataclassSerializer):
"allow_null": True,
},
"series_granularity": {
- "help_text": "Bucket width of both series, chosen to fit the window: 'hour', 'day', or 'week'."
+ "help_text": "Bucket width of every series, chosen to fit the window: 'hour', 'day', or 'week'."
},
}
diff --git a/products/engineering_analytics/backend/tests/test_dora.py b/products/engineering_analytics/backend/tests/test_dora.py
index d51d97dc783e..4f2def16d1e5 100644
--- a/products/engineering_analytics/backend/tests/test_dora.py
+++ b/products/engineering_analytics/backend/tests/test_dora.py
@@ -231,6 +231,23 @@ class TestDoraQuery(ClickhouseTestMixin, BaseTest):
assert empty.deployed_pr_count == 0
assert empty.p50_seconds is None
+ # The stage series share the deployed-PR population and buckets, so a wrong stage slice
+ # in the shared series row would surface here as swapped values.
+ otm = {bucket.bucket_start: bucket for bucket in result.open_to_merge_series}
+ otd = {bucket.bucket_start: bucket for bucket in result.open_to_deploy_series}
+ assert len(result.open_to_merge_series) == len(result.open_to_deploy_series) == 11
+ # PR 1: created Jan 11 08:00, merged Jan 12 08:00, deployed Jan 12 10:00.
+ assert otm[datetime(2026, 1, 12)].deployed_pr_count == 1
+ assert otm[datetime(2026, 1, 12)].p50_seconds == 86400.0
+ assert otd[datetime(2026, 1, 12)].p50_seconds == 93600.0
+ # PR 2: 25.5h open→merge, 28h open→deploy. PR 6: 24h open→merge, 51h open→deploy.
+ assert otm[datetime(2026, 1, 13)].min_seconds == 86400.0
+ assert otm[datetime(2026, 1, 13)].max_seconds == 91800.0
+ assert otd[datetime(2026, 1, 13)].min_seconds == 100800.0
+ assert otd[datetime(2026, 1, 13)].max_seconds == 183600.0
+ assert otm[datetime(2026, 1, 15)].deployed_pr_count == 0
+ assert otd[datetime(2026, 1, 15)].p50_seconds is None
+
def test_restore_recovery_excluded_when_it_lands_after_date_to(self):
# d2 fails Jan 13 10:00, recovers via d3's success at Jan 13 12:00 (see _seeded_curated).
# A historical report ending before that recovery must not count it: "no recovery in the
diff --git a/products/engineering_analytics/frontend/components/MergeToDeployBoxPlot.stories.tsx b/products/engineering_analytics/frontend/components/LeadTimeBoxPlot.stories.tsx
similarity index 77%
rename from products/engineering_analytics/frontend/components/MergeToDeployBoxPlot.stories.tsx
rename to products/engineering_analytics/frontend/components/LeadTimeBoxPlot.stories.tsx
index 47008e57b990..e98ec8fa6b04 100644
--- a/products/engineering_analytics/frontend/components/MergeToDeployBoxPlot.stories.tsx
+++ b/products/engineering_analytics/frontend/components/LeadTimeBoxPlot.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react'
-import { MergeToDeployBoxPlot, type BoxPlotBucket } from './MergeToDeployBoxPlot'
+import { LeadTimeBoxPlot, type BoxPlotBucket } from './LeadTimeBoxPlot'
function bucket(
label: string,
@@ -42,27 +42,30 @@ const BUCKETS: BoxPlotBucket[] = [
bucket('Jul 14', 11, [600, 1200, 2400, 2900, 3600, 7200]),
]
-const meta: Meta<typeof MergeToDeployBoxPlot> = {
- title: 'Scenes-App/Engineering Analytics/Merge To Deploy Box Plot',
- component: MergeToDeployBoxPlot,
+const meta: Meta<typeof LeadTimeBoxPlot> = {
+ title: 'Scenes-App/Engineering Analytics/Lead Time Box Plot',
+ component: LeadTimeBoxPlot,
parameters: {
layout: 'fullscreen',
testOptions: {
snapshotBrowsers: ['chromium'],
- waitForSelector: '[data-attr="merge-to-deploy-box-plot-story"] canvas',
+ waitForSelector: '[data-attr="lead-time-box-plot-story"] canvas',
viewport: { width: 1280, height: 400 },
},
},
decorators: [
(Story) => (
- <div className="p-6" data-attr="merge-to-deploy-box-plot-story">
+ <div className="p-6" data-attr="lead-time-box-plot-story">
<Story />
</div>
),
],
args: {
+ seriesKey: 'merge_to_deploy',
+ seriesLabel: 'Merge to deploy',
buckets: BUCKETS,
formatSeconds: (seconds: number) => `${Math.round(seconds / 60)}m`,
+ dataAttr: 'merge-to-deploy-box-plot',
},
}
diff --git a/products/engineering_analytics/frontend/components/MergeToDeployBoxPlot.tsx b/products/engineering_analytics/frontend/components/LeadTimeBoxPlot.tsx
similarity index 80%
rename from products/engineering_analytics/frontend/components/MergeToDeployBoxPlot.tsx
rename to products/engineering_analytics/frontend/components/LeadTimeBoxPlot.tsx
index aa9668139c35..92af7018d5ab 100644
--- a/products/engineering_analytics/frontend/components/MergeToDeployBoxPlot.tsx
+++ b/products/engineering_analytics/frontend/components/LeadTimeBoxPlot.tsx
@@ -18,11 +18,15 @@ export interface BoxPlotBucket {
maxSeconds: number | null
}
-export interface MergeToDeployBoxPlotProps {
+export interface LeadTimeBoxPlotProps {
+ /** Series identity: chart key and the label shown in the tooltip legend. */
+ seriesKey: string
+ seriesLabel: string
/** One entry per bucket, oldest first. */
buckets: BoxPlotBucket[]
/** Value formatter for the tooltip rows (seconds in, short label out). */
formatSeconds: (seconds: number) => string
+ dataAttr: string
className?: string
}
@@ -56,33 +60,41 @@ function toDatum(bucket: BoxPlotBucket): BoxPlotDatum | null {
/**
* One box-and-whisker per bucket (quill BoxPlot): whisker min→max, box p25→p75, a median line
* and a mean dot, on a shared seconds scale. Empty buckets stay empty slots so a quiet stretch
- * reads as "nothing deployed", not missing data.
+ * reads as "nothing deployed", not missing data. One lead-time stage per instance; the Health
+ * tab stacks three so the stages compare bucket by bucket.
*/
-export function MergeToDeployBoxPlot({ buckets, formatSeconds, className }: MergeToDeployBoxPlotProps): JSX.Element {
+export function LeadTimeBoxPlot({
+ seriesKey,
+ seriesLabel,
+ buckets,
+ formatSeconds,
+ dataAttr,
+ className,
+}: LeadTimeBoxPlotProps): JSX.Element {
const theme = useChartTheme()
const labels = useMemo(() => buckets.map((bucket) => bucket.label), [buckets])
const series = useMemo<BoxPlotSeries<BucketMeta>[]>(
() => [
{
- key: 'merge_to_deploy',
- label: 'Merge to deploy',
+ key: seriesKey,
+ label: seriesLabel,
data: buckets.map(toDatum),
meta: { counts: buckets.map((bucket) => bucket.count) },
},
],
- [buckets]
+ [seriesKey, seriesLabel, buckets]
)
return (
// The chart's root is a `flex-1` child, so the sized wrapper must be a flex column —
// in a plain block parent the canvas measures 0px tall and paints nothing.
- <div className={cn('flex h-64 flex-col', className)}>
+ <div className={cn('flex h-48 flex-col', className)}>
<BoxPlot<BucketMeta>
series={series}
labels={labels}
theme={theme}
config={{ yTickFormatter: formatSeconds }}
- dataAttr="merge-to-deploy-box-plot"
- tooltip={(ctx) => <BucketTooltip ctx={ctx} formatSeconds={formatSeconds} />}
+ dataAttr={dataAttr}
+ tooltip={(ctx) => <BucketTooltip ctx={ctx} dataAttr={dataAttr} formatSeconds={formatSeconds} />}
/>
</div>
)
@@ -90,9 +102,11 @@ export function MergeToDeployBoxPlot({ buckets, formatSeconds, className }: Merg
function BucketTooltip({
ctx,
+ dataAttr,
formatSeconds,
}: {
ctx: BoxPlotTooltipContext<BucketMeta>
+ dataAttr: string
formatSeconds: (seconds: number) => string
}): JSX.Element | null {
const entry = ctx.seriesData[0]
@@ -110,7 +124,7 @@ function BucketTooltip({
['Min', datum.min],
]
return (
- <TooltipSurface data-attr="merge-to-deploy-box-plot-tooltip">
+ <TooltipSurface data-attr={`${dataAttr}-tooltip`}>
<div className="font-semibold">{ctx.label}</div>
<div className="mb-1 opacity-70">
{count} PR{count === 1 ? '' : 's'} deployed
diff --git a/products/engineering_analytics/frontend/generated/api.schemas.ts b/products/engineering_analytics/frontend/generated/api.schemas.ts
index 7261830fa2e7..8f24dc7ecb55 100644
--- a/products/engineering_analytics/frontend/generated/api.schemas.ts
+++ b/products/engineering_analytics/frontend/generated/api.schemas.ts
@@ -208,38 +208,38 @@ export interface DeploymentFrequencyBucketApi {
deployment_count: number
}
-export interface MergeToDeployBucketApi {
+export interface LeadTimeBucketApi {
/** Bucket start, aligned to series_granularity (top of hour, midnight, or Monday). Keyed on deploy time: a PR lands in the bucket its first post-merge deploy succeeded in. */
bucket_start: string
- /** PRs whose first post-merge successful deployment landed in this bucket (bots and drafts excluded; narrowed by github_team when given). */
+ /** PRs whose first post-merge successful deployment landed in this bucket (bots and drafts excluded; narrowed by github_team when given). The same population backs every lead-time series, so the stages compare bucket by bucket. */
deployed_pr_count: number
/**
- * Fastest merge-to-deploy in this bucket, in seconds. Null when nothing deployed.
+ * Fastest duration for this stage in this bucket, in seconds. Null when nothing deployed.
* @nullable
*/
min_seconds: number | null
/**
- * 25th percentile merge-to-deploy seconds. Null when nothing deployed.
+ * 25th percentile of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
p25_seconds: number | null
/**
- * Median merge-to-deploy seconds. Null when nothing deployed.
+ * Median of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
p50_seconds: number | null
/**
- * Mean merge-to-deploy seconds. Null when nothing deployed.
+ * Mean of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
mean_seconds: number | null
/**
- * 75th percentile merge-to-deploy seconds. Null when nothing deployed.
+ * 75th percentile of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
p75_seconds: number | null
/**
- * Slowest merge-to-deploy in this bucket, in seconds. Null when nothing deployed.
+ * Slowest duration for this stage in this bucket, in seconds. Null when nothing deployed.
* @nullable
*/
max_seconds: number | null
@@ -249,7 +249,11 @@ export interface DoraOverviewApi {
/** Successful deployments per bucket across the window, oldest first, zero-filled, bucketed by series_granularity. Empty when the deploy tables aren't synced. */
deployment_frequency_series: DeploymentFrequencyBucketApi[]
/** Merge-to-deploy distribution per bucket across the window, oldest first — the box-plot series (min/p25/p50/mean/p75/max seconds per bucket). Empty when the deploy tables aren't synced, or when github_team was passed without membership data synced. */
- merge_to_deploy_series: MergeToDeployBucketApi[]
+ merge_to_deploy_series: LeadTimeBucketApi[]
+ /** Open-to-merge distribution over the SAME deployed PRs and buckets as merge_to_deploy_series, so the two stages compare bucket by bucket. Not the all-merged-PRs cycle time. Empty in the same cases as merge_to_deploy_series. */
+ open_to_merge_series: LeadTimeBucketApi[]
+ /** Open-to-deploy distribution over the same deployed PRs and buckets: the full open to first-successful-deploy span the two stages above compose into. Empty in the same cases as merge_to_deploy_series. */
+ open_to_deploy_series: LeadTimeBucketApi[]
/** False when the deployments/deployment_statuses tables aren't synced for the selected repo; every other field is then empty or null, never a fake zero. */
deploy_data_available: boolean
/** What the environment filter resolved to: 'production' (deployments GitHub marks production_environment), an exact environment name (the one passed, or the busiest persistent environment when nothing is marked production), or 'persistent' (no persistent environment deployed in the window, so every non-transient one counts). Transient environments (ephemeral per-PR previews) never join a default scope. The scope resolves from deployments in the scan window, so two different windows can resolve different scopes and are not always comparable. */
@@ -324,7 +328,7 @@ export interface DoraOverviewApi {
* @nullable
*/
latest_deploy_status_at: string | null
- /** Bucket width of both series, chosen to fit the window: 'hour', 'day', or 'week'. */
+ /** Bucket width of every series, chosen to fit the window: 'hour', 'day', or 'week'. */
series_granularity: string
}
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx
index 169d150f273c..882839a8b0a1 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.stories.tsx
@@ -28,6 +28,31 @@ const LEAD_TIME_STATS: (number[] | null)[] = [
[13, 600, 1380, 2520, 3500, 4800, 11400],
]
+// Open-to-merge sits an order of magnitude above merge-to-deploy (days, not hours), so the
+// stacked plots visibly differ; open-to-deploy is their per-bucket sum.
+const OPEN_TO_MERGE_STATS: (number[] | null)[] = LEAD_TIME_STATS.map(
+ (stats) => stats && [stats[0], ...stats.slice(1).map((s) => s * 24)]
+)
+const OPEN_TO_DEPLOY_STATS: (number[] | null)[] = LEAD_TIME_STATS.map(
+ (stats) => stats && [stats[0], ...stats.slice(1).map((s) => s * 25)]
+)
+
+function leadTimeSeries(stats: (number[] | null)[]): DoraOverviewApi['merge_to_deploy_series'] {
+ return BUCKET_DAYS.map((day, i) => {
+ const bucket = stats[i]
+ return {
+ bucket_start: `2026-07-${day}T00:00:00Z`,
+ deployed_pr_count: bucket ? bucket[0] : 0,
+ min_seconds: bucket ? bucket[1] : null,
+ p25_seconds: bucket ? bucket[2] : null,
+ p50_seconds: bucket ? bucket[3] : null,
+ mean_seconds: bucket ? bucket[4] : null,
+ p75_seconds: bucket ? bucket[5] : null,
+ max_seconds: bucket ? bucket[6] : null,
+ }
+ })
+}
+
const DORA: DoraOverviewApi = {
deploy_data_available: true,
environment_scope: 'production',
@@ -55,19 +80,9 @@ const DORA: DoraOverviewApi = {
bucket_start: `2026-07-${day}T00:00:00Z`,
deployment_count: FREQUENCY_COUNTS[i],
})),
- merge_to_deploy_series: BUCKET_DAYS.map((day, i) => {
- const stats = LEAD_TIME_STATS[i]
- return {
- bucket_start: `2026-07-${day}T00:00:00Z`,
- deployed_pr_count: stats ? stats[0] : 0,
- min_seconds: stats ? stats[1] : null,
- p25_seconds: stats ? stats[2] : null,
- p50_seconds: stats ? stats[3] : null,
- mean_seconds: stats ? stats[4] : null,
- p75_seconds: stats ? stats[5] : null,
- max_seconds: stats ? stats[6] : null,
- }
- }),
+ merge_to_deploy_series: leadTimeSeries(LEAD_TIME_STATS),
+ open_to_merge_series: leadTimeSeries(OPEN_TO_MERGE_STATS),
+ open_to_deploy_series: leadTimeSeries(OPEN_TO_DEPLOY_STATS),
series_granularity: 'day',
}
@@ -97,6 +112,8 @@ const EMPTY_DORA: DoraOverviewApi = {
latest_deploy_status_at: null,
deployment_frequency_series: [],
merge_to_deploy_series: [],
+ open_to_merge_series: [],
+ open_to_deploy_series: [],
}
const meta: Meta = {
@@ -108,8 +125,12 @@ const meta: Meta = {
mockDate: '2026-07-15',
featureFlags: [FEATURE_FLAGS.ENGINEERING_ANALYTICS],
testOptions: {
- // Past the skeletons once the box-plot chart has rendered.
- waitForSelector: '[data-attr="engineering-analytics-dora-box-plot"] canvas',
+ // Past the skeletons once all three stacked box-plot charts have rendered.
+ waitForSelector: [
+ '[data-attr="engineering-analytics-dora-open-to-deploy-box-plot"] canvas',
+ '[data-attr="engineering-analytics-dora-open-to-merge-box-plot"] canvas',
+ '[data-attr="engineering-analytics-dora-box-plot"] canvas',
+ ],
},
},
decorators: [
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.tsx
index 6eba5ed82ce4..26d738b21ceb 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsHealth.tsx
@@ -8,7 +8,7 @@ import { dayjs } from 'lib/dayjs'
import { CIAnalyticsLoadError } from '../components/CIAnalyticsLoadError'
import { ConnectGitHubSource } from '../components/ConnectGitHubSource'
-import { MergeToDeployBoxPlot } from '../components/MergeToDeployBoxPlot'
+import { LeadTimeBoxPlot } from '../components/LeadTimeBoxPlot'
import { MetricTile, percentChange, pointChange } from '../components/MetricTile'
import { ScopeBar, SourceScopeChip } from '../components/ScopeBar'
import { Section } from '../components/Section'
@@ -24,6 +24,8 @@ export function EngineeringAnalyticsHealth(): JSX.Element {
environment,
githubTeam,
boxPlotBuckets,
+ openToMergeBuckets,
+ openToDeployBuckets,
frequencyCounts,
frequencyIsoLabels,
environmentScopeLabel,
@@ -36,6 +38,32 @@ export function EngineeringAnalyticsHealth(): JSX.Element {
() => [{ key: 'deployments', label: 'Deployments', data: frequencyCounts }],
[frequencyCounts]
)
+ const leadTimeStages = [
+ {
+ title: 'Open to deploy',
+ seriesKey: 'open_to_deploy',
+ seriesLabel: 'Open to deploy',
+ buckets: openToDeployBuckets,
+ dataAttr: 'open-to-deploy-box-plot',
+ wrapperDataAttr: 'engineering-analytics-dora-open-to-deploy-box-plot',
+ },
+ {
+ title: 'Open to merge',
+ seriesKey: 'open_to_merge',
+ seriesLabel: 'Open to merge',
+ buckets: openToMergeBuckets,
+ dataAttr: 'open-to-merge-box-plot',
+ wrapperDataAttr: 'engineering-analytics-dora-open-to-merge-box-plot',
+ },
+ {
+ title: 'Merge to deploy',
+ seriesKey: 'merge_to_deploy',
+ seriesLabel: 'Merge to deploy',
+ buckets: boxPlotBuckets,
+ dataAttr: 'merge-to-deploy-box-plot',
+ wrapperDataAttr: 'engineering-analytics-dora-box-plot',
+ },
+ ]
if (notConnected) {
return <ConnectGitHubSource />
@@ -170,8 +198,8 @@ export function EngineeringAnalyticsHealth(): JSX.Element {
</div>
<Section
id="merge-to-deploy"
- title="Merge to deploy distribution"
- note="Box per bucket: whisker min to max, box p25 to p75, line at the median, dot at the mean. Buckets key on deploy time."
+ title="Lead time distributions"
+ note="Box per bucket: whisker min to max, box p25 to p75, line at the median, dot at the mean. All three stages cover the same deployed PRs, so they compare bucket by bucket. Buckets key on deploy time."
busy={doraLoading && !!dora}
>
{firstLoad ? (
@@ -184,8 +212,19 @@ export function EngineeringAnalyticsHealth(): JSX.Element {
</div>
) : (
<>
- <div data-attr="engineering-analytics-dora-box-plot">
- <MergeToDeployBoxPlot buckets={boxPlotBuckets} formatSeconds={compactAgeLabel} />
+ <div className="flex flex-col gap-4">
+ {leadTimeStages.map((stage) => (
+ <div key={stage.seriesKey} data-attr={stage.wrapperDataAttr}>
+ <h3 className="m-0 mb-1 text-xs font-semibold text-secondary">{stage.title}</h3>
+ <LeadTimeBoxPlot
+ seriesKey={stage.seriesKey}
+ seriesLabel={stage.seriesLabel}
+ buckets={stage.buckets}
+ formatSeconds={compactAgeLabel}
+ dataAttr={stage.dataAttr}
+ />
+ </div>
+ ))}
</div>
{dora?.unattributed_merged_pr_share != null && dora.unattributed_merged_pr_share > 0 && (
<div
diff --git a/products/engineering_analytics/frontend/scenes/doraLogic.ts b/products/engineering_analytics/frontend/scenes/doraLogic.ts
index fc8e2aa33aca..dd3631602ba3 100644
--- a/products/engineering_analytics/frontend/scenes/doraLogic.ts
+++ b/products/engineering_analytics/frontend/scenes/doraLogic.ts
@@ -3,7 +3,7 @@ import { loaders } from 'kea-loaders'
import { ApiConfig } from 'lib/api'
-import type { BoxPlotBucket } from '../components/MergeToDeployBoxPlot'
+import type { BoxPlotBucket } from '../components/LeadTimeBoxPlot'
import { engineeringAnalyticsDora } from '../generated/api'
import type { DoraOverviewApi } from '../generated/api.schemas'
import { engineeringAnalyticsFiltersLogic } from './engineeringAnalyticsFiltersLogic'
@@ -11,6 +11,21 @@ import { engineeringAnalyticsLogic, formatBucket, type WorkflowGranularity } fro
const projectId = (): string => String(ApiConfig.getCurrentProjectId())
+type LeadTimeSeriesApi = DoraOverviewApi['merge_to_deploy_series']
+
+function toBoxPlotBuckets(series: LeadTimeSeriesApi | undefined, granularity: string): BoxPlotBucket[] {
+ return (series ?? []).map((bucket) => ({
+ label: formatBucket(bucket.bucket_start, granularity as WorkflowGranularity),
+ count: bucket.deployed_pr_count,
+ minSeconds: bucket.min_seconds,
+ p25Seconds: bucket.p25_seconds,
+ p50Seconds: bucket.p50_seconds,
+ meanSeconds: bucket.mean_seconds,
+ p75Seconds: bucket.p75_seconds,
+ maxSeconds: bucket.max_seconds,
+ }))
+}
+
export interface DoraScopeOption {
value: string | null
label: string
@@ -34,6 +49,8 @@ export interface doraLogicValues {
frequencyIsoLabels: string[]
githubTeam: string | null
githubTeamOptions: DoraScopeOption[]
+ openToDeployBuckets: BoxPlotBucket[]
+ openToMergeBuckets: BoxPlotBucket[]
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
@@ -65,6 +82,8 @@ export interface doraLogicActions {
export interface doraLogicMeta {
__keaTypeGenInternalSelectorTypes: {
boxPlotBuckets: (dora: DoraOverviewApi | null) => BoxPlotBucket[]
+ openToMergeBuckets: (dora: DoraOverviewApi | null) => BoxPlotBucket[]
+ openToDeployBuckets: (dora: DoraOverviewApi | null) => BoxPlotBucket[]
frequencyCounts: (dora: DoraOverviewApi | null) => number[]
frequencyIsoLabels: (dora: DoraOverviewApi | null) => string[]
environmentScopeLabel: (dora: DoraOverviewApi | null) => string
@@ -144,19 +163,17 @@ export const doraLogic = kea<doraLogicType>([
boxPlotBuckets: [
(s) => [s.dora],
(dora: DoraOverviewApi | null): BoxPlotBucket[] =>
- (dora?.merge_to_deploy_series ?? []).map((bucket) => ({
- label: formatBucket(
- bucket.bucket_start,
- (dora?.series_granularity ?? 'day') as WorkflowGranularity
- ),
- count: bucket.deployed_pr_count,
- minSeconds: bucket.min_seconds,
- p25Seconds: bucket.p25_seconds,
- p50Seconds: bucket.p50_seconds,
- meanSeconds: bucket.mean_seconds,
- p75Seconds: bucket.p75_seconds,
- maxSeconds: bucket.max_seconds,
- })),
+ toBoxPlotBuckets(dora?.merge_to_deploy_series, dora?.series_granularity ?? 'day'),
+ ],
+ openToMergeBuckets: [
+ (s) => [s.dora],
+ (dora: DoraOverviewApi | null): BoxPlotBucket[] =>
+ toBoxPlotBuckets(dora?.open_to_merge_series, dora?.series_granularity ?? 'day'),
+ ],
+ openToDeployBuckets: [
+ (s) => [s.dora],
+ (dora: DoraOverviewApi | null): BoxPlotBucket[] =>
+ toBoxPlotBuckets(dora?.open_to_deploy_series, dora?.series_granularity ?? 'day'),
],
frequencyCounts: [
(s) => [s.dora],
diff --git a/products/engineering_analytics/mcp/tools.yaml b/products/engineering_analytics/mcp/tools.yaml
index b114045e7ffa..4bf1914a998e 100644
--- a/products/engineering_analytics/mcp/tools.yaml
+++ b/products/engineering_analytics/mcp/tools.yaml
@@ -84,18 +84,19 @@ tools:
description: >
DORA-style deploy metrics over the GitHub deployments + deployment_statuses warehouse pair, each headline
with its previous-window twin: deployment frequency (deploys whose first success status landed in the
- window, per-day normalized, with a bucketed series), merge-to-deploy lead time (median seconds from a PR's
- merge to the first successful deployment at or after it, bots/drafts excluded, with a per-bucket
- min/p25/p50/mean/p75/max box-plot series), and two honest proxies: failed_deployment_share (deployments with
+ window, per-day normalized, with a bucketed series), and lead time across three stages over the same
+ deployed-PR population and buckets — open_to_merge_series (PR open to merge), merge_to_deploy_series (median
+ seconds from a PR's merge to the first successful deployment at or after it, bots/drafts excluded), and
+ open_to_deploy_series (the full open-to-deploy span the other two compose into) — each a per-bucket
+ min/p25/p50/mean/p75/max box-plot series, and two honest proxies: failed_deployment_share (deployments with
a failure/error status over deployments that reached an outcome — NOT true change failure rate, since no
incident data is linked) and median_failed_deploy_to_next_success_seconds (first failure status to the next
successful deploy in the same environment — NOT true time-to-restore, since recovery by anything other than
a deploy is invisible). Environments default to production-marked deploys, falling back to every persistent
(non-transient) environment — ephemeral per-PR preview environments never join a default scope; pass
- environment to scope exactly. Pass github_team (a slug from github_teams) to narrow the PR-scoped
- merge-to-deploy figures to that team's authors — deploy counts stay repo-wide. deploy_data_available is
- false when the deployments endpoints aren't synced on the GitHub source; the fix is enabling them, not
- re-querying.
+ environment to scope exactly. Pass github_team (a slug from github_teams) to narrow the PR-scoped lead-time
+ figures to that team's authors — deploy counts stay repo-wide. deploy_data_available is false when the
+ deployments endpoints aren't synced on the GitHub source; the fix is enabling them, not re-querying.
engineering-analytics-flaky-tests:
operation: engineering_analytics_flaky_tests
enabled: true
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 3e77eba222fe..470743b5ac29 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -28866,38 +28866,38 @@ export namespace Schemas {
Selected: 'selected',
} as const;
- export interface MergeToDeployBucket {
+ export interface LeadTimeBucket {
/** Bucket start, aligned to series_granularity (top of hour, midnight, or Monday). Keyed on deploy time: a PR lands in the bucket its first post-merge deploy succeeded in. */
bucket_start: string;
- /** PRs whose first post-merge successful deployment landed in this bucket (bots and drafts excluded; narrowed by github_team when given). */
+ /** PRs whose first post-merge successful deployment landed in this bucket (bots and drafts excluded; narrowed by github_team when given). The same population backs every lead-time series, so the stages compare bucket by bucket. */
deployed_pr_count: number;
/**
- * Fastest merge-to-deploy in this bucket, in seconds. Null when nothing deployed.
+ * Fastest duration for this stage in this bucket, in seconds. Null when nothing deployed.
* @nullable
*/
min_seconds: number | null;
/**
- * 25th percentile merge-to-deploy seconds. Null when nothing deployed.
+ * 25th percentile of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
p25_seconds: number | null;
/**
- * Median merge-to-deploy seconds. Null when nothing deployed.
+ * Median of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
p50_seconds: number | null;
/**
- * Mean merge-to-deploy seconds. Null when nothing deployed.
+ * Mean of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
mean_seconds: number | null;
/**
- * 75th percentile merge-to-deploy seconds. Null when nothing deployed.
+ * 75th percentile of the stage's duration, in seconds. Null when nothing deployed.
* @nullable
*/
p75_seconds: number | null;
/**
- * Slowest merge-to-deploy in this bucket, in seconds. Null when nothing deployed.
+ * Slowest duration for this stage in this bucket, in seconds. Null when nothing deployed.
* @nullable
*/
max_seconds: number | null;
@@ -28907,7 +28907,11 @@ export namespace Schemas {
/** Successful deployments per bucket across the window, oldest first, zero-filled, bucketed by series_granularity. Empty when the deploy tables aren't synced. */
deployment_frequency_series: DeploymentFrequencyBucket[];
/** Merge-to-deploy distribution per bucket across the window, oldest first — the box-plot series (min/p25/p50/mean/p75/max seconds per bucket). Empty when the deploy tables aren't synced, or when github_team was passed without membership data synced. */
- merge_to_deploy_series: MergeToDeployBucket[];
+ merge_to_deploy_series: LeadTimeBucket[];
+ /** Open-to-merge distribution over the SAME deployed PRs and buckets as merge_to_deploy_series, so the two stages compare bucket by bucket. Not the all-merged-PRs cycle time. Empty in the same cases as merge_to_deploy_series. */
+ open_to_merge_series: LeadTimeBucket[];
+ /** Open-to-deploy distribution over the same deployed PRs and buckets: the full open to first-successful-deploy span the two stages above compose into. Empty in the same cases as merge_to_deploy_series. */
+ open_to_deploy_series: LeadTimeBucket[];
/** False when the deployments/deployment_statuses tables aren't synced for the selected repo; every other field is then empty or null, never a fake zero. */
deploy_data_available: boolean;
/** What the environment filter resolved to: 'production' (deployments GitHub marks production_environment), an exact environment name (the one passed, or the busiest persistent environment when nothing is marked production), or 'persistent' (no persistent environment deployed in the window, so every non-transient one counts). Transient environments (ephemeral per-PR previews) never join a default scope. The scope resolves from deployments in the scan window, so two different windows can resolve different scopes and are not always comparable. */
@@ -28982,7 +28986,7 @@ export namespace Schemas {
* @nullable
*/
latest_deploy_status_at: string | null;
- /** Bucket width of both series, chosen to fit the window: 'hour', 'day', or 'week'. */
+ /** Bucket width of every series, chosen to fit the window: 'hour', 'day', or 'week'. */
series_granularity: string;
}