feat(scorecard): score first in-window DORA deployments for lead time and CFR - #4732
PatAKnight wants to merge 3 commits into
Conversation
… and CFR Signed-off-by: Patrick Knight <pknight@redhat.com>
Signed-off-by: Patrick Knight <pknight@redhat.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
|
🤖 Review · Commit: |
Signed-off-by: Patrick Knight <pknight@redhat.com>
|
|
🤖 Finished Review · ✅ Success · Started 1:56 PM UTC · Completed 2:12 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $6.77 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4732 +/- ##
=======================================
Coverage 59.62% 59.63%
=======================================
Files 2627 2628 +1
Lines 104976 104996 +20
Branches 29553 29556 +3
=======================================
+ Hits 62594 62614 +20
Misses 41819 41819
Partials 563 563
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
ReviewFindingsLow
Labels: PR adds a new feature to DORA metric scoring in the scorecard workspace. |
| }, | ||
| ): Promise<DbDoraDeployment | undefined> { | ||
| const candidates = await this.deploymentsDb.readCandidatesBefore( | ||
| catalogEntityRef, |
There was a problem hiding this comment.
[low] edge-case
readLatestProductionDeploymentBefore fetches at most 50 candidates and filters to the first production deployment in application code. If more than 50 non-production deployments exist between the last production deploy and the window boundary, the method silently returns undefined. The caller cannot distinguish no pre-window production deployment exists from the limit was exhausted.
Suggested fix: Consider logging a warning when all N candidates are non-production and N equals the limit, so operators can tune the constant for their deployment patterns.
| ): Promise<DbDoraDeployment[]>; | ||
| /** | ||
| * Newest deployments with `created_at` strictly before `before`, for the | ||
| * entity and collector identity. Callers filter to production. |
There was a problem hiding this comment.
[low] naming-convention
The new store method readCandidatesBefore follows a different naming pattern than the existing readByEntityCollectorAndWindow. The established convention names read methods after their filter criteria (readBy + filter description). The difference is intentional (the method returns candidates for further filtering per its JSDoc), but worth noting for consistency.



Hey, I just made a Pull Request!
Median lead time and change failure rate only paired successful production deployments inside the 30-day window, so the first in-window deploy was never fully scored.
This change loads the latest persisted successful production deployment immediately before
windowFromand uses it as:baseCommitShafor PRs into the first in-window deployCollector sync stays on the 30-day window. If no prior deploy is still in the DB, behavior is unchanged. Incident sync is not expanded; incidents before
windowFromcount only if already retained.Also included the
knip-reportsand removed some of the unused dependencies across the plugins. I can drop them in the event that we a cleaner, more focused PR.✔️ Checklist