Skip to content

Commit 9bd2131

Browse files
committed
feat(deployment): Add new frontend system option
Add optional new-frontend-system (app-next) support on RHDHDeployment: merge package NFS YAML with the same pipeline as common → auth → user (later wins), instead of a separate loader path. - Secrets: splice NFS secrets into mergeYamlFilesIfExists before a single envsubst pass (common → auth → NFS when active → user). - Dynamic plugins: splice config/new-frontend-system/dynamic-plugins.yaml after auth and before workspace/generated config so NFS OCI entries act as defaults; user dynamic-plugins.yaml and metadata still override. - Layout: move NFS assets to config/new-frontend-system/ (secrets.yaml, dynamic-plugins.yaml, value_file.yaml); group paths under DEFAULT_CONFIG_PATHS.newFrontendSystem (secrets, dynamicPlugins, valueFile). - Drop duplicate includes from the NFS dynamic-plugins fragment (common already includes dynamic-plugins.default.yaml). - Remove new-frontend-system-plugins.ts (env-based OCI overrides), its tests, and RHDH_E2E_NFS_*_ENV exports; pin app-auth / app-integrations via standard workspace dynamic-plugins.yaml. - Auto-enable when configure() omits the flag if the namespace ends with -app-next or USE_NEW_FRONTEND_SYSTEM=true; explicit useNewFrontendSystem true/false still wins via ??. Docs and tests updated for merge order, env var, and consumer migration notes. Assisted-By: Cursor Desktop rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent a3d6b86 commit 9bd2131

20 files changed

Lines changed: 242 additions & 20 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ src/
2525
│ │ ├── deployment.ts # Main class (configure, deploy, waitUntilReady, teardown)
2626
│ │ ├── types.ts # DeploymentOptions, DeploymentConfig
2727
│ │ ├── constants.ts # Config paths, auth providers, chart URLs
28-
│ │ └── config/ # YAML templates (common/, auth/, helm/, operator/)
28+
│ │ └── config/ # YAML templates (common/, auth/, new-frontend-system/, helm/, operator/)
2929
│ ├── keycloak/ # KeycloakHelper — Keycloak Helm deployment + OIDC setup
3030
│ └── orchestrator/ # Workflow orchestrator installer
3131
├── playwright/
@@ -81,18 +81,22 @@ yarn check # typecheck + lint + prettier
8181

8282
## Key Architectural Concepts
8383

84-
### Configuration Merging (3-level cascade)
84+
### Configuration Merging (layered cascade)
8585

8686
```
8787
Package defaults (config/common/)
8888
↓ deep merge
8989
Auth-specific (config/auth/{keycloak|guest|github}/)
90+
↓ deep merge (when useNewFrontendSystem)
91+
New frontend system defaults (config/new-frontend-system/)
9092
↓ deep merge
9193
User config (workspace's tests/config/*.yaml)
9294
9395
= Final merged config
9496
```
9597

98+
`useNewFrontendSystem` is true when set explicitly, when the namespace ends with `-app-next`, or when `USE_NEW_FRONTEND_SYSTEM=true`. Secrets use the same layer order, then a single `envsubst` pass on the merged result.
99+
96100
Array merge uses "replace" strategy by default. Plugin arrays use `byKey: "package"` with normalized keys (strips trailing `-dynamic`).
97101

98102
### Plugin Metadata Resolution

docs/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ When documenting, reference these source files:
200200
| YAML Merging | `src/utils/merge-yamls.ts` |
201201
| Bash ($) | `src/utils/bash.ts` |
202202
| envsubst | `src/utils/common.ts` |
203-
| Config Templates | `src/deployment/rhdh/config/{common,auth,helm,operator}/` |
203+
| Config Templates | `src/deployment/rhdh/config/{common,auth,new-frontend-system,helm,operator}/` |
204204

205205
## Common Tasks
206206

docs/api/deployment/deployment-types.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ type DeploymentOptions = {
4242
method?: DeploymentMethod;
4343
valueFile?: string;
4444
subscription?: string;
45+
disableWrappers?: string[];
46+
useNewFrontendSystem?: boolean;
4547
};
4648
```
4749

@@ -56,6 +58,8 @@ type DeploymentOptions = {
5658
| `method` | `DeploymentMethod` | Installation method |
5759
| `valueFile` | `string` | Helm values file (Helm only) |
5860
| `subscription` | `string` | Backstage CR file (Operator only) |
61+
| `disableWrappers` | `string[]` | Wrapper plugins to disable (PR builds) |
62+
| `useNewFrontendSystem` | `boolean` | New frontend system (app-next / NFS). Omit to auto-detect from namespace suffix `-app-next` or `USE_NEW_FRONTEND_SYSTEM=true`; set `false` to disable. See [RHDH deployment](/guide/deployment/rhdh-deployment#new-frontend-system-usenewfrontendsystem) |
5963

6064
## DeploymentConfigBase
6165

@@ -67,6 +71,8 @@ type DeploymentConfigBase = {
6771
appConfig: string;
6872
secrets: string;
6973
dynamicPlugins: string;
74+
disableWrappers: string[];
75+
useNewFrontendSystem: boolean;
7076
};
7177
```
7278

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.1.41] - Current
6+
7+
### Added
8+
9+
- **`useNewFrontendSystem`** — Backstage **app-next** / new frontend system: merges NFS layers from `config/new-frontend-system/` (secrets, default **app-auth** and **app-integrations** plugins, Helm `value_file.yaml`) into the same merge pipelines as common/auth/user. Secrets are merged with other layers **before** a single `envsubst` pass. NFS dynamic plugins act as **defaults** (workspace `tests/config/dynamic-plugins.yaml` overrides). **Auto-detection:** enabled when the namespace ends with `-app-next` or `USE_NEW_FRONTEND_SYSTEM=true`, unless `useNewFrontendSystem: false` is passed. Optional workspace `tests/config/value_file-app-next.yaml` is still merged last for Helm.
10+
511
## [1.1.40] - Current
612

713
### Changed

docs/guide/configuration/config-files.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ catalog:
4646
4747
Configure dynamic plugins:
4848
49+
::: tip `useNewFrontendSystem`
50+
If you run against the **app-next** shell, enable the new frontend system (pass `useNewFrontendSystem: true`, use a project/namespace suffix **`-app-next`**, or set **`USE_NEW_FRONTEND_SYSTEM=true`** — see [RHDH deployment](/guide/deployment/rhdh-deployment#new-frontend-system-usenewfrontendsystem)). The package merges default **app-auth** and **app-integrations** OCI plugins as **defaults**; override versions in this file when they must differ.
51+
:::
52+
4953
```yaml
5054
includes:
5155
- dynamic-plugins.default.yaml

docs/guide/configuration/environment-variables.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ These are set automatically during deployment:
3535
| `CHART_URL` | Custom Helm chart URL | `oci://quay.io/rhdh/chart` |
3636
| `SKIP_KEYCLOAK_DEPLOYMENT` | Skip Keycloak auto-deploy | `false` |
3737
| `RHDH_SKIP_PLUGIN_METADATA_INJECTION` | Disable plugin metadata injection (local only, ignored in CI) | - |
38+
| `USE_NEW_FRONTEND_SYSTEM` | When `"true"`, enables new-frontend-system (app-next) merges when `useNewFrontendSystem` is not set in `configure()` options | - |
3839

3940
## Plugin Metadata Variables
4041

@@ -53,6 +54,21 @@ These control automatic plugin configuration injection from metadata files.
5354
| `JOB_NAME` | CI job name (set by OpenShift CI/Prow) | If contains `periodic-`, nightly mode is activated |
5455
| `JOB_MODE` | CI-only: `nightly` or `pr-check` (set by step registry) | Informational |
5556

57+
## New frontend system (app-next)
58+
59+
NFS merge layers ship under `config/new-frontend-system/` in the package (secrets, dynamic plugins, Helm values), same layering idea as `auth/`.
60+
61+
**Enabling app-next behavior**
62+
63+
| Mechanism | Effect |
64+
|-----------|--------|
65+
| `useNewFrontendSystem: true` in [`configure()`](/guide/deployment/rhdh-deployment#new-frontend-system-usenewfrontendsystem) | Explicit enable |
66+
| `useNewFrontendSystem: false` | Explicit disable (overrides auto-detection) |
67+
| Playwright project / namespace ends with `-app-next` | Auto-enabled when `useNewFrontendSystem` is omitted |
68+
| `USE_NEW_FRONTEND_SYSTEM=true` | Auto-enabled for all namespaces when `useNewFrontendSystem` is omitted |
69+
70+
**Overriding default OCI refs** for **app-auth** and **app-integrations** uses the same pattern as other plugins: add or adjust entries in your workspace `tests/config/dynamic-plugins.yaml` (merged after package NFS defaults, so your versions win).
71+
5672
### OCI URL Generation
5773

5874
When `GIT_PR_NUMBER` is set, the package replaces local plugin paths with OCI URLs:

docs/guide/configuration/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The package provides configuration tools for ESLint, TypeScript, and RHDH deploy
99
| [Configuration Files](/guide/configuration/config-files) | YAML configuration structure |
1010
| [ESLint Configuration](/guide/configuration/eslint-config) | Pre-configured ESLint rules |
1111
| [TypeScript Configuration](/guide/configuration/typescript-config) | Base TypeScript settings |
12-
| [Environment Variables](/guide/configuration/environment-variables) | All environment variables |
12+
| [Environment Variables](/guide/configuration/environment-variables) | All environment variables (including NFS / app-next, e.g. `USE_NEW_FRONTEND_SYSTEM`) |
1313
| [Disabling Conflicting Wrappers](/guide/configuration/disable-wrappers) | Disabling pre-enabled wrappers that may cause configuration conflicts |
1414

1515
## Project Configuration
@@ -69,6 +69,8 @@ RHDH configurations are merged in layers:
6969
7070
This allows you to override only what you need while using sensible defaults.
7171
72+
For tests targeting the **new frontend system** (app-next), see [RHDH deployment — New frontend system](/guide/deployment/rhdh-deployment#new-frontend-system-usenewfrontendsystem) and [NFS-related options](/guide/configuration/environment-variables#new-frontend-system-app-next).
73+
7274
## Plugin Metadata Injection
7375
7476
For PR builds, the package can automatically inject plugin configurations from metadata files. See [Plugin Metadata Injection](/guide/configuration/config-files#plugin-metadata-injection) for details.

docs/guide/deployment/rhdh-deployment.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,43 @@ test("example", async ({ rhdh }) => {
5757
| `dynamicPlugins` | `string` | Path to dynamic-plugins YAML |
5858
| `valueFile` | `string` | Helm values file (Helm only) |
5959
| `subscription` | `string` | Backstage CR file (Operator only) |
60+
| `disableWrappers` | `string[]` | Wrapper plugin package names to disable (`GIT_PR_NUMBER` flows) |
61+
| `useNewFrontendSystem` | `boolean` | Enables the Backstage **new frontend system** shell (app-next / NFS): merges app-next secrets, default OCI **app-auth** and **app-integrations** plugins (as defaults — override in `tests/config/dynamic-plugins.yaml`), and extra Helm values from `config/new-frontend-system/value_file.yaml` plus optional `tests/config/value_file-app-next.yaml`. Omit to **auto-detect**: on when the namespace ends with `-app-next` or `USE_NEW_FRONTEND_SYSTEM=true`. Pass `false` to force off. |
62+
63+
### New frontend system (`useNewFrontendSystem`)
64+
65+
Use the **app-next** frontend when any of these apply:
66+
67+
- You pass `useNewFrontendSystem: true` in **`configure()`** (explicit), or
68+
- The Playwright project name (which becomes the Kubernetes namespace) ends with **`-app-next`**, or
69+
- You set environment variable **`USE_NEW_FRONTEND_SYSTEM=true`**
70+
71+
Pass **`useNewFrontendSystem: false`** to run in a `-app-next` namespace without NFS layers.
72+
73+
Typical explicit flow:
74+
75+
```typescript
76+
await rhdh.configure({
77+
auth: "keycloak",
78+
useNewFrontendSystem: true,
79+
});
80+
await rhdh.deploy();
81+
```
82+
83+
With a project named e.g. `my-plugin-app-next`, you can omit the flag and still get NFS merges:
84+
85+
```typescript
86+
await rhdh.configure({ auth: "keycloak" });
87+
await rhdh.deploy();
88+
```
89+
90+
What gets merged (same order as other config: package defaults → auth → NFS defaults → your workspace files; later wins; secrets are merged then **envsubst** runs once on the result):
91+
92+
1. **Secrets**`APP_CONFIG_app_packageName: app-next` and `ENABLE_STANDARD_MODULE_FEDERATION: "true"` (your `rhdh-secrets.yaml` still wins on conflicts and can use `$VAR` substitution).
93+
2. **Dynamic plugins** — Default OCI refs for `red-hat-developer-hub-backstage-plugin-app-auth` and `...-app-integrations` from package YAML; override pins in **`tests/config/dynamic-plugins.yaml`** (same as other plugins).
94+
3. **Helm** — Package `config/new-frontend-system/value_file.yaml`, then your `value_file.yaml`, then optional `tests/config/value_file-app-next.yaml` when that file exists.
95+
96+
Workspace-specific **app-config** (titles, plugin routes, etc.) remains your responsibility.
6097

6198
### Example: Full Configuration
6299

@@ -113,13 +150,14 @@ await rhdh.deploy({ timeout: null });
113150
`deploy()` automatically skips if the deployment already succeeded in the current test run (e.g., after a worker restart due to test failure). This prevents expensive re-deployments.
114151

115152
This method:
116-
1. Merges configuration files (common → auth → project)
117-
2. [Injects plugin metadata](/guide/configuration/config-files#plugin-metadata-injection) into dynamic plugins config
118-
3. Applies ConfigMaps (app-config, dynamic-plugins)
119-
4. Applies Secrets (with environment variable substitution)
120-
5. Installs RHDH via Helm or Operator
121-
6. Waits for the deployment to be ready
122-
7. Sets `RHDH_BASE_URL` environment variable
153+
1. Merges configuration files (common → auth → optional NFS defaults → project overrides) for app-config, secrets, and dynamic plugins
154+
2. Substitutes environment variables in the merged secrets (`envsubst`)
155+
3. [Injects plugin metadata](/guide/configuration/config-files#plugin-metadata-injection) into dynamic plugins config
156+
4. Applies ConfigMaps (app-config, dynamic-plugins)
157+
5. Applies Secrets
158+
6. Installs RHDH via Helm or Operator
159+
7. Waits for the deployment to be ready
160+
8. Sets `RHDH_BASE_URL` environment variable
123161

124162
#### Base URL format
125163

docs/overlay/reference/environment-variables.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ See [Running Locally - Secrets from Vault](/overlay/tutorials/running-locally#se
4242
| `INSTALLATION_METHOD` | Deployment method: `helm` or `operator` | `helm` | No |
4343
| `CHART_URL` | Custom Helm chart URL | `oci://quay.io/rhdh/chart` | No |
4444

45+
### New frontend system (app-next / NFS)
46+
47+
When the new frontend system is active (see [`useNewFrontendSystem`](/guide/deployment/rhdh-deployment#new-frontend-system-usenewfrontendsystem) and [environment variables](/guide/configuration/environment-variables#new-frontend-system-app-next)), the package merges NFS defaults then your workspace files. Pin **app-auth** / **app-integrations** OCI refs in `tests/config/dynamic-plugins.yaml` like any other plugin (your file wins over package defaults).
48+
49+
| Variable | Description |
50+
|----------|-------------|
51+
| `USE_NEW_FRONTEND_SYSTEM` | When `"true"`, enables NFS merges if `useNewFrontendSystem` is not set in `configure()` options |
52+
4553
### Cluster Configuration
4654

4755
| Variable | Description | Default | Required |

docs/overlay/test-structure/configuration-files.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,23 @@ tests/config/
2727
├── rhdh-secrets.yaml # Kubernetes secrets (optional)
2828
├── dynamic-plugins.yaml # Dynamic plugins (optional - usually not needed)
2929
├── value_file.yaml # Helm values override (optional, Helm only)
30+
├── value_file-app-next.yaml # Extra Helm values when new frontend system is active (optional)
3031
└── subscription.yaml # Operator subscription (optional, Operator only)
3132
```
3233

3334
**All of these files are optional.** Only create them when you need to override or extend defaults.
3435

36+
## `useNewFrontendSystem` (app-next / NFS)
37+
38+
When the new frontend system is enabled (see [`configure()`](/guide/deployment/rhdh-deployment#configureoptions) and [New frontend system](/guide/deployment/rhdh-deployment#new-frontend-system-usenewfrontendsystem)), `@red-hat-developer-hub/e2e-test-utils` merges:
39+
40+
- **Secrets**`APP_CONFIG_app_packageName=app-next` and `ENABLE_STANDARD_MODULE_FEDERATION=true` into the `rhdh-secrets` Secret (merged with common/auth/workspace layers before `envsubst`; you no longer need duplicate keys in a separate `rhdh-secrets-next.yaml` for that).
41+
- **Dynamic plugins** — Default OCI entries for **app-auth** and **app-integrations** as package defaults; override versions in `tests/config/dynamic-plugins.yaml` ([guide](/guide/configuration/config-files#dynamic-pluginsyaml)).
42+
43+
You can **remove** hand-maintained `app-auth` / `app-integrations` lines from `dynamic-plugins.yaml` when the framework defaults match your train.
44+
45+
Optional **`value_file-app-next.yaml`** is merged last when the new frontend system is active and the file exists — use for chart tweaks specific to app-next runs.
46+
3547
## app-config-rhdh.yaml (Optional)
3648

3749
The main RHDH configuration file. This file is merged with default configurations from `@red-hat-developer-hub/e2e-test-utils`.

0 commit comments

Comments
 (0)