Skip to content

Commit 49886e5

Browse files
rm3lFortune-Ndlovubenwilcock
authored
feat: Enable Extensions catalog installation feature by default [RHDHPLAN-747] (#147)
Co-authored-by: Fortune Ndlovu <ndlovufortune97@gmail.com> Co-authored-by: Ben Wilcock <benwilcock@gmail.com>
1 parent 2ec23e7 commit 49886e5

File tree

9 files changed

+226
-26
lines changed

9 files changed

+226
-26
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,31 @@ The built-in documentation provides step-by-step technical instructions with exa
4141

4242
## Quick Commands
4343

44-
**Restart after config changes:**
44+
> **Note**: Replace `podman` with `docker` if using Docker.
45+
46+
### After Plugin changes
47+
48+
After modifying the plugins configuration, for example after configuring plugins using the Extensions in the RHDH UI:
49+
50+
```sh
51+
# Reinstall plugins and restart RHDH
52+
podman compose run install-dynamic-plugins # or: docker compose run install-dynamic-plugins
53+
podman compose restart rhdh # or: docker compose restart rhdh
54+
```
55+
56+
### Quick restart (No Plugin changes)
57+
58+
For configuration-only changes:
4559

4660
```sh
47-
podman compose stop rhdh && podman compose start rhdh
61+
# Just restart RHDH (if plugins haven't changed)
62+
podman compose restart rhdh # or: docker compose restart rhdh
4863
```
4964

50-
**Clean up:**
65+
### Clean up
5166

5267
```sh
53-
podman compose down --volumes
68+
podman compose down --volumes # or: docker compose down --volumes
5469
```
5570

5671
## Additional Configuration Guides

configs/dynamic-plugins/dynamic-plugins.override.example.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
includes:
55
- dynamic-plugins.default.yaml
6+
# Uncomment the following line (and the corresponding 'red-hat-developer-hub-backstage-plugin-marketplace*' plugins)
7+
# to enable dynamic plugins installation using the Extensions UI.
8+
# - /dynamic-plugins-root/dynamic-plugins.extensions.yaml
69

710
# # Below you can add custom dynamic plugins, including local ones.
811

@@ -93,3 +96,39 @@ includes:
9396
# - path: /admin/rbac
9497
# module: RbacPlugin
9598
# importName: RbacPage
99+
100+
# # Uncomment the following two plugins to enable dynamic plugins installation via the Extensions UI
101+
# - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace
102+
# disabled: false
103+
# pluginConfig:
104+
# dynamicPlugins:
105+
# frontend:
106+
# red-hat-developer-hub.backstage-plugin-marketplace:
107+
# translationResources:
108+
# - importName: marketplaceTranslations
109+
# ref: marketplaceTranslationRef
110+
# module: Alpha
111+
# appIcons:
112+
# - name: pluginsIcon
113+
# importName: PluginsIcon
114+
# dynamicRoutes:
115+
# - path: /extensions
116+
# importName: DynamicMarketplacePluginRouter
117+
# menuItem:
118+
# icon: pluginsIcon
119+
# text: Extensions
120+
# textKey: menuItem.extensions
121+
# menuItems:
122+
# extensions:
123+
# parent: default.admin
124+
# - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic
125+
# disabled: false
126+
# pluginConfig:
127+
# extensions:
128+
# installation:
129+
# enabled: true
130+
# saveToSingleFile:
131+
# # NOTE: Default path. If you want to change this path, make sure to choose a path that is writable by the main RHDH container user.
132+
# # Otherwise, the extensions backend plugin will not be able to save the dynamic plugins configuration.
133+
# # Also add the path in the 'includes' section of this file, so the plugins installed via the Extensions UI can be loaded at runtime.
134+
# file: /opt/app-root/src/dynamic-plugins-root/dynamic-plugins.extensions.yaml

configs/dynamic-plugins/dynamic-plugins.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# This is the default dynamic plugins config, and any user configuration should be added dynamic-plugins.override.yaml instead
22
includes:
33
- dynamic-plugins.default.yaml
4+
# Writable path in the init container for extensions plugin configuration.
5+
- /dynamic-plugins-root/dynamic-plugins.extensions.yaml
46

57
plugins:
68
# Tech Radar frontend plugin
@@ -52,3 +54,41 @@ plugins:
5254
toolTip: "RHDH Documentation"
5355
to: "https://docs.redhat.com/en/documentation/red_hat_developer_hub/"
5456
visibleOnPaths: ["/"]
57+
58+
#########################################################
59+
# Enable dynamic plugins installation by using Extensions
60+
#########################################################
61+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace
62+
disabled: false
63+
pluginConfig:
64+
dynamicPlugins:
65+
frontend:
66+
red-hat-developer-hub.backstage-plugin-marketplace:
67+
translationResources:
68+
- importName: marketplaceTranslations
69+
ref: marketplaceTranslationRef
70+
module: Alpha
71+
appIcons:
72+
- name: pluginsIcon
73+
importName: PluginsIcon
74+
dynamicRoutes:
75+
- path: /extensions
76+
importName: DynamicMarketplacePluginRouter
77+
menuItem:
78+
icon: pluginsIcon
79+
text: Extensions
80+
textKey: menuItem.extensions
81+
menuItems:
82+
extensions:
83+
parent: default.admin
84+
85+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic
86+
disabled: false
87+
pluginConfig:
88+
extensions:
89+
installation:
90+
enabled: true
91+
saveToSingleFile:
92+
# NOTE: the path needs to be writable by the main RHDH container user
93+
file: /opt/app-root/src/dynamic-plugins-root/dynamic-plugins.extensions.yaml
94+
########## End Extensions #################################

default.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ BASE_URL=http://localhost:7007
1515
#AUTH_GITHUB_CLIENT_ID=
1616
#AUTH_GITHUB_CLIENT_SECRET=
1717

18+
# Node environment for extensions plugin installation
19+
NODE_ENV=development
20+
1821
# Disable TLS certificate validation (development only)
1922
NODE_TLS_REJECT_UNAUTHORIZED=0
2023

141 KB
Loading

docs/rhdh-local-guide/configuration.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,22 @@ Common variables to customize:
6262

6363
After making configuration changes:
6464

65-
```bash
66-
# For app-config changes
67-
podman compose stop rhdh && podman compose start rhdh
68-
69-
# For plugin changes
70-
podman compose run install-dynamic-plugins
71-
podman compose stop rhdh && podman compose start rhdh
72-
```
65+
=== "Podman (Recommended)"
66+
```bash
67+
# For app-config changes
68+
podman compose restart rhdh
69+
70+
# For plugin changes
71+
podman compose run install-dynamic-plugins
72+
podman compose restart rhdh
73+
```
74+
75+
=== "Docker"
76+
```bash
77+
# For app-config changes
78+
docker compose restart rhdh
79+
80+
# For plugin changes
81+
docker compose run install-dynamic-plugins
82+
docker compose restart rhdh
83+
```

docs/rhdh-local-guide/dynamic-plugins-management.md

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
The dynamic plugin system in RHDH enables you to add, remove, enable, and disable plugins without rebuilding the container. This provides incredible flexibility for testing different plugin combinations and developing custom plugins locally.
22

3+
## Managing Plugins from the UI
4+
5+
By default, RHDH Local enables the built-in **Extensions** feature that lets you browse, install, and configure plugins directly from the RHDH web interface, without any need to manually edit YAML files for basic plugin management.
6+
7+
!!! warning "Local Development Only"
8+
The UI-based plugin management feature is enabled by default with RHDH Local for development and testing purposes. **This functionality is not recommended in production environments.** In production, plugin management should be handled through proper configuration management and deployment pipelines.
9+
10+
### Why a Restart is Required
11+
12+
When you install or uninstall a plugin through the UI, you're changing which code RHDH needs to load. The restart ensures that:
13+
14+
- New plugin code is downloaded and made available
15+
- The backend services can load the new functionality
16+
- Configuration changes are properly applied across all services
17+
18+
Without a restart, your changes won't take effect because the running instance is still using the previous set of loaded plugins.
19+
20+
### How to Restart RHDH Local
21+
22+
After making plugin changes through the UI, restart your local instance with these commands:
23+
24+
=== "Podman (Recommended)"
25+
```bash
26+
# Reinstall plugins and restart RHDH
27+
podman compose run install-dynamic-plugins
28+
podman compose restart rhdh
29+
```
30+
31+
=== "Docker"
32+
```bash
33+
# Reinstall plugins and restart RHDH
34+
docker compose run install-dynamic-plugins
35+
docker compose restart rhdh
36+
```
37+
38+
This process typically may take a few minutes. You can monitor the startup progress in the container logs:
39+
40+
=== "Podman (Recommended)"
41+
```bash
42+
podman compose logs -f rhdh
43+
```
44+
45+
=== "Docker"
46+
```bash
47+
docker compose logs -f rhdh
48+
```
49+
50+
### Example: Installing the TODO Plugin
51+
52+
Let's walk through installing a simple plugin to try out the UI-based management feature.
53+
54+
**[TODO](https://github.com/backstage/community-plugins/tree/main/workspaces/todo)** is a plugin that scans your repository code and displays all TODO, FIXME, and similar comments in one place. It's a great plugin to test with because it requires minimal configuration and provides immediate, practical value.
55+
56+
1. **Open the Extensions page**: Navigate to **Administration****Extensions** in the RHDH sidebar
57+
2. **Find the TODO plugin**: Use the search bar to find "TODO" or browse the available plugins
58+
3. **Install the plugin**: Click on the TODO plugin and follow the installation prompts. The UI will then warn that a backend restart is required, like so:
59+
![Extensions page showing "Backend restart required" warning after installing the TODO plugin](../images/dynamic-plugins-extensions-restart-required.png)
60+
4. **Restart RHDH Local**: Run the restart commands shown above
61+
5. **Verify the installation**: After restart, navigate to a component entity page and you should see a new "TODO" section in the entity Overview that lists any TODO comments found in the related repository, if any.
62+
63+
To uninstall, simply return to the Extensions page, find the installed plugin, and remove it; then restart again.
64+
365
## Configuration File Location
466

567
Plugin configuration is managed through `configs/dynamic-plugins/dynamic-plugins.override.yaml` or `configs/dynamic-plugins/dynamic-plugins.yaml` if the former does not exist.
@@ -134,26 +196,41 @@ podman compose up -d
134196
135197
# Reinstall plugins without clearing other data
136198
podman compose run install-dynamic-plugins
137-
podman compose stop rhdh && podman compose start rhdh
199+
podman compose restart rhdh
138200
```
139201
140202
## Applying Plugin Changes
141203
142204
### Standard Plugin Changes
143205
144-
After modifying the plugin configuration:
206+
After modifying the plugin configuration, for example after configuring plugins using the Extensions in the RHDH UI:
145207
146-
```bash
147-
# Reinstall plugins and restart RHDH
148-
podman compose run install-dynamic-plugins
149-
podman compose stop rhdh && podman compose start rhdh
150-
```
208+
=== "Podman (Recommended)"
209+
```bash
210+
# Reinstall plugins and restart RHDH
211+
podman compose run install-dynamic-plugins
212+
podman compose restart rhdh
213+
```
214+
215+
=== "Docker"
216+
```bash
217+
# Reinstall plugins and restart RHDH
218+
docker compose run install-dynamic-plugins
219+
docker compose restart rhdh
220+
```
151221
152222
### Quick Restart (No Plugin Changes)
153223
154224
For configuration-only changes:
155225
156-
```bash
157-
# Just restart RHDH (if plugins haven't changed)
158-
podman compose stop rhdh && podman compose start rhdh
159-
```
226+
=== "Podman (Recommended)"
227+
```bash
228+
# Just restart RHDH (if plugins haven't changed)
229+
podman compose restart rhdh
230+
```
231+
232+
=== "Docker"
233+
```bash
234+
# Just restart RHDH (if plugins haven't changed)
235+
docker compose restart rhdh
236+
```

docs/rhdh-local-guide/loading-content.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ After modifying `app-config.local.yaml`:
3737
=== "Podman (Recommended)"
3838
```bash
3939
# Restart RHDH to load new configuration
40-
podman compose stop rhdh && podman compose start rhdh
40+
podman compose restart rhdh
4141
```
4242

4343
=== "Docker"
4444
```bash
4545
# Restart RHDH to load new configuration
46-
docker compose stop rhdh && docker compose start rhdh
46+
docker compose restart rhdh
4747
```
4848

4949
## Troubleshooting

prepare-and-install-dynamic-plugins.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,20 @@ else
5151
echo "No .npmrc found, skipping NPM_CONFIG_USERCONFIG"
5252
fi
5353

54+
DYNAMIC_PLUGINS_EXTENSIONS_FILE="/dynamic-plugins-root/dynamic-plugins.extensions.yaml"
55+
if [ ! -f "$DYNAMIC_PLUGINS_EXTENSIONS_FILE" ]; then
56+
echo "$DYNAMIC_PLUGINS_EXTENSIONS_FILE does not exist - creating it to enable dynamic plugins installation by using Extensions..."
57+
cat <<EOF > "$DYNAMIC_PLUGINS_EXTENSIONS_FILE"
58+
includes:
59+
- dynamic-plugins.default.yaml
60+
61+
plugins: []
62+
EOF
63+
# The file needs to be writable by the main RHDH container user.
64+
# Otherwise, the extensions backend plugin will not be able to save the dynamic plugins configuration
65+
chown 1001 "$DYNAMIC_PLUGINS_EXTENSIONS_FILE"
66+
echo '... file '$DYNAMIC_PLUGINS_EXTENSIONS_FILE' created!'
67+
fi
68+
5469
echo "Running install-dynamic-plugins.sh"
55-
./install-dynamic-plugins.sh /dynamic-plugins-root
70+
./install-dynamic-plugins.sh /dynamic-plugins-root

0 commit comments

Comments
 (0)