Description:
If you open a PR as a draft and mark it ready for review later, the time it sat in draft never shows up in the Lead Time breakdown. None of the five segments cover that window. And because Lead Time is just the five segments added together, that time disappears from the total too.
The total in the breakdown should match the real time the change took — first commit to deployment. For draft PRs it doesn't, and the gap is exactly the draft duration.
Steps to reproduce:
- Open a PR as a draft right after pushing your first commit.
- Leave it in draft for a while (say, overnight).
- Mark it ready for review.
- Approve straight away.
- Merge. Let the deploy workflow run.
- Wait for the next sync.
- Look at the team's Lead Time breakdown and compare the sum of the five segments to the actual time from first commit to deploy.
Expected behavior:
The "Commit" segment (first_commit_to_open) should measure the time from the first commit up to when the PR is ready for review, instead of up to when the PR was created. For PRs opened directly as non-draft, behaviour is unchanged (PR creation and ready-for-review happen at the same instant). For PRs opened as drafts, the draft duration becomes part of the Commit segment.
Actual behavior:
| Time (UTC) |
Event |
Δ |
| Mon 14:43:08 |
First commit |
— |
| Mon 14:43:28 |
PR opened (as draft) |
+20s |
| Mon 14:43:28 → Tue 08:23:15 |
PR sits in draft |
+17h 39m 47s |
| Tue 08:23:15 |
ready_for_review event |
— |
| Tue 08:24:46 |
Reviewer approves |
+1m 31s |
| Tue 08:24:57 |
PR merged |
+11s |
| Tue 08:25:37 |
Deploy workflow run_started_at |
+40s |
Using the timeline from above, the dashboard reports a Lead Time of 2m 42s for a PR that actually took ~17h 42m from first commit to deploy. The ~17h 39m the PR sat in draft isn't counted anywhere — first_commit_to_open stops at pr.created_at and first_response_time starts at ready_for_review, so the draft window falls between them and gets dropped from the sum.
Additional context
#634
Description:
If you open a PR as a draft and mark it ready for review later, the time it sat in draft never shows up in the Lead Time breakdown. None of the five segments cover that window. And because Lead Time is just the five segments added together, that time disappears from the total too.
The total in the breakdown should match the real time the change took — first commit to deployment. For draft PRs it doesn't, and the gap is exactly the draft duration.
Steps to reproduce:
Expected behavior:
The "Commit" segment (first_commit_to_open) should measure the time from the first commit up to when the PR is ready for review, instead of up to when the PR was created. For PRs opened directly as non-draft, behaviour is unchanged (PR creation and ready-for-review happen at the same instant). For PRs opened as drafts, the draft duration becomes part of the Commit segment.
Actual behavior:
ready_for_revieweventrun_started_atUsing the timeline from above, the dashboard reports a Lead Time of 2m 42s for a PR that actually took ~17h 42m from first commit to deploy. The ~17h 39m the PR sat in draft isn't counted anywhere — first_commit_to_open stops at pr.created_at and first_response_time starts at ready_for_review, so the draft window falls between them and gets dropped from the sum.
Additional context
#634