From b28ea4faa1bb7a6e2f96e16ecf9dcef21087a2ce Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Mon, 21 Jul 2025 12:44:48 +0200 Subject: [PATCH 1/2] fix: Make the orchestrator plugins list configurable in the default values file [RHDHBUGS-1889] (#194) Co-authored-by: Elai Shalev <129178340+elai-shalev@users.noreply.github.com> --- charts/backstage/Chart.yaml | 2 +- charts/backstage/README.md | 5 +- charts/backstage/templates/_partials.tpl | 57 ------------------- .../templates/dynamic-plugins-configmap.yaml | 3 +- charts/backstage/values.schema.json | 33 ++++++++++- charts/backstage/values.schema.tmpl.json | 33 ++++++++++- charts/backstage/values.yaml | 43 ++++++++++++++ 7 files changed, 110 insertions(+), 66 deletions(-) delete mode 100644 charts/backstage/templates/_partials.tpl diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index 04f6eaaf..3520167a 100644 --- a/charts/backstage/Chart.yaml +++ b/charts/backstage/Chart.yaml @@ -47,4 +47,4 @@ sources: [] # Versions are expected to follow Semantic Versioning (https://semver.org/) # Note that when this chart is published to https://github.com/openshift-helm-charts/charts # it will follow the RHDH versioning 1.y.z -version: 4.4.1 +version: 4.4.2 diff --git a/charts/backstage/README.md b/charts/backstage/README.md index 63ac12bf..34c5daed 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -1,7 +1,7 @@ # RHDH Backstage Helm Chart for OpenShift -![Version: 4.4.1](https://img.shields.io/badge/Version-4.4.1-informational?style=flat-square) +![Version: 4.4.2](https://img.shields.io/badge/Version-4.4.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for deploying Red Hat Developer Hub, which is a Red Hat supported version of Backstage. @@ -179,6 +179,7 @@ Kubernetes: `>= 1.27.0-0` | global.host | Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig`. | string | `""` | | nameOverride | | string | `"developer-hub"` | | orchestrator.enabled | | bool | `false` | +| orchestrator.plugins | Orchestrator plugins and their configuration | list | `[{"disabled":false,"integrity":"sha512-Kr55YbuVwEADwGef9o9wyimcgHmiwehPeAtVHa9g2RQYoSPEa6BeOlaPzB6W5Ke3M2bN/0j0XXtpLuvrlXQogA==","package":"https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator-backend-dynamic/-/backstage-plugin-orchestrator-backend-dynamic-1.6.0.tgz","pluginConfig":{"orchestrator":{"dataIndexService":{"url":"http://sonataflow-platform-data-index-service.{{ .Release.Namespace }}"}}}},{"disabled":false,"integrity":"sha512-fOSJv2PgtD2urKwBM7p9W6gV/0UIHSf4pkZ9V/wQO0eg0Zi5Mys/CL1ba3nO9x9l84MX11UBZ2r7PPVJPrmOtw==","package":"https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator/-/backstage-plugin-orchestrator-1.6.0.tgz","pluginConfig":{"dynamicPlugins":{"frontend":{"red-hat-developer-hub.backstage-plugin-orchestrator":{"appIcons":[{"importName":"OrchestratorIcon","name":"orchestratorIcon"}],"dynamicRoutes":[{"importName":"OrchestratorPage","menuItem":{"icon":"orchestratorIcon","text":"Orchestrator"},"path":"/orchestrator"}]}}}}},{"disabled":false,"integrity":"sha512-Bueeix4661fXEnfJ9y31Yw91LXJgw6hJUG7lPVdESCi9VwBCjDB9Rm8u2yPqP8sriwr0OMtKtqD+Odn3LOPyVw==","package":"https://npm.registry.redhat.com/@redhat/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic/-/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic-1.6.0.tgz","pluginConfig":{"orchestrator":{"dataIndexService":{"url":"http://sonataflow-platform-data-index-service.{{ .Release.Namespace }}"}}}},{"disabled":false,"integrity":"sha512-Tqn6HO21Q1TQ7TFUoRhwBVCtSBzbQYz+OaanzzIB0R24O6YtVx3wR7Chtr5TzC05Vz5GkBO1+FZid8BKpqljgA==","package":"https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator-form-widgets/-/backstage-plugin-orchestrator-form-widgets-1.6.0.tgz","pluginConfig":{"dynamicPlugins":{"frontend":{"red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets":{}}}}}]` | | orchestrator.serverlessLogicOperator.enabled | | bool | `true` | | orchestrator.serverlessOperator.enabled | | bool | `true` | | orchestrator.sonataflowPlatform.createDBJobImage | Image for the container used by the create-db job | string | `"{{ .Values.upstream.postgresql.image.registry }}/{{ .Values.upstream.postgresql.image.repository }}:{{ .Values.upstream.postgresql.image.tag }}"` | @@ -388,4 +389,4 @@ helm install redhat-developer/backstage \ --set orchestrator.sonataflowPlatform.externalDBName=example \ --set orchestrator.sonataflowPlatform.externalDBHost=example \ --set orchestrator.sonataflowPlatform.externalDBPort=example -``` \ No newline at end of file +``` diff --git a/charts/backstage/templates/_partials.tpl b/charts/backstage/templates/_partials.tpl deleted file mode 100644 index c03526e2..00000000 --- a/charts/backstage/templates/_partials.tpl +++ /dev/null @@ -1,57 +0,0 @@ -{{- define "orchestrator.plugins" }} -{{- $config := include "orchestrator.plugins.config" . | fromYaml }} -plugins: - - disabled: false - package: "{{ $config.orchestratorPlugins.orchestratorBackend.package }}" - integrity: "{{ $config.orchestratorPlugins.orchestratorBackend.integrity }}" - pluginConfig: - orchestrator: - dataIndexService: - url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }} - - disabled: false - package: "{{ $config.orchestratorPlugins.orchestrator.package }}" - integrity: "{{ $config.orchestratorPlugins.orchestrator.integrity }}" - pluginConfig: - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-orchestrator: - appIcons: - - importName: OrchestratorIcon - name: orchestratorIcon - dynamicRoutes: - - importName: OrchestratorPage - menuItem: - icon: orchestratorIcon - text: Orchestrator - path: /orchestrator - - disabled: false - package: "{{ $config.orchestratorPlugins.scaffolderBackendOrchestrator.package }}" - integrity: "{{ $config.orchestratorPlugins.scaffolderBackendOrchestrator.integrity }}" - pluginConfig: - orchestrator: - dataIndexService: - url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }} - - disabled: false - package: "{{ $config.orchestratorPlugins.orchestratorFormWidgets.package }}" - integrity: "{{ $config.orchestratorPlugins.orchestratorFormWidgets.integrity }}" - pluginConfig: - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets: {} -{{- end }} -{{- define "orchestrator.plugins.config" }} -orchestratorPlugins: - scope: "@redhat" - orchestrator: - package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator/-/backstage-plugin-orchestrator-1.6.0.tgz" - integrity: sha512-fOSJv2PgtD2urKwBM7p9W6gV/0UIHSf4pkZ9V/wQO0eg0Zi5Mys/CL1ba3nO9x9l84MX11UBZ2r7PPVJPrmOtw== - orchestratorBackend: - package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator-backend-dynamic/-/backstage-plugin-orchestrator-backend-dynamic-1.6.0.tgz" - integrity: sha512-Kr55YbuVwEADwGef9o9wyimcgHmiwehPeAtVHa9g2RQYoSPEa6BeOlaPzB6W5Ke3M2bN/0j0XXtpLuvrlXQogA== - scaffolderBackendOrchestrator: - package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic/-/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic-1.6.0.tgz" - integrity: sha512-Bueeix4661fXEnfJ9y31Yw91LXJgw6hJUG7lPVdESCi9VwBCjDB9Rm8u2yPqP8sriwr0OMtKtqD+Odn3LOPyVw== - orchestratorFormWidgets: - package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator-form-widgets/-/backstage-plugin-orchestrator-form-widgets-1.6.0.tgz" - integrity: sha512-Tqn6HO21Q1TQ7TFUoRhwBVCtSBzbQYz+OaanzzIB0R24O6YtVx3wR7Chtr5TzC05Vz5GkBO1+FZid8BKpqljgA== -{{- end }} \ No newline at end of file diff --git a/charts/backstage/templates/dynamic-plugins-configmap.yaml b/charts/backstage/templates/dynamic-plugins-configmap.yaml index 27547a95..321fd177 100644 --- a/charts/backstage/templates/dynamic-plugins-configmap.yaml +++ b/charts/backstage/templates/dynamic-plugins-configmap.yaml @@ -12,8 +12,7 @@ data: {{- end }} {{- if .Values.orchestrator.enabled }} - {{- $orchestratorPlugins := include "orchestrator.plugins" . | fromYaml }} - {{- range $orchestratorPlugins.plugins }} + {{- range .Values.orchestrator.plugins }} {{- $plugins = append $plugins . }} {{- end }} {{- end }} diff --git a/charts/backstage/values.schema.json b/charts/backstage/values.schema.json index 1118d889..a68fa588 100644 --- a/charts/backstage/values.schema.json +++ b/charts/backstage/values.schema.json @@ -59,11 +59,11 @@ "type": "boolean" }, "integrity": { - "title": "Integrity checksum of the package. Optional for local packages. Supported algorithms include: `sha512`, `sha384` and `sha256`. Refer to https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description for more information", + "title": "Integrity checksum of the package. Optional for local packages and OCI packages. For OCI packages, you can specify the image digest in place of the tag in the 'package' field. Supported algorithms include: `sha512`, `sha384` and `sha256`. Refer to https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description for more information", "type": "string" }, "package": { - "title": "Package specification of the dynamic plugin to install. It should be usable by the `npm pack` command.", + "title": "Package specification of the dynamic plugin to install. It should be usable by the `npm pack` command (for NPM packages) or the `skopeo copy` command (for OCI packages).", "type": "string" }, "pluginConfig": { @@ -99,6 +99,35 @@ "title": "enabled flag", "type": "boolean" }, + "plugins": { + "items": { + "properties": { + "disabled": { + "default": false, + "title": "Disable the plugin.", + "type": "boolean" + }, + "integrity": { + "title": "Integrity checksum of the package. Optional for local packages and OCI packages. For OCI packages, you can specify the image digest in place of the tag in the 'package' field. Supported algorithms include: `sha512`, `sha384` and `sha256`. Refer to https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description for more information", + "type": "string" + }, + "package": { + "title": "Package specification of the dynamic plugin to install. It should be usable by the `npm pack` command (for NPM packages) or the `skopeo copy` command (for OCI packages).", + "type": "string" + }, + "pluginConfig": { + "title": "Optional plugin-specific app-config YAML fragment.", + "type": "object" + } + }, + "required": [ + "package" + ], + "type": "object" + }, + "title": "List of orchestrator plugins and their configuration", + "type": "array" + }, "serverlessLogicOperator": { "additionalProperties": false, "properties": { diff --git a/charts/backstage/values.schema.tmpl.json b/charts/backstage/values.schema.tmpl.json index 02e31075..58cd5bd8 100644 --- a/charts/backstage/values.schema.tmpl.json +++ b/charts/backstage/values.schema.tmpl.json @@ -42,11 +42,11 @@ "type": "object", "properties": { "package": { - "title": "Package specification of the dynamic plugin to install. It should be usable by the `npm pack` command.", + "title": "Package specification of the dynamic plugin to install. It should be usable by the `npm pack` command (for NPM packages) or the `skopeo copy` command (for OCI packages).", "type": "string" }, "integrity": { - "title": "Integrity checksum of the package. Optional for local packages. Supported algorithms include: `sha512`, `sha384` and `sha256`. Refer to https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description for more information", + "title": "Integrity checksum of the package. Optional for local packages and OCI packages. For OCI packages, you can specify the image digest in place of the tag in the 'package' field. Supported algorithms include: `sha512`, `sha384` and `sha256`. Refer to https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description for more information", "type": "string" }, "pluginConfig": { @@ -206,6 +206,35 @@ "type": "boolean", "default": false }, + "plugins": { + "title": "List of orchestrator plugins and their configuration", + "type": "array", + "items": { + "type": "object", + "properties": { + "package": { + "title": "Package specification of the dynamic plugin to install. It should be usable by the `npm pack` command (for NPM packages) or the `skopeo copy` command (for OCI packages).", + "type": "string" + }, + "integrity": { + "title": "Integrity checksum of the package. Optional for local packages and OCI packages. For OCI packages, you can specify the image digest in place of the tag in the 'package' field. Supported algorithms include: `sha512`, `sha384` and `sha256`. Refer to https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description for more information", + "type": "string" + }, + "pluginConfig": { + "title": "Optional plugin-specific app-config YAML fragment.", + "type": "object" + }, + "disabled": { + "title": "Disable the plugin.", + "type": "boolean", + "default": false + } + }, + "required": [ + "package" + ] + } + }, "serverlessLogicOperator": { "title": "serverlessLogicOperator configuration", "type": "object", diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index 0088345c..4a96d23d 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -386,3 +386,46 @@ orchestrator: # -- Image for the container used by the create-db job createDBJobImage: "{{ .Values.upstream.postgresql.image.registry }}/{{ .Values.upstream.postgresql.image.repository }}:{{ .Values.upstream.postgresql.image.tag }}" + + # -- Orchestrator plugins and their configuration + plugins: + # RHDHBUGS-1464: Note that the plugins here fetch the packages from their direct HTTP download URLs from the (official) Red Hat NPM Registry. + # Previously, we were using the "@redhat/plugin@version" form along with injecting a .npmrc Secret to resolve the "@redhat" scope, + # but this caused conflicting issues with user-provided .npmrc secrets. + - disabled: false + package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator-backend-dynamic/-/backstage-plugin-orchestrator-backend-dynamic-1.6.0.tgz" + integrity: sha512-Kr55YbuVwEADwGef9o9wyimcgHmiwehPeAtVHa9g2RQYoSPEa6BeOlaPzB6W5Ke3M2bN/0j0XXtpLuvrlXQogA== + pluginConfig: + orchestrator: + dataIndexService: + url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }} + - disabled: false + package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator/-/backstage-plugin-orchestrator-1.6.0.tgz" + integrity: sha512-fOSJv2PgtD2urKwBM7p9W6gV/0UIHSf4pkZ9V/wQO0eg0Zi5Mys/CL1ba3nO9x9l84MX11UBZ2r7PPVJPrmOtw== + pluginConfig: + dynamicPlugins: + frontend: + red-hat-developer-hub.backstage-plugin-orchestrator: + appIcons: + - importName: OrchestratorIcon + name: orchestratorIcon + dynamicRoutes: + - importName: OrchestratorPage + menuItem: + icon: orchestratorIcon + text: Orchestrator + path: /orchestrator + - disabled: false + package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic/-/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic-1.6.0.tgz" + integrity: sha512-Bueeix4661fXEnfJ9y31Yw91LXJgw6hJUG7lPVdESCi9VwBCjDB9Rm8u2yPqP8sriwr0OMtKtqD+Odn3LOPyVw== + pluginConfig: + orchestrator: + dataIndexService: + url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }} + - disabled: false + package: "https://npm.registry.redhat.com/@redhat/backstage-plugin-orchestrator-form-widgets/-/backstage-plugin-orchestrator-form-widgets-1.6.0.tgz" + integrity: sha512-Tqn6HO21Q1TQ7TFUoRhwBVCtSBzbQYz+OaanzzIB0R24O6YtVx3wR7Chtr5TzC05Vz5GkBO1+FZid8BKpqljgA== + pluginConfig: + dynamicPlugins: + frontend: + red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets: {} From e793ced1f22fb5f6325f04c7034940f1a386c4b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 21 Jul 2025 11:21:24 +0000 Subject: [PATCH 2/2] chore(pre-commit): Auto-fix hooks Co-authored-by: rm3l --- charts/backstage/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/backstage/README.md b/charts/backstage/README.md index 34c5daed..36befa15 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -389,4 +389,4 @@ helm install redhat-developer/backstage \ --set orchestrator.sonataflowPlatform.externalDBName=example \ --set orchestrator.sonataflowPlatform.externalDBHost=example \ --set orchestrator.sonataflowPlatform.externalDBPort=example -``` +``` \ No newline at end of file