feat(cost-management): add New Frontend System /alpha export - #4706
feat(cost-management): add New Frontend System /alpha export#4706PreetiW wants to merge 5 commits into
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4706 +/- ##
=======================================
Coverage 62.72% 62.72%
=======================================
Files 2636 2637 +1
Lines 105422 105431 +9
Branches 29556 29546 -10
=======================================
+ Hits 66125 66131 +6
- Misses 37489 37496 +7
+ Partials 1808 1804 -4
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Ship a dual-export frontend so the plugin loads in RHDH 2.1 while keeping legacy PluginRoot wiring. NFS sidebar uses Optimizations and Cost Management. Signed-off-by: Preeti Wadhwani <preeti.dev.git@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Split packages/app into an NFS frontend (yarn start) and app-legacy (yarn start:legacy) so reviewers can exercise /alpha against the full RBAC backend with the RHDH theme. Signed-off-by: Preeti Wadhwani <preeti.dev.git@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Yarn start landed on `/` with no page. Redirect to `/catalog` like the legacy app, and register the RBAC `/alpha` plugin so reviewers can edit policies without switching to app-legacy. Signed-off-by: Preeti Wadhwani <preeti.dev.git@gmail.com> Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
c7d5015 to
41c39bf
Compare
Reuse the legacy Administration sidebar item so RBAC is shown only when getUserAuthorization() returns Authorized, matching yarn start:legacy. Signed-off-by: Preeti Wadhwani <preeti.dev.git@gmail.com> Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
|



Hey, I just made a Pull Request!
Fixes RHINENG-30495.
Add a New Frontend System
/alphaexport so Cost Management loads in RHDH 2.1 (app-next+ENABLE_STANDARD_MODULE_FEDERATION=true). RHDH 2.1 no longer hosts the legacy frontend; without this the plugin cannot be discovered as an NFS feature.What this PR does
@red-hat-developer-hub/plugin-cost-management/alpha(createFrontendPlugindefault export). LegacycreatePlugin/ResourceOptimizationPage/OpenShiftPage/PluginRootstay on the main export.PageBlueprints (flat sidebar; no nested parent group):/cost-management/optimizations(page:cost-management)/cost-management/openshift(page:cost-management/openshift)ApiBlueprints (optimizations,orchestrator-slim,cost-management-slim) and anIconBundleBlueprint.OptimizationsRouterfor NFS (list +/:idbreakdown only). OpenShift is a separate page, not a nested route under Optimizations.usePatternFlyTheme()onOpenShiftPageso the standalone OpenShift page still applies PatternFly theme/header behavior under NFS.packages/appis NFS + RHDH theme (yarn start); current shell moved topackages/app-legacy(yarn start:legacy). Both share the full RBAC backend.dev/index.tsx(yarn start:fe-plugin); legacycreateDevAppindev/legacy.tsx(yarn start:fe-plugin:legacy).report-alpha.api.md), and a minor changeset.Out of scope (follow-ups)
menuItems.parent) — RHDH NFS gap; see RHDH-specific gaps.Test plan
Run from
workspaces/cost-management/(Node 22 or 24). Live data needscostManagement.clientId/clientSecretinapp-config.local.yaml. RBAC usespolicy.local.csv.1. Install and unit tests
Expect 6 passing tests: plugin validity and id, routes, extension ids, Optimizations path/title, OpenShift path with title Cost Management.
Optional extra checks:
2. NFS workspace app (primary review path)
This starts
packages/app(NFS + RHDH theme) andpackages/backend(permission + RBAC). Frontend typically http://localhost:3000, backend http://localhost:7007.policy.local.csv; click a recommendation and confirm/cost-management/optimizations/:idbreakdown still works./cost-management/openshiftloads (theme/header present; not a blank page). Direct URL works without going through Optimizations.policy.local.csv(this is the full backend, not allow-all).3. Legacy workspace app (no regression)
packages/app-legacystill usescreateApp/FlatRoutes./cost-management/optimizationsand/cost-management/openshiftstill render./cost-management/optimizations/openshifton the legacyRouteris unchanged (NFS does not use that nested path).4. Plugin-only (optional, no RBAC)
These do not load the permission/RBAC plugins. Use
yarn start/yarn start:legacyto test policies.✔️ Checklist