Skip to content

chore(app-next): add runnable RHDH NFS shell for local development#5115

Open
ciiay wants to merge 10 commits into
redhat-developer:mainfrom
ciiay:chore/app-next-local-dev-setup
Open

chore(app-next): add runnable RHDH NFS shell for local development#5115
ciiay wants to merge 10 commits into
redhat-developer:mainfrom
ciiay:chore/app-next-local-dev-setup

Conversation

@ciiay

@ciiay ciiay commented Jul 15, 2026

Copy link
Copy Markdown
Member

Description

Make app-next a runnable RHDH NFS shell for local development and Module Federation plugin testing.

This PR makes NFS testing easier for RHIDP-14018: stock app-next does not yet have an NFS-ready homepage plugin path, so teams cannot verify homepage-dependent features (e.g. unread notifications cards) without ad-hoc setup.

Optional plugins (notifications, signals, etc.) are not bundled in the shell — export them into dynamic-plugins-root (see README).

Changes

App shell (packages/app-next/)

  • src/App.tsx — slim NFS shell: nav, visualizer, catalog/home/scaffolder/search/user-settings, appDrawerModule, temporary static homePageModule, and rhdhDynamicFrontendFeaturesLoader()
  • Removed static custom sign-in and quickstart-help modules (use app-auth + DP quickstart instead)
  • src/modules/dynamicFeatures/ — temporary MF loader that also registers named FrontendFeature exports (needed for global-header’s globalHeaderModule and notifications’ notifications-home-module)
  • dynamic-plugins.example.yaml — example OCI set (app-auth, app-integrations, global-header, quickstart; homepage/theme left commented — OFS-shaped)
  • README.md — install/run, local config overlay, homepage-card testing (e.g. unread notifications), optional local NFS export of homepage/theme from rhdh-plugins
  • package.json / App.test.tsx — deps and test mocks aligned with the slim shell

Repo config

  • app-config.yamlreverts NFS app.extensions and local auth that were added earlier; NFS/auth live in app-config.local.yaml only (shared config stays safe for legacy packages/app / CI)

Review follow-ups / temporary exceptions

Item Status
Don’t bake custom sign-in Done — use app-auth (+ app-integrations) via DP
Don’t statically bake RHDH UX; use example dynamic-plugins.yaml Done for auth/header/quickstart
Homepage via DP Blocked by OFS OCI; static homePageModule until NFS overlay or local export
Named MF exports Temporary rhdhDynamicFrontendFeaturesLoader

Which issue(s) does this PR fix

  • Fixes #?

RHIDP-14018

PR acceptance criteria

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

Build and run

  • yarn install (from repo root)
  • cp packages/app-next/dynamic-plugins.example.yaml dynamic-plugins.yaml
  • npx -y @red-hat-developer-hub/cli-module-install-dynamic-plugins@0.2.0 install dynamic-plugins-root (needs skopeo)
  • Put NFS app.extensions + guest auth in app-config.local.yaml (example in packages/app-next/README.md)
  • EXPERIMENTAL_MODULE_FEDERATION=true yarn workspace app-next build
  • yarn workspace backend start:next

Shell verification

  • Sign in as guest (via app-auth DP)
  • / renders RHDH homepage (static homePageModule + homePlugin)
  • Sidebar: Search, Home, Catalog, Scaffolder, Settings
  • Global header + quickstart drawer via DP remotes
  • /visualizer/tree shows core + DP extensions

Homepage cards (optional — e.g. unread notifications)

  • Export notifications (with notifications-home-module MF expose) + signals into dynamic-plugins-root
  • Enable home-page-widget:home/unread-notifications in app-config.local.yaml
  • Confirm widget on / and in /visualizer/tree
    Details: packages/app-next/README.mdTesting homepage cards

Unit tests

  • yarn workspace app-next test

Screenshot

image

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.53%. Comparing base (42bb785) to head (40edf41).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5115      +/-   ##
==========================================
+ Coverage   56.03%   63.53%   +7.49%     
==========================================
  Files         123      123              
  Lines        2404     2424      +20     
  Branches      553      576      +23     
==========================================
+ Hits         1347     1540     +193     
+ Misses       1051      882     -169     
+ Partials        6        2       -4     
Flag Coverage Δ
rhdh 63.53% <ø> (+7.49%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42bb785...40edf41. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ciiay
ciiay force-pushed the chore/app-next-local-dev-setup branch from 7fc3586 to 822377d Compare July 16, 2026 02:58
@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@github-actions

Copy link
Copy Markdown
Contributor

The container image build and publish workflows were skipped (either due to [skip-build] tag or no relevant changes with existing image).

@github-actions

Copy link
Copy Markdown
Contributor

The container image build and publish workflows were skipped (either due to [skip-build] tag or no relevant changes with existing image).

@ciiay
ciiay force-pushed the chore/app-next-local-dev-setup branch from 31afaeb to c6ad81c Compare July 17, 2026 00:14
@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

import { createFrontendModule } from '@backstage/frontend-plugin-api';
import { SignInPageBlueprint } from '@backstage/plugin-app-react';

export const signInModule = createFrontendModule({

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.

It would be better to pull in app-auth (link to artifact here) for this, I believe going with this approach will prevent being able to potentially swap out the default sign-in. And then for most cases the corresponding app-integration plugin would be used to configure source control authentication (link here).

Comment thread packages/app-next/src/App.tsx Outdated
catalogPlugin,
scaffolderPlugin,
searchPlugin,
rhdhThemeModule,

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.

Shouldn't these all be provided by dynamic plugins instead?

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.

With the exception of the catalogPlugin, scaffolderPlugin, searchPlugin and userSettingsPlugin, only because scaffolder-backend can't be provided via a dynamic plugin at the moment, and so the related plugins may as well stay in place. But I thought generally we wanted to avoid baking too much into the RHDH frontend/backend and rely on providing functionality via dynamic plugins.

Comment thread app-config.yaml Outdated
RhdhTemplateSection:
priority: 300
breakpoints:
xl: { w: 12, h: 5 }

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.

Probably not exactly related to this particular PR but it seems odd that we're still exposing this level of layout customization via yaml, how often is this actually customized by users? All of this breakpoint config seems like it'd be better left in the plugin code and customized via css instead.

@gashcrumb gashcrumb left a comment

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.

I would avoid adding these plugins to the app initialization and instead rely on the frontend dynamic feature loader discovery and dynamic plugins. We could instead include an example "dynamic-plugns.yaml" file that could be used to populate the default set of dynamic plugins that make up the typical RHDH user experience. Otherwise we'll wind up having to removing these later on when users find they are unable to swap out plugins.

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

ciiay and others added 8 commits July 20, 2026 11:00
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Align @module-federation/enhanced with Backstage and mock
fetchOverrideTranslations so CI no longer hangs on localhost.

Co-authored-by: Cursor <cursoragent@cursor.com>
Export the translations mock as ESM and stub global fetch so init
cannot hang on localhost in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use sync DynamicRoot import and testing-library render instead of
renderWithEffects so background app promises cannot block the suite,
and assert createApp via a shared module mock.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ciiay
ciiay force-pushed the chore/app-next-local-dev-setup branch from 4ca7c46 to a33e46c Compare July 20, 2026 15:02
@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

Restore explicit parameter types so packages/app tsc passes under
noImplicitAny after switching to a jest.Mock createApp spy.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@christoph-jerolimov christoph-jerolimov left a comment

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.

We need a way to make testing easier, but without adding new dependencies from rhdh-plugins here.

Comment thread packages/app-next/package.json Outdated
Comment on lines +82 to +83
"@red-hat-developer-hub/backstage-plugin-app-react": "0.0.5",
"@red-hat-developer-hub/backstage-plugin-homepage": "1.15.0",

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.

We don't want that this are direct dependencies, we want load them as "dynamic plugins" from container images.

Keep static homePageModule until RHIDP-14519 promotes NFS to stable;
document local MF export path using rhdh-plugins main default alpha export.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

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.

3 participants