Skip to content

feat(scorecard): add support for the New Frontend System (NFS)#2487

Open
rohitratannagar wants to merge 6 commits intoredhat-developer:mainfrom
rohitratannagar:feat/scorecard-nfs-migration
Open

feat(scorecard): add support for the New Frontend System (NFS)#2487
rohitratannagar wants to merge 6 commits intoredhat-developer:mainfrom
rohitratannagar:feat/scorecard-nfs-migration

Conversation

@rohitratannagar
Copy link
Contributor

@rohitratannagar rohitratannagar commented Mar 8, 2026

Hey, I just made a Pull Request!

Description

  • Migrated scorecard Entity Tab extension to NFS using alpha API
  • Added a new app-next in the workspace to test NFS.

Fixes

scorecard entity tab -- when options are passed

Screen.Recording.2026-03-06.at.3.34.08.PM.mov

scorecard entity tab -- when options are not passed (Scorecard is shown for each kind of entity)

Screen.Recording.2026-03-06.at.3.38.40.PM.mov

Legacy App after changes

Screen.Recording.2026-03-06.at.4.00.03.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 <[email protected]>
@rhdh-qodo-merge
Copy link

Review Summary by Qodo

Add New Frontend System (NFS) support to scorecard plugin

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add New Frontend System (NFS) support to scorecard plugin
• Create app-next package with NFS-based Backstage application
• Implement scorecard catalog module with configurable entity kinds
• Add scorecard translations module for internationalization support
Diagram
flowchart LR
  A["scorecard plugin"] -->|"exports alpha API"| B["alpha.tsx"]
  B -->|"provides"| C["scorecardApi"]
  B -->|"provides"| D["createScorecardCatalogModule"]
  B -->|"provides"| E["scorecardTranslationsModule"]
  F["app-next package"] -->|"imports"| B
  F -->|"creates app with"| C
  F -->|"creates app with"| D
  F -->|"creates app with"| E
Loading

Grey Divider

File Changes

1. workspaces/scorecard/packages/app-next/public/index.html ⚙️ Configuration changes +60/-0

Add HTML template for NFS app

workspaces/scorecard/packages/app-next/public/index.html


2. workspaces/scorecard/packages/app-next/.eslintrc.js ⚙️ Configuration changes +1/-0

Add ESLint configuration for app-next

workspaces/scorecard/packages/app-next/.eslintrc.js


3. workspaces/scorecard/packages/app-next/package.json ⚙️ Configuration changes +36/-0

Create package.json for app-next frontend

workspaces/scorecard/packages/app-next/package.json


View more (7)
4. workspaces/scorecard/packages/app-next/src/App.tsx ✨ Enhancement +97/-0

Create NFS-based Backstage application component

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


5. workspaces/scorecard/packages/app-next/src/index.tsx ✨ Enhancement +5/-1

Update entry point for NFS app rendering

workspaces/scorecard/packages/app-next/src/index.tsx


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

Add NFS dependencies and update alpha export

workspaces/scorecard/plugins/scorecard/package.json


7. workspaces/scorecard/plugins/scorecard/src/alpha.tsx ✨ Enhancement +120/-0

Implement NFS plugin with catalog module support

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


8. workspaces/scorecard/plugins/scorecard/report-alpha.api.md 📝 Documentation +55/-0

Update API documentation for NFS exports

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


9. workspaces/scorecard/package.json ⚙️ Configuration changes +1/-0

Add start:next script for NFS development

workspaces/scorecard/package.json


10. workspaces/scorecard/tsconfig.json ⚙️ Configuration changes +10/-1

Configure TypeScript paths for NFS support

workspaces/scorecard/tsconfig.json


Grey Divider

Qodo Logo

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Mar 8, 2026

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-orchestrator-backend-module-loki
  • @red-hat-developer-hub/backstage-plugin-orchestrator-backend
  • @red-hat-developer-hub/backstage-plugin-orchestrator-common
  • @red-hat-developer-hub/backstage-plugin-orchestrator-form-api
  • @red-hat-developer-hub/backstage-plugin-orchestrator-form-react
  • @red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets
  • @red-hat-developer-hub/backstage-plugin-orchestrator-node
  • @red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator
  • @red-hat-developer-hub/backstage-plugin-scorecard-backend
  • @red-hat-developer-hub/backstage-plugin-x2a-common
  • @red-hat-developer-hub/backstage-plugin-x2a

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-backend-module-loki workspaces/orchestrator/plugins/orchestrator-backend-module-loki none v1.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator-backend workspaces/orchestrator/plugins/orchestrator-backend none v8.7.1
@red-hat-developer-hub/backstage-plugin-orchestrator-common workspaces/orchestrator/plugins/orchestrator-common none v3.5.1
@red-hat-developer-hub/backstage-plugin-orchestrator-form-api workspaces/orchestrator/plugins/orchestrator-form-api none v2.5.1
@red-hat-developer-hub/backstage-plugin-orchestrator-form-react workspaces/orchestrator/plugins/orchestrator-form-react none v2.6.1
@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets workspaces/orchestrator/plugins/orchestrator-form-widgets none v1.7.2
@red-hat-developer-hub/backstage-plugin-orchestrator-node workspaces/orchestrator/plugins/orchestrator-node none v1.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator workspaces/orchestrator/plugins/orchestrator patch v5.5.1
@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator none v1.4.1
app-next workspaces/scorecard/packages/app-next none v0.0.0
@red-hat-developer-hub/backstage-plugin-scorecard-backend workspaces/scorecard/plugins/scorecard-backend none v2.4.0
@red-hat-developer-hub/backstage-plugin-scorecard workspaces/scorecard/plugins/scorecard patch v2.4.0
@red-hat-developer-hub/backstage-plugin-x2a-common workspaces/x2a/plugins/x2a-common none v1.0.2
@red-hat-developer-hub/backstage-plugin-x2a workspaces/x2a/plugins/x2a none v1.0.2

@rhdh-qodo-merge
Copy link

rhdh-qodo-merge bot commented Mar 8, 2026

Code Review by Qodo

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

Grey Divider


Action required

1. Non-object spread in params🐞 Bug ✓ Correctness
Description
createScorecardEntityContent computes filter using options?.entityKinds?.length && ..., which
can evaluate to 0/undefined; the subsequent ...(filter && { filter }) spreads a non-object
union into params, likely breaking TypeScript compilation for the workspace.
Code

workspaces/scorecard/plugins/scorecard/src/alpha.tsx[R74-82]

+  const filter =
+    options?.entityKinds?.length &&
+    `kind:${options.entityKinds.map(k => k.toLowerCase()).join(',')}`;
+  return EntityContentBlueprint.make({
+    name: 'scorecard',
+    params: {
+      ...defaultScorecardEntityContentParams,
+      ...(filter && { filter }),
+    },
Evidence
The code builds filter using &&, making it potentially 0 | undefined | string. The expression
filter && { filter } can therefore be 0 | undefined | {filter: string}, and object spread in
params requires an object type. This file is part of the TypeScript compilation scope for the
workspace (plugins/*/src).

workspaces/scorecard/plugins/scorecard/src/alpha.tsx[71-84]
workspaces/scorecard/tsconfig.json[1-8]

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

## Issue description
`createScorecardEntityContent` uses `options?.entityKinds?.length &amp;amp;&amp;amp; ...` to compute `filter`, and then spreads `...(filter &amp;amp;&amp;amp; { filter })` into an object literal. This pattern can produce a non-object value (`0`/`undefined`) on the spread operand side, which is unsafe and commonly fails TypeScript compilation.
## Issue Context
This file is included in the workspace TypeScript build via `workspaces/scorecard/tsconfig.json`.
## Fix
1. Compute `filter` with a ternary so its type is `string | undefined`.
2. Use a ternary spread: `...(filter ? { filter } : {})`.
Example:

ⓘ 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 <[email protected]>
Comment on lines +74 to +82
const filter =
options?.entityKinds?.length &&
`kind:${options.entityKinds.map(k => k.toLowerCase()).join(',')}`;
return EntityContentBlueprint.make({
name: 'scorecard',
params: {
...defaultScorecardEntityContentParams,
...(filter && { filter }),
},

This comment was marked as resolved.

Signed-off-by: rohitratannagar <[email protected]>
Signed-off-by: rohitratannagar <[email protected]>
@rohitratannagar
Copy link
Contributor Author

/cc @rohitkrai03
/cc @its-mitesh-kumar

@openshift-ci openshift-ci bot requested a review from rohitkrai03 March 9, 2026 05:54
@rohitratannagar rohitratannagar force-pushed the feat/scorecard-nfs-migration branch from 66d63f5 to 22e3a7c Compare March 11, 2026 20:57
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
22.8% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant