Skip to content

feat(scorecard):Added extension for scorecard homepage and metric page#2637

Open
rohitratannagar wants to merge 6 commits intoredhat-developer:mainfrom
rohitratannagar:feat/scorecard-homepage-extensions
Open

feat(scorecard):Added extension for scorecard homepage and metric page#2637
rohitratannagar wants to merge 6 commits intoredhat-developer:mainfrom
rohitratannagar:feat/scorecard-homepage-extensions

Conversation

@rohitratannagar
Copy link
Copy Markdown
Contributor

@rohitratannagar rohitratannagar commented Mar 29, 2026

description

JIRA TICKET: https://redhat.atlassian.net/browse/RHIDP-12535

  • Add Scorecard NFS extension support for both homepage cards and metric page, and wire modules into the scorecard dev app.
  • Expand Playwright coverage to support both legacy and nfs modes via APP_MODE,
Screen.Recording.2026-03-29.at.11.20.32.PM.mov

✔️ 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)

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Add scorecard homepage extensions and refactor alpha module structure

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Added homepage extensions with scorecard widgets for GitHub and Jira metrics
• Refactored alpha exports to separate concerns into dedicated extension files
• Integrated home plugin with dynamic homepage layout configuration
• Added home navigation support and updated sidebar navigation ordering
• Updated dependencies to include home plugin and dynamic homepage packages
Diagram
flowchart LR
  A["Scorecard Plugin"] -->|"exports"| B["API Extension"]
  A -->|"exports"| C["Entity Tab Extension"]
  A -->|"exports"| D["Homepage Widgets"]
  A -->|"exports"| E["Metric Page Extension"]
  D -->|"includes"| F["GitHub Homepage Card"]
  D -->|"includes"| G["Jira Homepage Card"]
  H["App Config"] -->|"configures"| I["Homepage Layout"]
  I -->|"displays"| F
  I -->|"displays"| G
  J["App.tsx"] -->|"registers"| K["Home Module"]
  K -->|"uses"| D
Loading

Grey Divider

File Changes

1. workspaces/scorecard/plugins/scorecard/src/alpha/extensions/api.ts ✨ Enhancement +36/-0

Created API extension for scorecard service

workspaces/scorecard/plugins/scorecard/src/alpha/extensions/api.ts


2. workspaces/scorecard/plugins/scorecard/src/alpha/extensions/homePageCards.tsx ✨ Enhancement +71/-0

Added homepage widget extensions for metrics

workspaces/scorecard/plugins/scorecard/src/alpha/extensions/homePageCards.tsx


3. workspaces/scorecard/plugins/scorecard/src/alpha/extensions/metricPage.tsx ✨ Enhancement +31/-0

Created metric page extension blueprint

workspaces/scorecard/plugins/scorecard/src/alpha/extensions/metricPage.tsx


View more (8)
4. workspaces/scorecard/plugins/scorecard/src/alpha/index.tsx ✨ Enhancement +84/-0

Refactored alpha exports with new modules

workspaces/scorecard/plugins/scorecard/src/alpha/index.tsx


5. workspaces/scorecard/plugins/scorecard/src/alpha/extensions/entityTab.tsx ✨ Enhancement +4/-74

Simplified entity tab extension file

workspaces/scorecard/plugins/scorecard/src/alpha/extensions/entityTab.tsx


6. workspaces/scorecard/plugins/scorecard/package.json Dependencies +4/-2

Updated exports path and added dependencies

workspaces/scorecard/plugins/scorecard/package.json


7. workspaces/scorecard/packages/app/package.json Dependencies +2/-0

Added home and dynamic homepage plugins

workspaces/scorecard/packages/app/package.json


8. workspaces/scorecard/packages/app/src/App.tsx ✨ Enhancement +8/-0

Registered home and scorecard modules

workspaces/scorecard/packages/app/src/App.tsx


9. workspaces/scorecard/app-config.yaml ⚙️ Configuration changes +28/-1

Configured homepage layout and widgets

workspaces/scorecard/app-config.yaml


10. workspaces/scorecard/packages/app/src/modules/nav/Sidebar.tsx ✨ Enhancement +9/-1

Added home navigation to sidebar ordering

workspaces/scorecard/packages/app/src/modules/nav/Sidebar.tsx


11. workspaces/scorecard/plugins/scorecard/dev/index.tsx ✨ Enhancement +4/-0

Integrated home plugin in dev environment

workspaces/scorecard/plugins/scorecard/dev/index.tsx


Grey Divider

Qodo Logo

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app bot commented Mar 29, 2026

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
app-legacy workspaces/scorecard/packages/app-legacy none v0.0.0
app workspaces/scorecard/packages/app none v0.0.0
@red-hat-developer-hub/backstage-plugin-scorecard workspaces/scorecard/plugins/scorecard minor v2.4.0

@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge bot commented Mar 29, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Scorecard API not wired 🐞 Bug ✓ Correctness
Description
The scorecard NFS app registers Scorecard homepage widgets, but it does not register the Scorecard
frontend plugin that provides the ApiBlueprint for scorecardApiRef. As a result, any widget/page/tab
using useApi(scorecardApiRef) will fail at runtime due to a missing API implementation.
Code

workspaces/scorecard/packages/app/src/App.tsx[R35-43]

const app = createApp({
  features: [
    rhdhThemeModule,
+    homePageModule,
+    homepageTranslationsModule,
+    scorecardHomeModule,
    scorecardCatalogModule,
    scorecardTranslationsModule,
    signInModule,
Evidence
The app only adds scorecard modules (home/catalog/translations) to createApp features, but the
Scorecard API factory is created as an ApiBlueprint extension (scorecardApi) and is only registered
via the default Scorecard frontend plugin’s extensions list. ScorecardHomepageCard fetches data
through useAggregatedScorecard, which calls useApi(scorecardApiRef), so missing registration will
break homepage widgets. Other NFS apps in this repo (e.g., orchestrator) explicitly add the plugin
default export to features alongside modules, indicating that plugin registration is required to
wire its API/extensions.

workspaces/scorecard/packages/app/src/App.tsx[35-45]
workspaces/scorecard/plugins/scorecard/src/alpha/index.tsx[45-51]
workspaces/scorecard/plugins/scorecard/src/alpha/extensions/api.ts[17-35]
workspaces/scorecard/plugins/scorecard/src/hooks/useAggregatedScorecard.tsx[29-41]
workspaces/orchestrator/packages/app/src/App.tsx[17-34]

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

### Issue description
`workspaces/scorecard/packages/app/src/App.tsx` registers `scorecardHomeModule` (homepage widgets) and other scorecard modules, but it never registers the Scorecard frontend plugin default export. The Scorecard API implementation (`scorecardApiRef` -> `ScorecardApiClient`) is provided via an `ApiBlueprint` extension that is attached to the default frontend plugin; without adding that plugin to `createApp({ features: [...] })`, `useApi(scorecardApiRef)` calls will fail.

### Issue Context
- `useAggregatedScorecard` calls `useApi(scorecardApiRef)`.
- The API factory is created in `scorecardApi` and registered via the default Scorecard plugin’s `extensions`.

### Fix Focus Areas
- workspaces/scorecard/packages/app/src/App.tsx[17-45]

### Expected change
1. Import the default plugin export from `@red-hat-developer-hub/backstage-plugin-scorecard/alpha` (e.g., `import scorecardPlugin, { ... } from ...`).
2. Add `scorecardPlugin` to the `features` array (typically near other plugins), keeping the existing modules (`scorecardHomeModule`, `scorecardCatalogModule`, `scorecardTranslationsModule`).

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


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Comment on lines 35 to 43
const app = createApp({
features: [
rhdhThemeModule,
homePageModule,
homepageTranslationsModule,
scorecardHomeModule,
scorecardCatalogModule,
scorecardTranslationsModule,
signInModule,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Scorecard api not wired 🐞 Bug ✓ Correctness

The scorecard NFS app registers Scorecard homepage widgets, but it does not register the Scorecard
frontend plugin that provides the ApiBlueprint for scorecardApiRef. As a result, any widget/page/tab
using useApi(scorecardApiRef) will fail at runtime due to a missing API implementation.
Agent Prompt
### Issue description
`workspaces/scorecard/packages/app/src/App.tsx` registers `scorecardHomeModule` (homepage widgets) and other scorecard modules, but it never registers the Scorecard frontend plugin default export. The Scorecard API implementation (`scorecardApiRef` -> `ScorecardApiClient`) is provided via an `ApiBlueprint` extension that is attached to the default frontend plugin; without adding that plugin to `createApp({ features: [...] })`, `useApi(scorecardApiRef)` calls will fail.

### Issue Context
- `useAggregatedScorecard` calls `useApi(scorecardApiRef)`.
- The API factory is created in `scorecardApi` and registered via the default Scorecard plugin’s `extensions`.

### Fix Focus Areas
- workspaces/scorecard/packages/app/src/App.tsx[17-45]

### Expected change
1. Import the default plugin export from `@red-hat-developer-hub/backstage-plugin-scorecard/alpha` (e.g., `import scorecardPlugin, { ... } from ...`).
2. Add `scorecardPlugin` to the `features` array (typically near other plugins), keeping the existing modules (`scorecardHomeModule`, `scorecardCatalogModule`, `scorecardTranslationsModule`).

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

@rohitratannagar rohitratannagar force-pushed the feat/scorecard-homepage-extensions branch 3 times, most recently from 9b1e00c to b80c299 Compare March 29, 2026 17:47
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rohitratannagar rohitratannagar force-pushed the feat/scorecard-homepage-extensions branch from b80c299 to 5a8f965 Compare March 29, 2026 17:53
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Comment on lines 141 to 143
catalogPlugin,
homePlugin,
scorecardPlugin,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you donot need to add these explicitly.

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rohitratannagar rohitratannagar force-pushed the feat/scorecard-homepage-extensions branch from 8dcca11 to 6d025eb Compare March 30, 2026 07:07
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants