@red-hat-developer-hub/backstage-plugin-scorecard 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +11 -3
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-scorecard
2
2
 
3
+ ## 4.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e486f80: Implemented filter by `status` for scalar aggregation types (`sum`, `average`, `count`, `min`, `max`).
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [e486f80]
12
+ - @red-hat-developer-hub/backstage-plugin-scorecard-common@4.2.0
13
+
14
+ ## 4.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 3af0fb2: This update introduces new scalar aggregation KPIs in the scorecard configuration, including:
19
+
20
+ - **`sum`**: Single numeric total of latest metric values across owned entities
21
+ - **`average`**: Mean of latest metric values across owned entities
22
+ - **`max`**: Maximum latest metric value across owned entities
23
+ - **`min`**: Minimum latest metric value across owned entities
24
+ - **`count`**: Number of entities with a non-null latest stored value
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [3af0fb2]
29
+ - @red-hat-developer-hub/backstage-plugin-scorecard-common@4.1.0
30
+
3
31
  ## 4.0.0
4
32
 
5
33
  ### Patch Changes
package/README.md CHANGED
@@ -9,7 +9,7 @@ For NFS, register the default `scorecardPlugin` plus `scorecardTranslationsModul
9
9
  **Features:**
10
10
 
11
11
  - **Entity scorecard tab** — View scorecard metrics on catalog entity pages (components, websites, etc.).
12
- - **Scorecard homepage card** — Show aggregated KPIs on the home page (e.g. GitHub open PRs, Jira open issues). Supports **`statusGrouped`** (multi-slice pie) and **`weightedStatusScore`** (weighted health donut) KPI types configured under **`scorecard.aggregationKPIs`**.
12
+ - **Scorecard homepage card** — Show aggregated KPIs on the home page (e.g. GitHub open PRs, Jira open issues). Supports **`statusGrouped`** (multi-slice pie) and **`weightedStatusScore`** (weighted health donut) KPI types configured under **`scorecard.aggregationKPIs`**. Scalar types (`sum`, `average`, `max`, `min`, `count`) are supported by the backend API but not yet rendered by the bundled homepage card (see [Homepage scorecard cards](#homepage-scorecard-cards)).
13
13
  - **Scorecard Entities page** — Drill down from an aggregated metric to see the list of entities contributing to that metric, with entity-level values and status, so you can identify services impacting the KPI and investigate issues.
14
14
  - **Metric group cards (grid layout)** — Group related metrics into cards with threshold bucket tiles, a filterable/sortable data sources dialog, and a Masonry grid layout. Enabled via app-config.yaml.
15
15
 
@@ -452,9 +452,17 @@ The plugin exports **`ScorecardHomepageCard`** from `@red-hat-developer-hub/back
452
452
 
453
453
  Define KPI ids and optional labels under **`scorecard.aggregationKPIs`** so each card can call **`GET /aggregations/<aggregationId>`** with a stable id. See [Scorecard backend README — Aggregation KPIs](../scorecard-backend/README.md#aggregation-kpis-homepage-and-get-aggregations). If you omit a KPI entry, use the **metric id** as `aggregationId` (default status-grouped aggregation).
454
454
 
455
- **`type: weightedStatusScore`** KPIs require **`options.statusScores`** (weights per threshold rule key). Optionally set **`options.thresholds`** so the API returns **`aggregationChartDisplayColor`** for the headline percentage. Behavior, validation, and drill-down notes are described in [aggregation.md](../scorecard-backend/docs/aggregation.md).
455
+ Supported scorecard aggregation types (see [Entity Aggregation Aggregation types](../scorecard-backend/docs/aggregation.md#aggregation-types)):
456
456
 
457
- For **`type: weightedStatusScore`**, the homepage card shows a **centered donut** with the headline percentage. Hovering the **center** opens a tooltip with **total score**, **max possible score**, and a **per-status breakdown** (from aggregation **`result.values`**). There is **no side status legend**; **`statusGrouped`** cards use a multi-slice pie with a legend instead.
457
+ - [`statusGrouped`](../scorecard-backend/docs/aggregation.md#status-grouped-type) counts per status (pie chart).
458
+ - [`weightedStatusScore`](../scorecard-backend/docs/aggregation.md#weighted-status-score-type) — weighted portfolio health percentage (donut); requires `options.statusScores`.
459
+ - Scalar types ([`sum`](../scorecard-backend/docs/aggregation.md#sum-type), [`average`](../scorecard-backend/docs/aggregation.md#average-type), [`max`](../scorecard-backend/docs/aggregation.md#max-type), [`min`](../scorecard-backend/docs/aggregation.md#min-type), [`count`](../scorecard-backend/docs/aggregation.md#count-type)) — roll up latest numeric metric values; number metrics only. Optional [`filter.status`](../scorecard-backend/docs/aggregation.md#status-filter-scalar-types) limits the rollup to a threshold status.
460
+
461
+ **Scalar KPI types** (`sum`, `average`, `max`, `min`, `count`) are fully supported by **`GET /aggregations/:aggregationId`**, including optional **`filter.status`** and **`options.thresholds`**. The bundled **`ScorecardHomepageCard`** / **`AggregatedMetricCard`** only renders **`statusGrouped`** and **`weightedStatusScore`**; scalar types show an unsupported-type error panel. Build a custom card to display **`result.value`** and classify it with **`result.thresholds`**.
462
+
463
+ **Terminology:** Scalar **`average`** (mean of numeric metric values) is distinct from the former weighted KPI type also named `average`, which was renamed to **`weightedStatusScore`**. Update app-config **`type: average`** entries for weighted health scoring to **`type: weightedStatusScore`** and migrate API consumers from **`result.averageScore`** to **`result.weightedStatusScore`**.
464
+
465
+ The NFS example widget **`AggregatedCardWithGithubOpenPrs`** uses **`aggregationId: maxOpenPrs`** (scalar **`max`** KPI). Uncomment and configure **`maxOpenPrs`** under **`scorecard.aggregationKPIs`** in app-config to exercise the API; expect the unsupported-type panel until scalar homepage UI is added.
458
466
 
459
467
  #### Card props
460
468
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-scorecard",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -95,7 +95,7 @@
95
95
  "@mui/icons-material": "5.18.0",
96
96
  "@mui/lab": "5.0.0-alpha.177",
97
97
  "@mui/material": "5.18.0",
98
- "@red-hat-developer-hub/backstage-plugin-scorecard-common": "^4.0.0",
98
+ "@red-hat-developer-hub/backstage-plugin-scorecard-common": "^4.2.0",
99
99
  "@tanstack/react-query": "^5.95.2",
100
100
  "date-fns": "^4.1.0",
101
101
  "react-use": "^17.2.4",