Skip to content
Open
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
plugins:
# Lightspeed Plugins
- package: oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-lightspeed:{{inherit}}
disabled: false
enabled: true

- package: oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-lightspeed-backend:{{inherit}}
disabled: false
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ data:
dynamic-plugins.yaml: |
plugins:
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{inherit}}'
disabled: false
enabled: true
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{inherit}}'
disabled: false
enabled: true
dependencies:
- ref: sonataflow
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{inherit}}'
disabled: false
enabled: true
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{inherit}}'
disabled: false
enabled: true
12 changes: 6 additions & 6 deletions dist/rhdh/install.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ data:
- dynamic-plugins.default.yaml
plugins:
- package: './dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic'
disabled: false
enabled: true
pluginConfig:
catalog:
providers:
Expand Down
2 changes: 1 addition & 1 deletion docs/dynamic-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ data:
includes:
- dynamic-plugins.default.yaml
plugins:
- disabled: false
- enabled: true
package: "path-or-url-to-example-plugin"
dependencies:
- ref: example-dep
Expand Down
4 changes: 2 additions & 2 deletions docs/lightspeed.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ includes:
- dynamic-plugins.default.yaml
plugins:
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed:bs_1.49.4__2.2.1
disabled: false
enabled: true
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed-backend:bs_1.49.4__2.2.1
disabled: false
enabled: true
```

For more information about configuring dynamic plugins, please refer to the [Configuration documentation](configuration.md).
Expand Down
8 changes: 4 additions & 4 deletions docs/orchestrator-cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,17 @@ To enable the ArgoCD and tekton plugins, update your Dynamic Plugins ConfigMap b
plugins:
......
- package: ./dynamic-plugins/dist/backstage-community-plugin-redhat-argocd
disabled: false
enabled: true
dependencies:
- ref: argocd
- package: ./dynamic-plugins/dist/backstage-community-plugin-tekton
disabled: false
enabled: true
dependencies:
- ref: tekton
- package: ./dynamic-plugins/dist/roadiehq-backstage-plugin-argo-cd-backend-dynamic
disabled: false
enabled: true
- package: ./dynamic-plugins/dist/roadiehq-scaffolder-backend-argocd-dynamic
disabled: false
enabled: true
```

This should create the ArgoCD AppProject resource and Tekton pipeline called `workflow-deployment`, for RHDH
Expand Down
8 changes: 4 additions & 4 deletions docs/orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ To enable the orchestrator plugin, you should refer the dynamic plugins ConfigMa
- dynamic-plugins.default.yaml
plugins:
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{inherit}}'
disabled: false
enabled: true
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{inherit}}'
disabled: false
enabled: true
dependencies:
- ref: sonataflow
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{inherit}}'
disabled: false
enabled: true
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{inherit}}'
disabled: false
enabled: true
```

Starting from version 1.10, RHDH contains a predefined Orchestrator flavour with configured plugins. Users can enable it by configuring:
Expand Down
22 changes: 11 additions & 11 deletions examples/orchestrator-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ data:
- dynamic-plugins.default.yaml
plugins:
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{inherit}}'
disabled: false
enabled: true
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{inherit}}'
disabled: false
enabled: true
dependencies:
- ref: sonataflow
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{inherit}}'
disabled: false
enabled: true
- package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{inherit}}'
disabled: false
enabled: true
# TODO These should be changed to the OCI references
- package: ./dynamic-plugins/dist/backstage-community-plugin-redhat-argocd
disabled: false
enabled: true
dependencies:
- ref: argocd
- package: ./dynamic-plugins/dist/backstage-community-plugin-tekton
disabled: false
enabled: true
dependencies:
- ref: tekton
- package: ./dynamic-plugins/dist/roadiehq-backstage-plugin-argo-cd-backend-dynamic
disabled: false
enabled: true
- package: ./dynamic-plugins/dist/roadiehq-scaffolder-backend-argocd-dynamic
disabled: false
enabled: true
- package: ./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-github-dynamic
disabled: false
enabled: true
- package: ./dynamic-plugins/dist/backstage-plugin-kubernetes
disabled: false
enabled: true
- package: ./dynamic-plugins/dist/backstage-plugin-kubernetes-backend-dynamic
disabled: false
enabled: true
pluginConfig:
kubernetes:
customResources:
Expand Down
10 changes: 5 additions & 5 deletions examples/pvc-dp-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data:
- dynamic-plugins.default.yaml
plugins:
- package: './dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic'
disabled: true
enabled: false
pluginConfig:
catalog:
providers:
Expand All @@ -33,15 +33,15 @@ data:
timeout: { minutes: 3}
initialDelay: { seconds: 15}
- package: ./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic
disabled: true
enabled: false
- package: ./dynamic-plugins/dist/backstage-plugin-techdocs
disabled: false
enabled: true
- package: ./dynamic-plugins/dist/backstage-plugin-techdocs-module-addons-contrib
disabled: true
enabled: false

# Homepage
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page
disabled: false
enabled: true
---
apiVersion: rhdh.redhat.com/v1alpha5
kind: Backstage
Expand Down
6 changes: 3 additions & 3 deletions examples/rhdh-cr-with-app-configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ data:
- dynamic-plugins.default.yaml
plugins:
- package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-scaffolder-backend-module-utils:bs_1.45.3__4.1.1'
disabled: false
enabled: true
- package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-catalog-backend-module-github:bs_1.45.3__0.11.2'
disabled: false
enabled: true
pluginConfig:
catalog:
providers:
Expand All @@ -113,7 +113,7 @@ data:
timeout: { minutes: 3}
initialDelay: { seconds: 15}
- package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-catalog-backend-module-gitlab:bs_1.45.3__0.7.5'
disabled: false
enabled: true
pluginConfig:
catalog:
providers:
Expand Down
2 changes: 1 addition & 1 deletion examples/rhdh-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data:
- dynamic-plugins.default.yaml
plugins:
- package: './dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic'
disabled: false
enabled: true
pluginConfig:
catalog:
providers:
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/testdata/raw-dynaplugins-with-deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
data:
dynamic-plugins.yaml: |
plugins:
- disabled: false
- enabled: true
package: "./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page"
dependencies:
- ref: plugin
- disabled: true
- enabled: false
package: "disabled"
dependencies:
- ref: disabled
2 changes: 1 addition & 1 deletion pkg/model/default-config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestMergeDynamicPluginsFunction(t *testing.T) {
}
}
require.NotNil(t, pluginB, "plugin-b should exist")
assert.False(t, pluginB.Disabled, "plugin-b should be enabled (overridden)")
assert.False(t, pluginB.IsDisabled(), "plugin-b should be enabled (overridden)")
assert.Equal(t, "sha512-overlay", pluginB.Integrity, "plugin-b integrity should be from overlay")

// Includes should be merged
Expand Down
21 changes: 19 additions & 2 deletions pkg/model/dynamic-plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ type DynaPluginsConfig struct {
type DynaPlugin struct {
Package string `yaml:"package,omitempty"`
Integrity string `yaml:"integrity,omitempty"`
Enabled *bool `yaml:"enabled,omitempty"`
Disabled bool `yaml:"disabled"`
PluginConfig map[string]interface{} `yaml:"pluginConfig,omitempty"`
Dependencies []PluginDependency `yaml:"dependencies,omitempty"`
}

// IsDisabled resolves the effective disabled state from the Enabled and
// Disabled fields. Enabled takes precedence when both are set. When neither
// is set the plugin is considered enabled (not disabled), preserving previous behaviour.
func (p DynaPlugin) IsDisabled() bool {
if p.Enabled != nil {
return !*p.Enabled
}
return p.Disabled
}

type PluginDependency struct {
Ref string `yaml:"ref"`
}
Expand Down Expand Up @@ -185,7 +196,7 @@ func (p *DynamicPlugins) Dependencies() ([]PluginDependency, error) {
result := make([]PluginDependency, 0)

for _, pp := range ps {
if pp.Disabled {
if pp.IsDisabled() {
continue
}

Expand Down Expand Up @@ -283,7 +294,13 @@ func MergePluginsData(firstData, secondData string) (string, error) {
if plugin.Integrity != "" {
existingPlugin.Integrity = plugin.Integrity
}
existingPlugin.Disabled = plugin.Disabled
if plugin.Enabled != nil {
existingPlugin.Enabled = plugin.Enabled
existingPlugin.Disabled = false
} else if plugin.Disabled {
existingPlugin.Disabled = true
existingPlugin.Enabled = nil
}
Comment on lines +297 to +303

This comment was marked as resolved.

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.

@hopehadfield look at this please

pluginMap[plugin.Package] = existingPlugin
} else {
pluginMap[plugin.Package] = plugin
Expand Down
Loading
Loading