Skip to content

feat(scorecard): introduce scorecard dora plugin - #4235

Open
dzemanov wants to merge 10 commits into
redhat-developer:mainfrom
dzemanov:scorecard/scorecard-dora
Open

feat(scorecard): introduce scorecard dora plugin#4235
dzemanov wants to merge 10 commits into
redhat-developer:mainfrom
dzemanov:scorecard/scorecard-dora

Conversation

@dzemanov

@dzemanov dzemanov commented Aug 10, 2026

Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

Introduces new backstage-plugin-scorecard-backend-module-dora.

Incorporates PRs:

Additional changes:

  • incorporated changes from main branch for scorecard after rebase
  • moved jira incidents collector issueType app-config configuration under dora collector input in e7c248f, so configuration looks like this:
scorecard:
  metricProviders:
    dora:
      meanTimeToRestore:
        options:
          collectors:
            incidents:
              id: jira:incidents
              # Optional: override default Incident issue type
              # input:
              #   issueType: ServiceIncident

Fixes

Fixes #4235
Incorporates https://redhat.atlassian.net/browse/RHIDP-13978, https://redhat.atlassian.net/browse/RHIDP-13979, https://redhat.atlassian.net/browse/RHIDP-13980

DORA Metrics

  • dora.deploymentFrequency
  • dora.medianLeadTimeForChanges
  • dora.changeFailureRate
  • dora.meanTimeToRestore

dora.deploymentFrequency

  • Uses deployments from last 30 days.
  • Counts only successful deployments.
  • Counts production deployments (or deployments with unknown environment).
  • Returns normalized value in deployments/week
  • Result: (successfulProductionDeployments / 30) * 7 (to deployments/week)
Thresholds deploymentFrequency

Updated (medium to 1-7 to cover the whole real line):

Elite (≥7/week)
Medium (1-7/week)
Low (<1/week)

dora.medianLeadTimeForChanges

  • Uses deployments from last 30 days in chronological order.
  • Counts only successful deployments.
  • Counts production deployments (or deployments with unknown environment).
  • Iterates deployment pairs (previous -> current).
  • Resolves PRs for commit range between these deployment pairs (baseCommitSha -> headCommitSha).
  • For each PR: leadTimeHours = deployedAt - firstCommitAt.
  • Returns median lead time in hours
  • Result: MEDIAN for (deployedAtTimestamp - firstCommitAtTimestamp) / 3_600_000 (to hours)
Thresholds medianLeadTimeForChanges

Updated to use single unit (h):

Elite <24
Medium 24-168
Low >168

dora.changeFailureRate

  • Uses deployments from last 30 days.
  • Counts only successful deployments.
  • Counts production deployments (or deployments with unknown environment).
  • Evaluates adjacent deployment intervals: [deployment.createdAt, nextDeployment.createdAt)
  • Marks starting deployment of each interval as failed if at least one incident falls into interval
  • Returns mean of recovery hours
  • Result: (failedDeployments / successfulDeployments) * 100
Thresholds changeFailureRate
Elite (<5%)
Medium (5-15%)
Low (>15%)

dora.meanTimeToRestore

  • Uses incidents from the last 30 days
  • Considers resolved incidents (resolutionDate != null)
  • Computes recovery time per incident: resolutionDate - createdAt (in hours)
  • Returns median recovery time in hours
  • Result: MEAN for (incidentResolutionAtTimestamp - incidentCreatedAtTimestamp) / 3_600_000 (to hours)
Thresholds meanTimeToRestore
Elite (<1h)
Medium (1-24h)
Low (>24h)

DORA collectors

DORA metrics are composite metrics that require data from different third parties for their computation. They use Scorecard Collectors, reusable components designed to gather data from various datasources, such as Jira or GitHub. Users can create their custom data collector to tailor data collection for DORA metrics calculation for their specific setup.

Demo

image

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

dzemanov and others added 9 commits August 10, 2026 16:57
* Add github collectors

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add dora

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add workflow runs to github

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update dora provider schemas

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update dora to use scorecardCollectorsServiceRef

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update names

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Calculate all PRs between deployments

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update thresholds

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update deployment freq and lead time for changes names

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use first commit

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add docs

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Simplify config

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Unify schemas

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add typings

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Validate deployments ascending order

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add description hover

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update docs

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix description

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* fix update to rebased new provider interface

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add df and mltc translations

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update gh collector descriptions

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update gh pr collector description

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Page commit shas

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use warn

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Generate api reports

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix review comments for docs, link and readme

Co-authored-by: Patrick Knight <pknight@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update alpha api reports

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Handle null types

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix description

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Throw on not enough data

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add productionEnvironments option to provider, move under options

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix rename

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Restrict CollectorInput type

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Batch commit prs

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update to max 10

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Rename deploymentRangePullRequests to deploymentPullRequests

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add app config examples

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix api report

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Simplify collector descriptions

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update api report

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix median lead time thresholds wording for translations

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Skip deployment interval if no PRs found

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

---------

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Co-authored-by: Patrick Knight <pknight@redhat.com>
* Add jira incident collector

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Introduce dora mttr and cfr

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* dora mttr and cfr name update

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Simplify config

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add tests

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Simplify since validated via collector schema

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add docs

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update median time to resolve to mean time to restore

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Rename resolutionDate to resolutionAt

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Remove median ttr

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* fix update jira to rebased new provider interface

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add cfr and mttr translations

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update jira description

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Simplify config setup and add prod env tp cft

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add examples to config

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Simplify collector description

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use catalog filter

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update api reports

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fail when not enough deployments for cfr

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Handle edge cases

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use same format the result is for remaining dora metrics

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix links

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Page jira results

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update docs

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Support more Jira annotations

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix docs grammar

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add thresholds translations

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add fetchItemsLimit

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Throw error when no incident data for mttr

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add deployments cap

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update docs with cap

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use GITHUB_BATCH_SIZE

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Add configurable incident issue type

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Move custom jql entity filter handling from jira client to respective providers and collectors

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update descriptions

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Move incidents collector setting under scorecard.plugins.jira

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Rename getIncidentIssues to getIssues

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Ignore blank app config mandatoryFilter for open issues

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Extract getAnnotationFiltersFromEntity from jira client

Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use clear dummy value

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Update indentation in README.md

* Fix indentation README.md

* Fix indentation in README.md

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Use isLast

Co-authored-by: Patrick Knight <pknight@redhat.com>

* Log reached gh fetch limit

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Move client to options

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Fix prettier

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

* Log warning for jira max fetch items

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>

---------

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Co-authored-by: Patrick Knight <pknight@redhat.com>
* feat: implement time series api, pass visualisation for metric

Signed-off-by: Diana Janickova <djanicko@redhat.com>

* fix: cast to number

Signed-off-by: Diana Janickova <djanicko@redhat.com>

* ref: rename graph to sparkline, use zod

Signed-off-by: Diana Janickova <djanicko@redhat.com>

* ref: add defaultVisualization to mcp action schemas

Signed-off-by: Diana Janickova <djanicko@redhat.com>

---------

Signed-off-by: Diana Janickova <djanicko@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Assisted-By: Cursor Desktop
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
backend workspaces/scorecard/packages/backend none v0.0.0
@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-dora workspaces/scorecard/plugins/scorecard-backend-module-dora minor v0.0.0
@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-github workspaces/scorecard/plugins/scorecard-backend-module-github minor v4.2.0
@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-jira workspaces/scorecard/plugins/scorecard-backend-module-jira minor v4.2.0
@red-hat-developer-hub/backstage-plugin-scorecard-backend workspaces/scorecard/plugins/scorecard-backend minor v4.2.0
@red-hat-developer-hub/backstage-plugin-scorecard-common workspaces/scorecard/plugins/scorecard-common minor v4.2.0
@red-hat-developer-hub/backstage-plugin-scorecard workspaces/scorecard/plugins/scorecard minor v4.2.0

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 5:35 PM UTC · Ended 5:40 PM UTC

Commit: fbdaafd · View workflow run →

Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 5:40 PM UTC · Completed 6:00 PM UTC

Commit: 1f75596 · View workflow run →

@sonarqubecloud

Copy link
Copy Markdown

@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Add DORA scorecard backend module with collectors and time-series API

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add a new Scorecard backend module providing four DORA metrics with defaults and history.
• Introduce GitHub/Jira collectors needed for DORA calculations (deployments, workflow runs, PRs,
 incidents).
• Add a metric time-series endpoint backed by indexed DB queries and API/schema updates.
Diagram

graph TD
  A["Scorecard Backend"] --> B["DORA Module"] --> C["Collectors Service"]
  C --> D["GitHub Module"] --> E{{"GitHub API"}}
  C --> F["Jira Module"] --> G{{"Jira API"}}
  A --> H[("metric_values DB")]

  subgraph Legend
    direction LR
    _svc(["Service/Module"]) ~~~ _db[("Database")] ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pre-aggregate daily series at write time
  • ➕ Time-series reads become O(days) without scanning raw rows
  • ➕ Simplifies server-side folding logic (latest sample per UTC day)
  • ➖ More complex write pipeline (extra table or upsert logic)
  • ➖ Harder to change bucketing logic later without backfill
2. Leverage existing DORA provider/collector library
  • ➕ Less custom code to maintain
  • ➕ Potentially broader datasource support out of the box
  • ➖ Hard to align with Scorecard collector contracts and permission model
  • ➖ External dependencies may not match Backstage/RHDH conventions
3. Compute DORA purely from stored scorecard history (no live collectors)
  • ➕ No external API calls during metric calculation
  • ➕ More deterministic and replayable metrics
  • ➖ Requires separate ingestion pipeline to populate deployments/incidents/PR data
  • ➖ Loses flexibility for per-entity dynamic data fetch based on annotations

Recommendation: Current approach (Scorecard-native collectors + providers, plus a dedicated time-series read API) is the best fit for the existing plugin architecture and extension points. Keep the runtime calculation model, but consider pre-aggregating daily samples later if DB growth or time-series latency becomes an issue.

Files changed (83) +7430 / -67

Enhancement (32) +2447 / -36
quick-monkeys-wash.mdChangeset for DORA module, collectors framework, and time-series API +16/-0

Changeset for DORA module, collectors framework, and time-series API

• Introduces a multi-package minor changeset describing the new DORA backend module, new collectors, a time-series API endpoint, and a new metric visualization hint.

workspaces/scorecard/.changeset/quick-monkeys-wash.md

index.tsRegister the DORA backend module in the backend app +5/-0

Register the DORA backend module in the backend app

• Adds backend.add(import('@...scorecard-backend-module-dora')) to enable DORA providers in the example backend.

workspaces/scorecard/packages/backend/src/index.ts

constants.tsDORA defaults (collector IDs, time window, prod envs) +22/-0

DORA defaults (collector IDs, time window, prod envs)

• Defines default collector IDs, 30-day time window, and default production environment list used across providers.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/constants.ts

index.tsExport DORA backend module entrypoint +7/-7

Export DORA backend module entrypoint

• Replaces placeholder content with package documentation and exports the default backend module feature.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/index.ts

module.tsRegister DORA metric providers in Scorecard backend +60/-0

Register DORA metric providers in Scorecard backend

• Creates a backend module (pluginId scorecard/moduleId dora) that registers four DORA metric providers using the collectors service and (where needed) logger/config.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/module.ts

DoraConfig.tsCentralized DORA config parsing and default thresholds +271/-0

Centralized DORA config parsing and default thresholds

• Adds config parsing helpers for collector wiring and production environment handling. Defines default threshold rules for all four DORA metrics.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraConfig.ts

DoraDeploymentFrequencyProvider.tsDORA deployment frequency provider +132/-0

DORA deployment frequency provider

• Implements deployments/week over a 30-day window using a deployments collector, production-environment filtering, and sparkline default visualization.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraDeploymentFrequencyProvider.ts

DoraMedianLeadTimeForChangesProvider.tsDORA median lead time for changes provider +206/-0

DORA median lead time for changes provider

• Computes lead-time hours from PR first-commit time to deployment time across adjacent production deployments. Uses PR collection for commit ranges and returns a median value.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraMedianLeadTimeForChangesProvider.ts

DoraChangeFailureRateProvider.tsDORA change failure rate provider +195/-0

DORA change failure rate provider

• Calculates percent of deployment intervals containing incidents using deployments+incidents collectors over a 30-day window; returns a percentage with sparkline visualization default.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraChangeFailureRateProvider.ts

DoraMeanTimeToRestoreProvider.tsDORA mean time to restore provider +162/-0

DORA mean time to restore provider

• Computes mean recovery time (hours) for resolved incidents, skipping invalid timestamps and returning a sparkline-friendly metric.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraMeanTimeToRestoreProvider.ts

deploymentSchemas.tsZod schemas for deployment collector contracts +63/-0

Zod schemas for deployment collector contracts

• Defines deployment input/output schemas used by DORA providers to validate collector contracts.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/schemas/deploymentSchemas.ts

incidentSchemas.tsZod schemas for incident collector contracts +38/-0

Zod schemas for incident collector contracts

• Defines incident input/output schemas (including resolutionAt) used by DORA incident-based providers.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/schemas/incidentSchemas.ts

pullRequestSchemas.tsZod schemas for deployment PR collector contracts +42/-0

Zod schemas for deployment PR collector contracts

• Defines input/output schemas for collecting PRs between deployment commit SHAs.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/schemas/pullRequestSchemas.ts

calculationUtils.tsShared mean/median utilities for DORA providers +34/-0

Shared mean/median utilities for DORA providers

• Adds reusable calculation helpers for central tendency calculations.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/utils/calculationUtils.ts

deploymentFilterUtils.tsDeployment production/success filtering utilities +49/-0

Deployment production/success filtering utilities

• Adds shared helpers to treat missing environment as production and filter to successful production deployments (case-insensitive env matching).

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/utils/deploymentFilterUtils.ts

GithubDeploymentsCollector.tsNew GitHub deployments collector +114/-0

New GitHub deployments collector

• Adds a collector that fetches GitHub deployments in a time window and maps them into the Scorecard deployment schema.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/GithubDeploymentsCollector.ts

GithubDeploymentWorkflowRunsCollector.tsNew workflow-run based deployments collector +127/-0

New workflow-run based deployments collector

• Adds an alternative collector that derives deployments from GitHub Actions workflow runs in a time window.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/GithubDeploymentWorkflowRunsCollector.ts

GithubDeploymentPullRequestsCollector.tsNew collector for PRs between deployments +132/-0

New collector for PRs between deployments

• Collects commit SHAs between two deployment commits and resolves linked PRs, returning deduped PRs with firstCommitAt required for lead time metrics.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/GithubDeploymentPullRequestsCollector.ts

deploymentsSchemas.tsShared schema for deployment collector outputs +33/-0

Shared schema for deployment collector outputs

• Defines zod schemas used by GitHub deployment collectors to validate their output payloads.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/schemas/deploymentsSchemas.ts

GithubClient.tsExpand GitHub client for deployments/workflow runs/commit range PRs +312/-7

Expand GitHub client for deployments/workflow runs/commit range PRs

• Refactors the client to accept a logger, centralizes credentials provider usage, adds REST Octokit support, and introduces GraphQL queries for deployments and commit-linked PRs with improved error handling.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts

module.tsRegister GitHub collectors via collectors extension point +18/-3

Register GitHub collectors via collectors extension point

• Adds scorecardCollectorsExtensionPoint usage to register the new GitHub collectors, and updates provider wiring to pass logger into GithubOpenPRsProvider.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/module.ts

JiraIncidentsCollector.tsNew Jira incidents collector +90/-0

New Jira incidents collector

• Adds a collector that builds incident JQL from entity annotations, supports issueType override, and returns issues as incident records.

workspaces/scorecard/plugins/scorecard-backend-module-jira/src/collectors/JiraIncidentsCollector.ts

