Skip to content

Commit ed5a9ce

Browse files
add readme for group metrics
1 parent 12fbaf3 commit ed5a9ce

1 file changed

Lines changed: 43 additions & 2 deletions

File tree

  • workspaces/scorecard/plugins/scorecard

workspaces/scorecard/plugins/scorecard/README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The plugin supports both the **legacy** Backstage frontend and the **New Fronten
88
- **Entity scorecard tab** — View scorecard metrics on catalog entity pages (components, websites, etc.).
99
- **Scorecard homepage card** — Show aggregated KPIs on the home page (e.g. GitHub open PRs, Jira open issues). Supports **`statusGrouped`** (multi-slice pie) and **`average`** (weighted health donut) KPI types configured under **`scorecard.aggregationKPIs`**.
1010
- **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.
11+
- **Metric group cards (grid layout)** — Group related metrics into collapsible cards with threshold bucket tiles, a filterable/sortable data sources dialog, and a Masonry grid layout. Enabled via app-config.yaml.
1112

1213
## Getting started
1314

@@ -122,7 +123,46 @@ To align with the legacy EntityPage (Scorecard on component pages and default en
122123

123124
5. Start the NFS app (e.g. `yarn start`), go to **Catalog**, open an entity. The **Scorecard** tab appears for entities that match your `allowedFilters` (or all entities if the extension config is omitted or empty).
124125

125-
6. (Optional) Enable homepage Scorecard widgets by adding `scorecardHomeModule` to app features (see step 2) and configuring home page extensions in `app-config.yaml`:
126+
6. (Optional) Enable the **grid layout** with metric group cards. The grid layout extension is disabled by default. Enable it and define `groups` in `app-config.yaml` to organize metrics into themed cards:
127+
128+
```yaml
129+
app:
130+
extensions:
131+
- scorecard-layout:catalog/scorecard-entity-layout-grid:
132+
config:
133+
groups:
134+
codeQuality:
135+
title: 'Code Quality'
136+
description: 'SonarQube code quality metrics'
137+
metrics:
138+
- sonarqube.reliability_issues
139+
- sonarqube.code_coverage
140+
- sonarqube.security_issues
141+
operations:
142+
title: 'Operations'
143+
metrics:
144+
- github.open_prs
145+
- jira.open_issues
146+
```
147+
148+
**Groups config schema:**
149+
150+
| Field | Type | Required | Description |
151+
| ------------- | ---------- | -------- | ---------------------------------------------------- |
152+
| `title` | `string` | Yes | Display title for the group card. |
153+
| `description` | `string` | No | Optional description shown below the title. |
154+
| `metrics` | `string[]` | Yes | Ordered list of metric IDs to include in this group. |
155+
156+
**Behavior:**
157+
158+
- Metrics listed in `groups` are rendered as **MetricGroupCard** components. Each card shows threshold bucket tiles (e.g. Passing, Warning, Failing) with counts. Clicking a tile opens a **data sources dialog** pre-filtered to that status.
159+
- The data sources dialog displays a sortable, filterable table with columns: Plugin, Check, Value, Status, and Last Synced. A threshold legend allows toggling visibility by status.
160+
- Metrics **not** listed in any group are rendered as individual Scorecard cards below the group cards.
161+
- All cards are arranged in a responsive **Masonry** grid (1 column on mobile, 2 on tablet, 3 on desktop).
162+
- If `groups` is empty or omitted, the grid layout falls back to the default `EntityScorecardContent` view (individual cards for all metrics).
163+
- When multiple layout extensions are enabled, the Scorecard tab renders a toggle to switch between them.
164+
165+
7. (Optional) Enable homepage Scorecard widgets by adding `scorecardHomeModule` to app features (see step 2) and configuring home page extensions in `app-config.yaml`:
126166

127167
```yaml
128168
app:
@@ -222,13 +262,14 @@ The following modules and extensions are available from `@red-hat-developer-hub/
222262
| Module | Description |
223263
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
224264
| `scorecardHomeModule` | Registers Scorecard homepage widgets for the home plugin (`AggregatedCardWithDeprecatedMetricId`, `AggregatedCardWithDefaultAggregation`, `AggregatedCardWithJiraOpenIssues`, `AggregatedCardWithGithubOpenPrs`, `AggregatedCardWithGithubFilecheckLicense`, `AggregatedCardWithGithubFilecheckCodeowners` and `AggregatedCardWithGithubOpenPrsWeighted`). |
225-
| `scorecardCatalogModule` | Registers the Scorecard entity tab with the catalog plugin. Add to your app's `features`. Which entities show the tab is configured via `app.extensions` (see step 3). |
265+
| `scorecardCatalogModule` | Registers the Scorecard entity tab and the grid layout extension with the catalog plugin. Add to your app's `features`. Which entities show the tab is configured via `app.extensions` (see step 3). The grid layout is disabled by default; enable and configure it with `groups` (see step 6). |
226266
| `scorecardTranslationsModule` | Registers Scorecard translations with the app. Add to your app's `features`. |
227267

228268
**Extensions**
229269

230270
- `api:scorecard` — Scorecard API (provided by the plugin; auto-discovered when the plugin is installed).
231271
- `entity-content:catalog/entity-content-scorecard` — Scorecard tab on catalog entity pages. Configure with `allowedFilters` in `app.extensions` to limit by kind and optionally type.
272+
- `scorecard-layout:catalog/scorecard-entity-layout-grid` — Grid layout with metric group cards (disabled by default). Enable via `app.extensions` and define `groups` to organize metrics into themed cards (see step 6).
232273
- `home-page-widget:home/scorecard-deprecated-metric-id` — Homepage widget using deprecated metricId property (Jira open issues).
233274
- `home-page-widget:home/scorecard-default-aggregation` — Homepage widget using default aggregation config (GitHub open PRs).
234275
- `home-page-widget:home/scorecard-jira-open-issues` — Homepage widget showing Jira open blocking tickets.

0 commit comments

Comments
 (0)