Skip to content

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

Open
rohitratannagar wants to merge 61 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 61 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 <rohitratannagar2003@gmail.com>
@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

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 patch v2.4.0

@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 <rohitratannagar2003@gmail.com>
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 <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@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
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rohitratannagar rohitratannagar force-pushed the feat/scorecard-nfs-migration branch from 66d63f5 to 22e3a7c Compare March 11, 2026 20:57
johnmcollier and others added 11 commits March 12, 2026 16:51
…l formatting (redhat-developer#2400)

* feat(mcp-integrations): align mcp-integrations with upstream MCP tool formatting

Signed-off-by: John Collier <jcollier@redhat.com>

* Add changeset

Signed-off-by: John Collier <jcollier@redhat.com>

* Clean up

Signed-off-by: John Collier <jcollier@redhat.com>

* yarn.lock + app-config cleanup

Signed-off-by: John Collier <jcollier@redhat.com>

---------

Signed-off-by: John Collier <jcollier@redhat.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* feat(translations): added i18n cli tools

Signed-off-by: Yi Cai <yicai@redhat.com>

* fixed bugs

Signed-off-by: Yi Cai <yicai@redhat.com>

* feat(translations-cli): add download and deploy commands with multi-repo support

- Add download command to fetch completed translations from Memsource
  - Support downloading all completed jobs or specific job IDs
  - Support filtering by languages
  - Auto-detects repo type and filters files accordingly

- Add deploy command to deploy translations to TypeScript files
  - Universal deployment script supporting rhdh-plugins, community-plugins, and rhdh
  - Auto-detects repository structure and plugin locations
  - Handles different file naming conventions ({lang}.ts vs {plugin}-{lang}.ts)
  - Correctly handles import paths (./ref, ./translations, external @backstage packages)
  - Updates existing files and creates new translation files
  - Automatically updates index.ts files to register translations

- Add comprehensive documentation
  - Complete workflow guide for download and deployment
  - Multi-repo deployment documentation
  - Step-by-step instructions for all three repositories

- Update yarn.lock with latest dependencies

* fix(translations-cli): resolve SonarQube security and code quality issues

- Replace execSync with safe spawnSync to prevent command injection
  - Create safeExecSync, commandExists, and safeExecSyncOrThrow utilities
  - Use separate command and args arrays for safer execution
  - Cross-platform support (Windows/Unix) for command existence checks
  - Applied to upload, download, deploy, and config commands

- Remove code duplication to improve maintainability
  - Extract key counting logic to countTranslationKeys() utility
  - Extract download command args to buildDownloadJobArgs() helper
  - Extract job listing args to buildListJobsArgs() helper
  - Extract job download logic to downloadJob() helper function

- Fix regex operator precedence in PO file parsing
  - Group alternation explicitly: /(^["']|["']$)/g
  - Makes operator precedence clear for SonarQube compliance
  - Applied to 3 locations in loadFile.ts

All changes are refactoring only - no functional changes to workflow.
Build and lint checks pass successfully.

* fix SonarQube issue p1

Signed-off-by: Yi Cai <yicai@redhat.com>

* updated the workflow to address comments

Signed-off-by: Yi Cai <yicai@redhat.com>

* chore: update yarn.lock to sync with package.json

* resolve failed ci checks

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolve failed ci checks

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolve failed ci checks

Signed-off-by: Yi Cai <yicai@redhat.com>

* yarn dedupe

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolve failed ci checks

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved sonarCloud issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved sonarCloud issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved sonarCloud issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved security hotspots issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved security hotspots issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved security hotspots issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved security hotspots issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved security hotspots issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* resolved security hotspots issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* code cleanup

Signed-off-by: Yi Cai <yicai@redhat.com>

* improvements

Signed-off-by: Yi Cai <yicai@redhat.com>

* updated deploy command to copy translation to BCP

Signed-off-by: Yi Cai <yicai@redhat.com>

* fixed sonarQube issue

Signed-off-by: Yi Cai <yicai@redhat.com>

* fixed failed CI check

Signed-off-by: Yi Cai <yicai@redhat.com>

* code cleanup

Signed-off-by: Yi Cai <yicai@redhat.com>

* fixed tsc issue

Signed-off-by: Yi Cai <yicai@redhat.com>

* added red hat plugin filter to generate command

Signed-off-by: Yi Cai <yicai@redhat.com>

* fixed tsc:full errors

Signed-off-by: Yi Cai <yicai@redhat.com>

* addressed review comments

Signed-off-by: Yi Cai <yicai@redhat.com>

* yarn dedupe and rebase

Signed-off-by: Yi Cai <yicai@redhat.com>

---------

Signed-off-by: Yi Cai <yicai@redhat.com>
…he rhdh translations-cli (redhat-developer#2414)

* chore(translations): add changeset to release an initial version of the rhdh translations-cli

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* chore(translations): removed unused axios dependency

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* chore(translations): release cli independ from plugin

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

---------

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…redhat-developer#2394)

* feat(x2a): Introducing projects by groups. Additional RBAC hardening.

- require x2a permissions to access the UI
- enforce better the x2a permissions on the endpoints
- projects can be optionally owned by a Backstage group, still defaults to the logged-in user

Signed-off-by: Marek Libra <marek.libra@gmail.com>

* review

---------

Signed-off-by: Marek Libra <marek.libra@gmail.com>
…edhat-developer#2371)

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: JessicaJHee <73968480+JessicaJHee@users.noreply.github.com>
* migrate dry-run action

Signed-off-by: Stephanie <yangcao@redhat.com>

* add changeset

Signed-off-by: Stephanie <yangcao@redhat.com>

* update yarn.loc

Signed-off-by: Stephanie <yangcao@redhat.com>

---------

Signed-off-by: Stephanie <yangcao@redhat.com>
…r#2424)

* migrate to use scaffolderClient instead

Signed-off-by: Stephanie <yangcao@redhat.com>

* add changeset

Signed-off-by: Stephanie <yangcao@redhat.com>

---------

Signed-off-by: Stephanie <yangcao@redhat.com>
@logonoff logonoff removed their request for review March 12, 2026 12:19
@rohitratannagar rohitratannagar force-pushed the feat/scorecard-nfs-migration branch 2 times, most recently from 39eff40 to 8096358 Compare March 12, 2026 12:44
@rohitratannagar rohitratannagar force-pushed the feat/scorecard-nfs-migration branch from 8096358 to 5a68d7b Compare March 12, 2026 12:47
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
22.6% 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

import { githubAuthApiRef, gitlabAuthApiRef } from '@backstage/core-plugin-api';
import { getThemes } from '@red-hat-developer-hub/backstage-plugin-theme';
import { ScorecardHomepageCard } from '@red-hat-developer-hub/backstage-plugin-scorecard';
import scorecardPlugin, {
Copy link
Member

Choose a reason for hiding this comment

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

no need to import the scorecardPlugin

set

app:
  title: Homepage Backstage App
  baseUrl: http://localhost:3000
  **packages: all**

in your app-config.yaml, this will load all the plugins automatically

* Custom sign-in page (legacy component). SignInPageBlueprint and ThemeBlueprint
* are deprecated; sign-in and themes are provided via convertLegacyAppOptions.
*/
const customSignInPage = (props: React.ComponentProps<typeof SignInPage>) => (
Copy link
Member

Choose a reason for hiding this comment

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

you should be able to create a Signin module with the SigninPageComponent and use the module in the app plugin.
Ref: https://github.com/redhat-developer/rhdh-plugins/pull/2423/changes#diff-f515cdc8542a346bed901c9cbae817539136c2a1fb2932fa827202bcaa098a2c

* Legacy options: themes (RHDH light/dark) and SignInPage.
* Replaces deprecated SignInPageBlueprint and ThemeBlueprint modules.
*/
const legacyConvertedOptions = convertLegacyAppOptions({
Copy link
Member

Choose a reason for hiding this comment

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

After the theme migration PR (#2356) is merged, we can use the rhdhThemeModule

Comment on lines +27 to +30
import catalogPlugin from '@backstage/plugin-catalog/alpha';
import scaffolderPlugin from '@backstage/plugin-scaffolder/alpha';
import userSettingsPlugin from '@backstage/plugin-user-settings/alpha';
import rbac from '@backstage-community/plugin-rbac/alpha';
Copy link
Member

Choose a reason for hiding this comment

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

not needed. same reason as above

/**
* Options for when to show the Scorecard tab on catalog entity pages.
* Pass these from the app (e.g. app-next App.tsx) to control visibility.
* @public
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @public
* @alpha

/**
* Creates the Scorecard entity tab extension with optional filter.
* Use this when the app wants to control which entity kinds show the Scorecard tab.
* @public
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @public
* @alpha

/**
* Creates a module that registers the Scorecard entity tab with the given options.
* Pass entity kinds from the app (e.g. in app-next App.tsx) to control which entities show the tab.
* @public
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @public
* @alpha

});
}

/** Module registering Scorecard translations in app */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** Module registering Scorecard translations in app */
/** Module registering Scorecard translations in app */
/**
* @alpha
*/

},
});

/** Main Scorecard frontend plugin */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** Main Scorecard frontend plugin */
/** Main Scorecard frontend plugin */
/**
* @alpha
*/

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.