incidentJql.tsIncident JQL builder with issueType resolution +65/-0

Incident JQL builder with issueType resolution

• Implements JQL generation for incidents with safe value validation/sanitization and defaults with annotation override precedence.

workspaces/scorecard/plugins/scorecard-backend-module-jira/src/collectors/incidentJql.ts

jiraIncidents.tsDefault incident issue type constant +17/-0

Default incident issue type constant

• Introduces DEFAULT_INCIDENT_ISSUE_TYPE used when no config or annotation override is present.

workspaces/scorecard/plugins/scorecard-backend-module-jira/src/constants/jiraIncidents.ts

module.tsRegister Jira incidents collector and refactor provider wiring +16/-3

Register Jira incidents collector and refactor provider wiring

• Registers JiraIncidentsCollector via collectors extension point and constructs a shared Jira client via JiraClientFactory for providers/collectors.

workspaces/scorecard/plugins/scorecard-backend-module-jira/src/module.ts

router.tsAdd time-series route for entity metrics +29/-0

Add time-series route for entity metrics

• Adds GET /metrics/catalog/:kind/:namespace/:name/time-series with query validation, permission checks, entity access checks, and delegation to CatalogMetricService time-series API.

workspaces/scorecard/plugins/scorecard-backend/src/service/router.ts

CatalogMetricService.tsImplement getEntityMetricTimeSeries service method +88/-1

Implement getEntityMetricTimeSeries service method

• Adds a service method that validates entity existence, enforces metric authorization, reads metric_values rows in range, folds to latest sample per UTC day, and returns a typed MetricTimeSeriesResponse.

workspaces/scorecard/plugins/scorecard-backend/src/service/CatalogMetricService.ts

DatabaseMetricValues.tsAdd DB query for metric values in timestamp range +24/-0

Add DB query for metric values in timestamp range

• Adds readEntityMetricValuesInRange to fetch ordered rows for a specific entity+metric between timestamps, used by the time-series service.

workspaces/scorecard/plugins/scorecard-backend/src/database/DatabaseMetricValues.ts

collector.tsIntroduce CollectorConfig type in scorecard-common +25/-0

Introduce CollectorConfig type in scorecard-common

• Adds a public CollectorConfig type (id + optional JSON input) for configuring collectors in app-config and provider configs.

workspaces/scorecard/plugins/scorecard-common/src/types/collector.ts

Metric.tsAdd defaultVisualization and time-series response types +37/-0

Add defaultVisualization and time-series response types

• Extends Metric metadata with defaultVisualization and adds MetricTimeSeriesPoint/MetricTimeSeriesResponse types for the new API contract.

workspaces/scorecard/plugins/scorecard-common/src/types/Metric.ts

index.tsExport new common types (collector/time-series) +1/-0

Export new common types (collector/time-series)

• Updates type exports so CollectorConfig and time-series types are available to consumers.

workspaces/scorecard/plugins/scorecard-common/src/types/index.ts

CardWrapper.tsxShow full metric description on hover +17/-15

Show full metric description on hover

• Wraps truncated description text in a Tooltip so the full description is accessible without expanding the card layout.

workspaces/scorecard/plugins/scorecard/src/components/Common/CardWrapper.tsx

Bug fix (1) +44 / -0
validateTimeSeriesQueryParams.tsValidate time-series query parameters +44/-0

Validate time-series query parameters

• Adds a zod-based validator enforcing required metricId/from/to and from<=to, returning InputError on invalid requests.

workspaces/scorecard/plugins/scorecard-backend/src/middlewares/validateTimeSeriesQueryParams.ts

Refactor (1) +10 / -6
GithubOpenPRsProvider.tsInject logger-backed GitHub client into open PRs provider +10/-6

Inject logger-backed GitHub client into open PRs provider

• Refactors provider construction to accept a GithubClient instance and updates fromConfig signature to include logger.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubOpenPRsProvider.ts

Tests (21) +3456 / -3
DoraConfig.test.tsTests for DORA configuration parsing and defaults +250/-0

Tests for DORA configuration parsing and defaults

• Adds unit tests validating config parsing behavior, fallbacks, and default threshold structures.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraConfig.test.ts

DoraDeploymentFrequencyProvider.test.tsTests for deployment frequency provider +236/-0

Tests for deployment frequency provider

• Adds tests covering deployment filtering and normalization logic for deployments/week calculations.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraDeploymentFrequencyProvider.test.ts

DoraMedianLeadTimeForChangesProvider.test.tsTests for median lead time provider +444/-0

Tests for median lead time provider

• Adds comprehensive unit tests for interval iteration, PR handling, and median calculation behavior including error cases.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraMedianLeadTimeForChangesProvider.test.ts

DoraChangeFailureRateProvider.test.tsTests for change failure rate provider +434/-0

Tests for change failure rate provider

• Adds tests for interval evaluation, incident detection, and edge cases (insufficient deployments / no evaluable intervals).

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraChangeFailureRateProvider.test.ts

DoraMeanTimeToRestoreProvider.test.tsTests for mean time to restore provider +239/-0

Tests for mean time to restore provider

• Adds tests for resolved-incident filtering, invalid data handling, and mean calculation.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraMeanTimeToRestoreProvider.test.ts

index.tsDORA provider test fixtures index +19/-0

DORA provider test fixtures index

• Adds fixture exports to simplify tests across DORA providers.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/fixtures/index.ts

mockCollectors.tsMock collector outputs for DORA tests +84/-0

Mock collector outputs for DORA tests

• Provides mock deployments/incidents/PRs datasets used in provider unit tests.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/fixtures/mockCollectors.ts

mockCollectorsService.tsMock collectors service for provider tests +48/-0

Mock collectors service for provider tests

• Adds a fake ScorecardCollectorsService implementation for deterministic test execution.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/fixtures/mockCollectorsService.ts

mockEntity.tsMock catalog entity for DORA tests +27/-0

Mock catalog entity for DORA tests

• Adds representative entity fixtures used across provider tests.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/fixtures/mockEntity.ts

calculationUtils.test.tsTests for calculation utilities +53/-0

Tests for calculation utilities

• Adds unit tests validating mean/median helpers.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/utils/calculationUtils.test.ts

deploymentFilterUtils.test.tsTests for deployment filter utilities +61/-0

Tests for deployment filter utilities

• Validates environment matching and success filtering behavior used by all deployment-based DORA metrics.

workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/utils/deploymentFilterUtils.test.ts

GithubDeploymentsCollector.test.tsTests for GitHub deployments collector +124/-0

Tests for GitHub deployments collector

• Adds unit tests validating input validation and mapping semantics for deployments collection.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/GithubDeploymentsCollector.test.ts

GithubDeploymentWorkflowRunsCollector.test.tsTests for workflow runs collector +124/-0

Tests for workflow runs collector

• Adds unit tests validating workflow run mapping to deployment-like records.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/GithubDeploymentWorkflowRunsCollector.test.ts

GithubDeploymentPullRequestsCollector.test.tsTests for deployment pull request collector +114/-0

Tests for deployment pull request collector

• Adds tests ensuring PR dedupe and missing firstCommitAt handling.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/collectors/GithubDeploymentPullRequestsCollector.test.ts

GitHubClient.test.tsUpdate GitHub client tests for new APIs +777/-1

Update GitHub client tests for new APIs

• Extends/updates unit tests to cover deployments, workflow runs, commit range retrieval, and repository-not-found handling.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GitHubClient.test.ts

GithubOpenPRsProvider.test.tsUpdate open PRs provider tests for new construction API +9/-2

Update open PRs provider tests for new construction API

• Updates tests to account for provider creation changes and logger injection.

workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubOpenPRsProvider.test.ts

router.test.tsAdd route tests for metric time-series endpoint +137/-0

Add route tests for metric time-series endpoint

• Adds tests for authorization, entity access checks, parameter validation errors, and happy-path responses for the new time-series route.

workspaces/scorecard/plugins/scorecard-backend/src/service/router.test.ts

plugin.api.test.tsIntegration test coverage for time-series API +29/-0

Integration test coverage for time-series API

• Adds end-to-end API tests verifying empty time-series behavior and 404 for missing entities.

workspaces/scorecard/plugins/scorecard-backend/src/plugin.api.test.ts

validateQueryAndParams.test.tsUnit tests for time-series query validator +59/-0

Unit tests for time-series query validator

• Adds validator tests for required params, ISO datetime validation, and from/to ordering semantics.

workspaces/scorecard/plugins/scorecard-backend/src/middlewares/validateQueryAndParams.test.ts

DatabaseMetricValues.test.tsTests for readEntityMetricValuesInRange query semantics +171/-0

Tests for readEntityMetricValuesInRange query semantics

• Adds cross-database tests ensuring ordering, filtering by entity/metric, inclusivity of bounds, and multiple samples per day behavior.

workspaces/scorecard/plugins/scorecard-backend/src/database/DatabaseMetricValues.test.ts

CardWrapper.test.tsxAdd/adjust CardWrapper tooltip tests +17/-0

Add/adjust CardWrapper tooltip tests

• Updates tests to validate tooltip behavior for truncated card descriptions.

workspaces/scorecard/plugins/scorecard/src/components/Common/tests/CardWrapper.test.tsx

Documentation (18) +1120 / -4
dora-scorecard.yamlAdd example component annotated for DORA +15/-0

Add example component annotated for DORA

• Adds a sample catalog Component with GitHub project slug/source-location, scorecard.io/dora enablement annotation, and Jira incident project annotation.

workspaces/scorecard/examples/components/dora-scorecard.yaml

README.mdDocumentation for installing and configuring DORA module +163/-0

Documentation for installing and configuring DORA module

• Documents prerequisites, installation, required entity annotation, available metrics, and threshold customization patterns for the DORA backend module.

workspaces/scorecard/plugins/scorecard-backend-module-dora/README.md

change-failure-rate.mdChange failure rate metric documentation +199/-0

Change failure rate metric documentation

• Adds detailed metric definition, data requirements, collector expectations, and examples for DORA change failure rate.

workspaces/scorecard/plugins/scorecard-backend-module-dora/docs/metrics/change-failure-rate.md

deployment-frequency.mdDeployment frequency metric documentation +136/-0

Deployment frequency metric documentation

• Adds detailed metric definition, deployment filtering rules, and configuration guidance for DORA deployment frequency.

workspaces/scorecard/plugins/scorecard-backend-module-dora/docs/metrics/deployment-frequency.md

mean-time-to-restore.mdMean time to restore metric documentation +114/-0

Mean time to restore metric documentation

• Documents incident requirements and MTTR calculation behavior, including handling of resolved incidents.

workspaces/scorecard/plugins/scorecard-backend-module-dora/docs/metrics/mean-time-to-restore.md

median-lead-time-for-changes.mdMedian lead time for changes metric documentation +193/-0

Median lead time for changes metric documentation

• Documents lead time calculation based on deployments and PR commit times, plus configuration/collector requirements.

workspaces/scorecard/plugins/scorecard-backend-module-dora/docs/metrics/median-lead-time-for-changes.md

report.api.mdAPI extractor report for DORA module package +11/-0

API extractor report for DORA module package

• Adds API report indicating the exported default BackendFeature for the DORA module.

workspaces/scorecard/plugins/scorecard-backend-module-dora/report.api.md

README.mdDocument GitHub collectors for DORA support +66/-0

Document GitHub collectors for DORA support

• Updates GitHub module documentation to cover new collectors used for DORA (deployments, workflow runs, deployment PRs).

workspaces/scorecard/plugins/scorecard-backend-module-github/README.md

README.mdDocument Jira incident collector and configuration +69/-4

Document Jira incident collector and configuration

• Updates Jira module docs to cover incident collection and DORA-related configuration patterns.

workspaces/scorecard/plugins/scorecard-backend-module-jira/README.md

report.api.mdAPI extractor report updated for new types +32/-0

API extractor report updated for new types

• Updates generated API report to include CollectorConfig, defaultVisualization, and metric time-series types.

workspaces/scorecard/plugins/scorecard-common/report.api.md

providers.mdDocument defaultVisualization usage for metrics +2/-0

Document defaultVisualization usage for metrics

• Adds guidance for using defaultVisualization (value vs sparkline) when defining metrics intended for time-series UI.

workspaces/scorecard/plugins/scorecard-backend/docs/providers.md

report.api.mdUpdate scorecard frontend API report for DORA translations +11/-0

Update scorecard frontend API report for DORA translations

• Adds translation keys for DORA metric titles/descriptions and new threshold labels (elite/medium/low) to the generated API report.

workspaces/scorecard/plugins/scorecard/report.api.md

de.tsAdd German translations for DORA metrics and thresholds +17/-0

Add German translations for DORA metrics and thresholds

• Adds localized strings for DORA metric labels/descriptions and elite/medium/low thresholds.

workspaces/scorecard/plugins/scorecard/src/translations/de.ts

es.tsAdd Spanish translations for DORA metrics and thresholds +18/-0

Add Spanish translations for DORA metrics and thresholds

• Adds localized strings for DORA metric labels/descriptions and elite/medium/low thresholds.

workspaces/scorecard/plugins/scorecard/src/translations/es.ts

fr.tsAdd French translations for DORA metrics and thresholds +18/-0

Add French translations for DORA metrics and thresholds

• Adds localized strings for DORA metric labels/descriptions and elite/medium/low thresholds.

workspaces/scorecard/plugins/scorecard/src/translations/fr.ts

it.tsAdd Italian translations for DORA metrics and thresholds +17/-0

Add Italian translations for DORA metrics and thresholds

• Adds localized strings for DORA metric labels/descriptions and elite/medium/low thresholds.

workspaces/scorecard/plugins/scorecard/src/translations/it.ts

ja.tsAdd Japanese translations for DORA metrics and thresholds +16/-0

Add Japanese translations for DORA metrics and thresholds

• Adds localized strings for DORA metric labels/descriptions and elite/medium/low thresholds.

workspaces/scorecard/plugins/scorecard/src/translations/ja.ts

ref.tsAdd reference translations for DORA metrics and thresholds +23/-0

Add reference translations for DORA metrics and thresholds

• Adds canonical/reference strings for DORA metric labels/descriptions and elite/medium/low thresholds.

workspaces/scorecard/plugins/scorecard/src/translations/ref.ts

Other (10) +353 / -18
app-config.yamlAdd example DORA metric provider configuration +59/-0

Add example DORA metric provider configuration

• Adds config blocks for DORA metric providers, wiring deployments/incidents collectors and schedules. Documents optional workflow-run based deployments and incident issueType override under collector input.

workspaces/scorecard/app-config.yaml

all-scorecards-location.yamlUpdate scorecard examples location list +1/-0

Update scorecard examples location list

• Adjusts the examples location file to include the new DORA example component definition.

workspaces/scorecard/examples/all-scorecards-location.yaml

package.jsonInclude DORA backend module dependency in example backend workspace +1/-0

Include DORA backend module dependency in example backend workspace

• Adds the new scorecard-backend-module-dora workspace package dependency so the example backend can load it.

workspaces/scorecard/packages/backend/package.json

.eslintrc.jsESLint configuration for new DORA module package +1/-0

ESLint configuration for new DORA module package

• Adds package-specific lint configuration to align with repository standards.

workspaces/scorecard/plugins/scorecard-backend-module-dora/.eslintrc.js

config.d.tsConfig schema for DORA metric providers +99/-0

Config schema for DORA metric providers

• Defines typed configuration for DORA providers including productionEnvironments, collector wiring, thresholds, and schedules.

workspaces/scorecard/plugins/scorecard-backend-module-dora/config.d.ts

package.jsonNew DORA backend module package manifest +71/-0

New DORA backend module package manifest

• Introduces the @red-hat-developer-hub/backstage-plugin-scorecard-backend-module-dora package with Backstage module metadata, config schema, dependencies, and build scripts.

workspaces/scorecard/plugins/scorecard-backend-module-dora/package.json

package.jsonBump GitHub backend module package metadata for new collectors +3/-1

Bump GitHub backend module package metadata for new collectors

• Updates package dependencies/metadata to support newly added collectors and updated GitHub client usage.

workspaces/scorecard/plugins/scorecard-backend-module-github/package.json

package.jsonUpdate Jira backend module dependencies for new collector/client changes +4/-2

Update Jira backend module dependencies for new collector/client changes

• Adjusts dependencies/metadata to support the incidents collector and JiraClientFactory refactor usage.

workspaces/scorecard/plugins/scorecard-backend-module-jira/package.json

20260804123239_add_entity_metric_timestamp_index.jsIndex metric_values for time-series range reads +33/-0

Index metric_values for time-series range reads

• Adds an index on (catalog_entity_ref, metric_id, timestamp) to support efficient time-series queries; includes down migration.

workspaces/scorecard/plugins/scorecard-backend/migrations/20260804123239_add_entity_metric_timestamp_index.js

yarn.lockLockfile updates for new packages/dependencies +81/-15

Lockfile updates for new packages/dependencies

• Updates yarn.lock to reflect the newly added DORA module package and dependency changes in github/jira/scorecard packages.

workspaces/scorecard/yarn.lock

@rhdh-qodo-merge

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Unsafe ID numeric compare 🐞 Bug ≡ Correctness
Description
CatalogMetricService.getEntityMetricTimeSeries chooses the “latest per day” row by comparing
Number(row.id), which can lose precision for bigint IDs and select the wrong sample. Since
readEntityMetricValuesInRange already returns rows ordered by timestamp asc then id asc, the numeric
comparison is unnecessary and can be replaced with “last row wins” (or a BigInt-safe comparison).
Code

workspaces/scorecard/plugins/scorecard-backend/src/service/CatalogMetricService.ts[R239-242]

+      const existing = latestByUtcDay.get(dayKey);
+      // Postgres may return bigIncrements as strings; compare numerically.
+      if (!existing || Number(row.id) > Number(existing.id)) {
+        latestByUtcDay.set(dayKey, row);
Relevance

●●● Strong

BigInt-unsafe Number coercion is a clear correctness bug; team commonly accepts small logic-safety
fixes.

PR-#2913
PR-#2393

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The service currently relies on Number(row.id) to pick the latest row per UTC day, but the DB
query already guarantees ordering by timestamp and id ascending. This makes the numeric coercion
unnecessary and potentially incorrect for large bigint IDs due to JS Number precision limits.

workspaces/scorecard/plugins/scorecard-backend/src/service/CatalogMetricService.ts[233-244]
workspaces/scorecard/plugins/scorecard-backend/src/database/DatabaseMetricValues.ts[231-253]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`CatalogMetricService.getEntityMetricTimeSeries` compares `row.id` values by coercing them to `Number(...)`. For Postgres `bigint` IDs, this becomes unsafe once values exceed `Number.MAX_SAFE_INTEGER` and is also redundant because the DB query already orders rows by `timestamp` then `id` ascending.

## Issue Context
The time-series endpoint reads rows via `DatabaseMetricValues.readEntityMetricValuesInRange`, which applies `.orderBy([{ timestamp asc }, { id asc }])`. Iterating that ordered result means that for any given UTC day, the last row encountered is already the latest by `(timestamp, id)`.

## Fix Focus Areas
- workspaces/scorecard/plugins/scorecard-backend/src/service/CatalogMetricService.ts[233-244]
- workspaces/scorecard/plugins/scorecard-backend/src/database/DatabaseMetricValues.ts[231-253]

## Suggested change
- Replace the `Number(row.id) > Number(existing.id)` comparison with a simple unconditional `latestByUtcDay.set(dayKey, row)` (since iteration is ordered), or use a BigInt-safe compare if you want to keep the explicit guard.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 11 rules
✅ Cross-repo context
  Explored: repo: redhat-developer/rhdh (sha: 820e6260)
  Explored: repo: redhat-developer/rhdh-operator (sha: a425373c)
  Explored: repo: redhat-developer/rhdh-local (sha: a1776caa)
  Not relevant to this PR: redhat-developer/rhdh-chart

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@rhdh-qodo-merge rhdh-qodo-merge Bot added documentation Improvements or additions to documentation enhancement New feature or request Tests labels Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.35201% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.64%. Comparing base (02f4f32) to head (1f75596).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4235      +/-   ##
==========================================
+ Coverage   58.39%   58.64%   +0.24%     
==========================================
  Files        2436     2466      +30     
  Lines       96935    97676     +741     
  Branches    26984    27101     +117     
==========================================
+ Hits        56607    57280     +673     
- Misses      40136    40204      +68     
  Partials      192      192              
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from fbdaafd
ai-integrations 69.16% <ø> (ø) Carriedforward from fbdaafd
app-defaults 69.79% <ø> (ø) Carriedforward from fbdaafd
augment 46.67% <ø> (ø) Carriedforward from fbdaafd
boost 77.63% <ø> (ø) Carriedforward from fbdaafd
bulk-import 72.79% <ø> (ø) Carriedforward from fbdaafd
cost-management 13.55% <ø> (ø) Carriedforward from fbdaafd
dcm 67.21% <ø> (ø) Carriedforward from fbdaafd
extensions 56.59% <ø> (ø) Carriedforward from fbdaafd
global-floating-action-button 71.18% <ø> (ø) Carriedforward from fbdaafd
global-header 66.50% <ø> (ø) Carriedforward from fbdaafd
homepage 47.50% <ø> (ø) Carriedforward from fbdaafd
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from fbdaafd
intelligent-assistant 75.24% <ø> (ø) Carriedforward from fbdaafd
konflux 91.98% <ø> (ø) Carriedforward from fbdaafd
lightspeed 69.02% <ø> (ø) Carriedforward from fbdaafd
mcp-integrations 83.40% <ø> (ø) Carriedforward from fbdaafd
orchestrator 66.91% <ø> (ø) Carriedforward from fbdaafd
quickstart 63.74% <ø> (ø) Carriedforward from fbdaafd
sandbox 79.56% <ø> (ø) Carriedforward from fbdaafd
scorecard 86.96% <91.35%> (+0.72%) ⬆️
theme 88.77% <ø> (ø) Carriedforward from fbdaafd
translations 5.12% <ø> (ø) Carriedforward from fbdaafd
x2a 79.20% <ø> (ø) Carriedforward from fbdaafd

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02f4f32...1f75596. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

name: dora-scorecard
annotations:
github.com/project-slug: dzemanov/test-scorecard-github-dora
backstage.io/source-location: url:https://github.com/dzemanov/test-scorecard-github-dora

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will update source to official rhdh repo in following PR

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [error-handling-gap] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:244 — In getCommitShasBetween, pagination has no fetchItemsLimit cap. Unlike getDeployments and getWorkflowRuns which use DEFAULT_DEPLOYMENT_FETCH_ITEMS_LIMIT, this method makes unbounded sequential API calls for large commit ranges, risking GitHub rate limits or timeouts.
    Remediation: Add a fetchItemsLimit parameter or reasonable upper bound on pages fetched, with a warning log when truncation occurs.

  • [injection-vuln] workspaces/scorecard/plugins/scorecard-backend-module-jira/src/annotations/buildJqlFiltersFromEntity.ts:59 — The customFilter annotation value from catalog entity annotations is passed into JQL without sanitization. While other annotation-derived values (project, component, label, team) are protected by sanitizeValue/validateJQLValue/validateIdentifier, the customFilter slot is raw. This is a pre-existing design pattern that this PR extends to the new incident collector path via INCIDENT_FILTER_ANNOTATIONS.
    Remediation: Apply structural validation to customFilter values, or document that jira/custom-filter and jira/incident-custom-filter annotations allow arbitrary JQL and catalog write access should be restricted accordingly.

  • [stale-doc] workspaces/scorecard/AGENTS.md:17 — The Metric ID Naming Convention section lists provider prefixes (github, jira, sonarqube, dependabot, openssf, filecheck) but does not include the new dora prefix introduced by this PR.
    Remediation: Add dora to the provider prefix list.

  • [stale-doc] workspaces/scorecard/AGENTS.md:26 — The Complete Metric ID Reference section is missing the new DORA provider and its 4 metrics: dora.deploymentFrequency, dora.medianLeadTimeForChanges, dora.meanTimeToRestore, and dora.changeFailureRate.
    Remediation: Add a DORA section to the Complete Metric ID Reference table.

Low

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraChangeFailureRateProvider.ts:131 — The last deployment in the window is never evaluated as a failure source — incidents after the last deployment but within the 30-day window are silently ignored. This is a known DORA implementation trade-off requiring the next deployment to bound the interval.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraDeploymentFrequencyProvider.ts:115 — DeploymentFrequency returns 0 when no successful production deployments exist, while other DORA providers throw errors for insufficient data. This is semantically correct (0 frequency is a valid measurement) but differs from the error-throwing pattern used by the other three providers.

  • [scope-creep] The PR scope extends beyond the title ("introduce scorecard dora plugin") to include a collectors framework with extension points, GitHub/Jira collectors, time-series API endpoint, database migration, new shared types, and significant refactoring of JiraClient and GithubClient. These form a cohesive dependency chain but documenting the broader scope in the PR description would improve reviewability.

  • [naming-convention] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts — Pre-existing casing inconsistency between GithubClient.ts (implementation) and GitHubClient.test.ts (test file). All new code consistently uses Github (lowercase h).

  • [pattern-inconsistency] workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/DoraConfig.ts — Uses import { JsonValue } instead of import type { JsonValue } when JsonValue is only used in type position.

  • [new-package-dependency] workspaces/scorecard/plugins/scorecard-common/package.json — Adds @backstage/types (^1.2.2) as a new runtime dependency for CollectorConfig. This is near-zero-weight and already transitively present.

  • [input-validation] workspaces/scorecard/plugins/scorecard-backend/src/middlewares/validateTimeSeriesQueryParams.ts:26 — No maximum time range enforced between from and to. The index and daily bucketing mitigate performance impact.

  • [pattern-inconsistency] workspaces/scorecard/plugins/scorecard-backend-module-dora/src/metricProviders/schemas/incidentSchemas.ts — Output schema omits .passthrough() unlike the parallel deployment output schema and all input schemas.


Labels: PR introduces a new DORA metrics plugin module with new API endpoints and collectors framework

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request feature requires-manual-review Review requires human judgment Tests workspace/scorecard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants