Skip to content

fix(eng-analytics): bound DORA coverage by window end - #103877

Merged
trunk-io[bot] merged 1 commit into
rauln/ea-12-lead-time-populationfrom
rauln/ea-13-dora-coverage-horizon
Sep 22, 2026
Merged

trunk-io[bot] merged 1 commit into
rauln/ea-12-lead-time-populationfrom
rauln/ea-13-dora-coverage-horizon

Conversation

@rnegron

@rnegron rnegron commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Problem

  • Historical DORA coverage improved incorrectly when deployments arrived after the report ended.

Changes

  • Attribute merged PRs only to first matching deployments within the report horizon.
  • Preserve open-ended reports.
Project 2, Sep 7–21 UTC Before After
Attributed PRs 2,207 2,204
Unattributed share 0% 0.1359%

How did you test this code?

  • Prior merge-SHA and workflow-attribution regressions retained.
  • Removing the horizon predicate changed the regression result from 25% to 0%.

PostHog coding conventions.

Automatic notifications

  • Publish to changelog?

Docs update

  • Restores existing historical-window semantics.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Codex, GPT-5; GPT-6 audit and fixes.

  • Skills: /writing-tests, /writing-code-comments, /simplify, /writing-pr-descriptions, /stacking-prs, /code-review, /qa-team.
  • CodeRabbit CLI skipped at human direction.

@rnegron rnegron self-assigned this Sep 21, 2026
@rnegron
rnegron added this pull request to stack #103875 September 21, 2026 15:59
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

✅ Duplication (Python) — clean

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

⚠️ Backend coverage — 98.0% of changed backend lines covered — 1 uncovered

🧪 Backend test coverage

Patch coverage — changed backend lines (products + core): ████████████████████ 98.0% (74 / 75)

File Patch Uncovered changed lines
products/engineering_analytics/backend/logic/queries/_curated.py 92.9% 518

🤖 Agents: add a test covering the lines above, or note why under "How did you test this code?". Machine-readable gap list: the patch-coverage artifact on this run (gh run download 35651400882 -n patch-coverage), or the coverage-data block at the end of this comment.

Per-product line coverage (touched products)
Product Coverage Lines
engineering_analytics ██████████████████░░ 91.2% 9,935 / 10,891

Report-only. Patch coverage = changed backend lines covered vs origin/master. Sorted lowest first.
Known gaps: lines covered only by Temporal tests show as uncovered; core line numbers may drift if master changed the same file.

@greptile-apps

greptile-apps Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Retrigger

The PR appears safe to merge with no outstanding correctness or rule-compliance issues.

Reviews (2) · Last reviewed commit: "fix(eng-analytics): bound DORA coverage"

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: PostHog/posthog/.coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: d4f555c2-c4c7-4db1-8a9f-d8cc63b56d70

📥 Commits

Reviewing files that changed from the base of the PR and between 9fa3d07 and 0d349c6.

📒 Files selected for processing (2)
  • products/engineering_analytics/backend/logic/queries/dora.py
  • products/engineering_analytics/backend/tests/test_dora.py

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

DORA lead-time attribution now counts only deployments within the reporting window. The merged-PR denominator still includes all PRs merged during that window. The test fixture adds a successful deployment after the window, links it to PR 4, and verifies that PR 4 remains unattributed while the latest deployment status advances to January 21.

Priority: ⬇️ Low

Severity of issue fixed: Low

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the problem, behavior change, measurable impact, testing, documentation status, and agent context. The agent context omits a session link and explicit definitions-of-done eviden…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@rnegron
rnegron force-pushed the rauln/ea-13-dora-coverage-horizon branch from 0d349c6 to ce19e4c Compare September 21, 2026 19:21
@rnegron rnegron added the stamphog Request AI approval (no full review) label Sep 21, 2026
@rnegron
rnegron marked this pull request as ready for review September 21, 2026 19:25
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team September 21, 2026 19:25
@rnegron
rnegron removed the request for review from a team September 21, 2026 19:27

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Contained fix to an internal analytics query with matching test updates, author is on the owning team, and an automated reviewer found no issues; no risky territory (auth/billing/migrations/API) involved.

  • Author wrote 14% of the modified lines and has 59 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
size ✓ 8L, 1F substantive, 29L/2F incl. docs/generated/snapshots — within ceiling
tier ✓ T1-agent / T1b-small (29L, 2F, single-area, fix)
stamphog 2.0.0 .stamphog/policy.yml @ ce19e4c · reviewed head ce19e4c

@trunk-io

trunk-io Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@rnegron
rnegron force-pushed the rauln/ea-13-dora-coverage-horizon branch from ce19e4c to 36f1cbf Compare September 21, 2026 20:29
@trunk-io

trunk-io Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

😎 Stack merged successfully - details.

@trunk-io
trunk-io Bot merged commit 85ca6a0 into master Sep 22, 2026
250 of 403 checks passed
@trunk-io
trunk-io Bot deleted the rauln/ea-13-dora-coverage-horizon branch September 22, 2026 15:02
@deployment-status-posthog

deployment-status-posthog Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-09-22 15:43 UTC Run
prod-us ✅ Deployed 2026-09-22 15:53 UTC Run
prod-eu ✅ Deployed 2026-09-22 15:54 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants