Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions workspaces/orchestrator/.changeset/promote-nfs-stable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
'@red-hat-developer-hub/backstage-plugin-orchestrator': major
'@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets': major
---

**BREAKING**: Graduated the New Frontend System (NFS) orchestrator plugins to stable API.

The NFS plugins (`createFrontendPlugin`) have been promoted from the `./alpha` subpath to the primary `.` entry point. Legacy (OFS) exports have been moved to the new `./legacy` subpath.

For `@red-hat-developer-hub/backstage-plugin-orchestrator`, the `./alpha` subpath now only exports translations. For `@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets`, the `./alpha` subpath has been removed.

**Migration for NFS consumers (previously using `./alpha`):**

```diff
- import orchestratorPlugin, { orchestratorTranslationsModule } from '@red-hat-developer-hub/backstage-plugin-orchestrator/alpha';
- import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets/alpha';
+ import orchestratorPlugin, { orchestratorTranslationsModule } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
+ import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';
```

**Migration for OFS consumers:**

```diff
- import { OrchestratorPage, OrchestratorIcon } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
- import { orchestratorFormWidgetsPlugin } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';
+ import { OrchestratorPage, OrchestratorIcon } from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';
+ import { orchestratorFormWidgetsPlugin } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets/legacy';
```

**Migration for dynamic plugin configurations:**

Legacy exports require `module: Legacy` — they are not available on the default module.
OFS deployments must also load form-widgets via `pluginModule: Legacy` so RHDH registers the OFS `BackstagePlugin` (PluginRoot is now NFS).

```yaml
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-orchestrator:
# Legacy exports require `module: Legacy`
dynamicRoutes:
- path: /orchestrator
importName: OrchestratorPage
module: Legacy
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets:
pluginModule: Legacy
Comment thread
karthikjeeyar marked this conversation as resolved.
```
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ plugins:
pluginConfig:
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets: {}
# OFS: load BackstagePlugin from Legacy (PluginRoot is NFS after graduation)
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets:
pluginModule: Legacy
Comment thread
karthikjeeyar marked this conversation as resolved.
- disabled: false
package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:<tag>!red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator
```
8 changes: 4 additions & 4 deletions workspaces/orchestrator/docs/static-plugin-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Follow these instructions to install the orchestrator plugin in a Backstage envi

```tsx title="packages/app/src/App.tsx"
/* highlight-add-next-line */
import { OrchestratorPage } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import { OrchestratorPage } from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';

const routes = (
<FlatRoutes>
Expand All @@ -56,7 +56,7 @@ Follow these instructions to install the orchestrator plugin in a Backstage envi

```tsx title="packages/app/src/components/Root/Root.tsx"
/* highlight-add-next-line */
import { OrchestratorIcon } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import { OrchestratorIcon } from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';

export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarPage>
Expand Down Expand Up @@ -86,8 +86,8 @@ If your app uses `createApp` from `@backstage/frontend-defaults`, add the orches
import { createApp } from '@backstage/frontend-defaults';
import orchestratorPlugin, {
orchestratorTranslationsModule,
} from '@red-hat-developer-hub/backstage-plugin-orchestrator/alpha';
import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets/alpha';
} from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';

export default createApp({
features: [
Expand Down
2 changes: 1 addition & 1 deletion workspaces/orchestrator/docs/workflows-tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To expose workflows directly on the entity page, update
import {
OrchestratorCatalogTab,
IsOrchestratorCatalogTabAvailable,
} from '@red-hat-developer-hub/backstage-plugin-orchestrator';
} from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';

const serviceEntityPage = (
<EntityLayout>
Expand Down
6 changes: 3 additions & 3 deletions workspaces/orchestrator/packages/app-legacy/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { UserSettingsPage } from '@backstage/plugin-user-settings';
import { OrchestratorPage } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import { orchestratorFormWidgetsPlugin } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';
import { OrchestratorPage } from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';

Check warning on line 49 in workspaces/orchestrator/packages/app-legacy/src/App.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'@red-hat-developer-hub/backstage-plugin-orchestrator/legacy' imported multiple times.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ_tfW0W5gWIYMRXMbWP&open=AZ_tfW0W5gWIYMRXMbWP&pullRequest=4247
import { orchestratorFormWidgetsPlugin } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets/legacy';
import { customAuthProviderPlugin } from 'custom-authentication-provider-module';
import { getThemes } from '@red-hat-developer-hub/backstage-plugin-theme';
import { NotificationsPage } from '@backstage/plugin-notifications';
Expand All @@ -58,7 +58,7 @@
import { entityPage } from './components/catalog/EntityPage';
import { Root } from './components/Root';
import { searchPage } from './components/search/SearchPage';
import { orchestratorTranslations } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import { orchestratorTranslations } from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';

Check warning on line 61 in workspaces/orchestrator/packages/app-legacy/src/App.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'@red-hat-developer-hub/backstage-plugin-orchestrator/legacy' imported multiple times.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ_tfW0W5gWIYMRXMbWQ&open=AZ_tfW0W5gWIYMRXMbWQ&pullRequest=4247

const app = createApp({
apis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import MenuIcon from '@mui/icons-material/Menu';
import GroupIcon from '@mui/icons-material/People';
import SearchIcon from '@mui/icons-material/Search';
import Box from '@mui/material/Box';
import { OrchestratorIcon } from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import { OrchestratorIcon } from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';
import { NotificationsSidebarItem } from '@backstage/plugin-notifications';
import { Administration } from '@backstage-community/plugin-rbac';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import Grid from '@mui/material/Grid';
import {
OrchestratorCatalogTab,
IsOrchestratorCatalogTabAvailable,
} from '@red-hat-developer-hub/backstage-plugin-orchestrator';
} from '@red-hat-developer-hub/backstage-plugin-orchestrator/legacy';

const techdocsContent = (
<EntityTechdocsContent>
Expand Down
4 changes: 2 additions & 2 deletions workspaces/orchestrator/packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import catalogPlugin from '@backstage/plugin-catalog/alpha';
import userSettingsPlugin from '@backstage/plugin-user-settings/alpha';
import orchestratorPlugin, {
orchestratorTranslationsModule,
} from '@red-hat-developer-hub/backstage-plugin-orchestrator/alpha';
import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets/alpha';
} from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';
import { rhdhThemeModule } from '@red-hat-developer-hub/backstage-plugin-theme/alpha';
import { navModule } from './modules/nav';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,42 @@ Documentation of implemented widgets can be found in a [orchestratorFormWidgets.

## Deployment

### Static (for development)
### New frontend system (NFS)

In the packages/app/src/App.tsx:
```tsx
import orchestratorFormWidgetsPlugin from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';

export default createApp({
features: [
// ...
orchestratorFormWidgetsPlugin,
],
});
```
import { orchestratorFormWidgetsPlugin } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets';
...

### Legacy frontend (OFS)

```tsx
import { orchestratorFormWidgetsPlugin } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets/legacy';

const app = createApp({
...
plugins: [orchestratorFormWidgetsPlugin],
})
plugins: [orchestratorFormWidgetsPlugin],
});
```

### Dynamic (for RHDH production)

For RHDH production deployments, it is expected that the plugin is exported as a dynamic plugin using RHDH CLI a loaded among the other dynamic frontend plugins.
No explicit configuration is needed.
For RHDH production deployments, export this plugin as a dynamic plugin and load it with the other dynamic frontend plugins.

- **NFS / app-next:** no OFS Scalprum config is required (`PluginRoot` is the NFS plugin).
- **OFS / legacy app:** set `pluginModule: Legacy` so RHDH registers the OFS `BackstagePlugin` (and its form API factory):

```yaml
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets:
pluginModule: Legacy
```

## `http-workflow-dev-server` - HTTP server for dynamic widgets development

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynamicPlugins:
frontend:
# OFS loads BackstagePlugin from Legacy after NFS graduation (PluginRoot is NFS).
red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets:
pluginModule: Legacy
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"types": "src/index.ts",
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.tsx",
"./legacy": "./src/legacyExports.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"alpha": [
"src/alpha.tsx"
"legacy": [
"src/legacyExports.ts"
],
"package.json": [
"package.json"
Expand Down Expand Up @@ -89,7 +89,8 @@
"scalprum": {
"name": "red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets",
"exposedModules": {
"PluginRoot": "./src/index.ts"
"PluginRoot": "./src/index.ts",
"Legacy": "./src/legacyExports.ts"
}
},
"devDependencies": {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## API Report File for "@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { ApiFactory } from '@backstage/frontend-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { OrchestratorFormApi } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-api';

// @public
export class FormWidgetsApi implements OrchestratorFormApi {
getFormDecorator: OrchestratorFormApi['getFormDecorator'];
getReviewComponent: OrchestratorFormApi['getReviewComponent'];
}

// @public
export const orchestratorFormApiFactory: ApiFactory<
OrchestratorFormApi,
FormWidgetsApi,
{
[x: string]: unknown;
}
>;

// @public
export const orchestratorFormWidgetsPlugin: BackstagePlugin<{}, {}, {}>;

// (No @packageDocumentation comment for this package)
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,36 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
import { ApiFactory } from '@backstage/frontend-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { OrchestratorFormApi } from '@red-hat-developer-hub/backstage-plugin-orchestrator-form-api';
import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api';
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';

// Warning: (ae-forgotten-export) The symbol "FormWidgetsApi" needs to be exported by the entry point index.d.ts
//
// @public
export const orchestratorFormApiFactory: ApiFactory<
OrchestratorFormApi,
FormWidgetsApi,
const _default: OverridableFrontendPlugin<
{},
{},
{
[x: string]: unknown;
'api:orchestrator-form-widgets': OverridableExtensionDefinition<{
kind: 'api';
name: undefined;
config: {};
configInput: {};
output: ExtensionDataRef<AnyApiFactory, 'core.api.factory', {}>;
inputs: {};
params: <
TApi,
TImpl extends TApi,
TDeps extends { [name in string]: unknown },
>(
params: ApiFactory<TApi, TImpl, TDeps>,
) => ExtensionBlueprintParams<AnyApiFactory>;
}>;
}
>;

// @public
export const orchestratorFormWidgetsPlugin: BackstagePlugin<{}, {}, {}>;
export default _default;

// (No @packageDocumentation comment for this package)
```
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ function LazyDecoratorContent({
return <Content FormComponent={FormComponent} {...props} />;
}

/**
* Default Orchestrator form API implementation that supplies RJSF widgets.
*
* @public
*/
export class FormWidgetsApi implements OrchestratorFormApi {
private contentPromise: Promise<
typeof import('./FormDecoratorContent')
> | null = null;

/** Returns the form decorator that injects the default RJSF widgets. */
getFormDecorator: OrchestratorFormApi['getFormDecorator'] = () => {
// eslint-disable-next-line no-console
console.log('Using FormWidgetsApi by RHDH orchestrator-form-widgets.');
Expand All @@ -71,6 +77,7 @@ export class FormWidgetsApi implements OrchestratorFormApi {
);
};

/** Optional custom review component; undefined keeps the default review page. */
getReviewComponent: OrchestratorFormApi['getReviewComponent'] = () => {
// Return undefined to use the default review page
// To use a custom review page, return your custom component here
Expand Down
Loading
Loading