Skip to content

feat(tech-insights-maturity): add groupBy and categoryOrder props to MaturityScorePage#8969

Open
joao-m-ferreira wants to merge 1 commit intobackstage:mainfrom
joao-m-ferreira:feat/maturity-category-grouping
Open

feat(tech-insights-maturity): add groupBy and categoryOrder props to MaturityScorePage#8969
joao-m-ferreira wants to merge 1 commit intobackstage:mainfrom
joao-m-ferreira:feat/maturity-category-grouping

Conversation

@joao-m-ferreira
Copy link
Copy Markdown

@joao-m-ferreira joao-m-ferreira commented May 3, 2026

What

Add configurable grouping mode to MaturityScorePage component via new groupBy and categoryOrder props.

New props on MaturityScorePage

Prop Type Default Description
groupBy 'rank' | 'category' 'rank' How to group checks
categoryOrder string[] undefined Custom ordering for category mode

Behavior

  • groupBy='rank' (default): Groups by Bronze / Silver / Gold tiers — identical to current behavior
  • groupBy='category': Groups by metadata.category on each check. Categories with failing checks auto-expand. Headers show colored Chip components (green for all-passing, default for failing).

Why

The current MaturityScorePage only supports rank-based grouping (Bronze/Silver/Gold). Adopters who define maturity checks across custom categories (e.g., Security, Documentation, Operations) have no way to group by those categories in the UI.

This is a common need — maturity models often organize around pillars/domains rather than rank tiers.

How

  • MaturityScorePage.tsx: Added MaturityScorePageProps interface. When groupBy='category', iterates unique categories (respecting categoryOrder if provided) instead of hardcoded rank tiers. Deduplicates categoryOrder entries via Set.
  • maturityTableRows.tsx: Props is a discriminated union (rank mode vs category mode). Expand logic and header chip rendering are conditional on which prop is provided. Category chips include data-testid for stable test targeting.
  • index.ts / src/index.ts: Export MaturityScorePage and MaturityScorePageProps from package public API.
  • report.api.md: Updated API report with new exports.
  • README.md: Added documentation section for category grouping with usage examples and props table.

Testing

  • Existing 2 tests unchanged and pass (default rank mode).
  • Added 3 new tests:
    • Verifies category chips appear and rank chips don't when groupBy='category'
    • Verifies categoryOrder controls chip ordering
    • Verifies unlisted categories are appended after categoryOrder entries

Checklist

  • Changeset included (minor)
  • @public TSDoc on new interface
  • Backward compatible — default behavior unchanged
  • API report updated
  • README documentation added
  • Tests use stable data-testid selectors
  • categoryOrder deduplicates input
  • Prettier formatted
  • DCO signed

Copilot AI review requested due to automatic review settings May 3, 2026 13:33
@joao-m-ferreira joao-m-ferreira requested a review from awanlin May 3, 2026 13:33
@backstage-service backstage-service added the workspace/tech-insights Used to tag tech-insights workspace issues and pull requests label May 3, 2026
@backstage-goalie
Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-tech-insights-maturity workspaces/tech-insights/plugins/tech-insights-maturity minor v0.6.5

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds configurable grouping to the MaturityScorePage in the tech-insights maturity plugin, allowing consumers to group maturity checks by either built-in rank tiers or custom metadata.category values.

Changes:

  • Introduces MaturityScorePageProps with groupBy and categoryOrder, and exports them via the package public API.
  • Updates the check table rendering to support category-grouped accordions with status chips.
  • Adds tests for category grouping + categoryOrder, updates API report, and includes a changeset.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
workspaces/tech-insights/plugins/tech-insights-maturity/src/components/MaturityScorePage/MaturityScorePage.tsx Adds groupBy/categoryOrder props and category-based grouping logic
workspaces/tech-insights/plugins/tech-insights-maturity/src/components/MaturityScorePage/maturityTableRows.tsx Supports category headers via Chip and updated expansion logic
workspaces/tech-insights/plugins/tech-insights-maturity/src/components/MaturityScorePage/MaturityScorePage.test.tsx Adds tests for category grouping and ordering
workspaces/tech-insights/plugins/tech-insights-maturity/src/index.ts Exports MaturityScorePage + MaturityScorePageProps from package entrypoint
workspaces/tech-insights/plugins/tech-insights-maturity/src/components/MaturityScorePage/index.ts Re-exports MaturityScorePageProps from component barrel
workspaces/tech-insights/plugins/tech-insights-maturity/report.api.md API report updated for new exports
workspaces/tech-insights/.changeset/add-category-grouping.md Minor changeset for new props

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joao-m-ferreira joao-m-ferreira force-pushed the feat/maturity-category-grouping branch from 5a573dd to 5ec9ed4 Compare May 3, 2026 13:48
Copilot AI review requested due to automatic review settings May 3, 2026 13:58
@joao-m-ferreira joao-m-ferreira force-pushed the feat/maturity-category-grouping branch from 5ec9ed4 to 4475fe1 Compare May 3, 2026 13:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joao-m-ferreira joao-m-ferreira force-pushed the feat/maturity-category-grouping branch from 4475fe1 to b286329 Compare May 3, 2026 17:10
Copilot AI review requested due to automatic review settings May 3, 2026 17:19
@joao-m-ferreira joao-m-ferreira force-pushed the feat/maturity-category-grouping branch from b286329 to d5c963d Compare May 3, 2026 17:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joao-m-ferreira joao-m-ferreira force-pushed the feat/maturity-category-grouping branch from d5c963d to dc185a6 Compare May 3, 2026 18:02
…MaturityScorePage

Add configurable grouping mode to MaturityScorePage component:
- groupBy='rank' (default): groups by Bronze/Silver/Gold tiers (unchanged behavior)
- groupBy='category': groups by check metadata.category
- categoryOrder: optional ordered list of category names

This allows adopters to organize maturity checks by custom categories
rather than the built-in rank tiers, without breaking existing usage.

Changes:
- MaturityScorePage: accept MaturityScorePageProps with groupBy/categoryOrder
- maturityTableRows: support both rank-based and category-based accordion headers
- Export MaturityScorePage and MaturityScorePageProps from package index
- Add tests for category grouping mode and categoryOrder ordering

Signed-off-by: joao-m-ferreira <joao.m.n.ferreira@gmail.com>
Copilot AI review requested due to automatic review settings May 3, 2026 18:13
@joao-m-ferreira joao-m-ferreira force-pushed the feat/maturity-category-grouping branch from dc185a6 to ed84c3a Compare May 3, 2026 18:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +145 to +149
By default, the Maturity Scorecards page groups checks by rank tier (Bronze / Silver / Gold). You can switch to category-based grouping using the `groupBy` prop:

```tsx
<EntityMaturityScorecardContent groupBy="category" />
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workspace/tech-insights Used to tag tech-insights workspace issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants