Skip to content

generate default dynamic plugins and app-config plugins ConfigMaps - #3190

Merged
openshift-merge-bot[bot] merged 4 commits into
redhat-developer:mainfrom
gazarenkov:split-dp-config
Jul 16, 2026
Merged

generate default dynamic plugins and app-config plugins ConfigMaps#3190
openshift-merge-bot[bot] merged 4 commits into
redhat-developer:mainfrom
gazarenkov:split-dp-config

Conversation

@gazarenkov

@gazarenkov gazarenkov commented Jul 14, 2026

Copy link
Copy Markdown
Member

Description

If OPERATOR_DP_PROCESSING=true (default for make test and make run):

  • generate ConfigMap with enabled plugins list
  • generate app-config for enabled plugins

Which issue(s) does this PR fix or relate to

PR acceptance criteria

  • Tests
  • Documentation (intentionally, later)

How to test changes / Special notes to the reviewer

Run locally 'make install run' and create Backstage CR, look at backstage-appconfig-{cr-name}-plugins-appconfig and backstage-dynamic-plugins-{cr-name} ConfigMaps

Building Container Images for Testing

Need to test container images from this PR?

For Maintainers: To trigger a test image build, review the code and comment /build-images.
This always builds the HEAD of the PR branch.

For Contributors: Ask a maintainer to run /build-images.

Images will be built and pushed to Quay with links posted in comments.

@gazarenkov
gazarenkov requested a review from a team as a code owner July 14, 2026 13:46
@rhdh-qodo-merge

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again

Grey Divider

Qodo Logo

@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Generate dynamic-plugins and plugins app-config ConfigMaps when DP processing is enabled

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add OPERATOR_DP_PROCESSING switch to control operator-side dynamic plugin processing.
• Emit ConfigMaps for enabled plugin packages list and merged plugin app-config.
• Update unit/integration tests and local dev scripts for both processing modes.
Diagram

graph TD
  A[/"Backstage CR"/] --> B["DynamicPlugins model"] --> C[("Enabled plugins CM")]
  C --> D["DP init container"]
  A --> E["AppConfig model"] --> F[("Plugins app-config CM")]
  F --> G["Backstage main container"]

  subgraph Legend
    direction LR
    _cr[/"Custom Resource"/] ~~~ _cm[("ConfigMap") ] ~~~ _ct["Container"]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use a dedicated deep-merge library for YAML/JSON
  • ➕ Avoids custom map[interface{}]interface{} conversions and key type assertions
  • ➕ Typically handles edge cases (arrays, nulls, scalar-vs-map conflicts) more predictably
  • ➕ Reduces maintenance burden of merge semantics
  • ➖ Adds/expands dependencies and may increase operator binary size
  • ➖ May merge differently than desired without careful configuration/tests
2. Represent enabled plugin list/app-config in Backstage CR Status instead of ConfigMaps
  • ➕ Avoids extra ConfigMaps and related RBAC/watch churn
  • ➕ Makes derived state visible directly on the CR for debugging
  • ➖ Backstage workload still needs files mounted; would require additional translation step
  • ➖ Status size/format constraints; not ideal for large config blobs

Recommendation: The current approach (derive explicit ConfigMaps and mount them) fits Kubernetes-native configuration delivery and keeps Backstage consumption simple. If this logic grows (more complex config structures), consider switching the deep-merge implementation to a well-tested library to reduce edge-case risk; keep the current targeted tests to lock in merge behavior.

Files changed (8) +318 / -103

Enhancement (2) +153 / -33
appconfig.goGenerate merged plugins app-config ConfigMap from enabled plugins +88/-1

Generate merged plugins app-config ConfigMap from enabled plugins

• Adds generation of a 'plugins-appconfig' ConfigMap containing 'app-config.plugins.yaml' by deep-merging 'pluginConfig' from all enabled dynamic plugins. Prepends the generated ConfigMap to AppConfig’s ConfigMaps list and introduces recursive merge helpers handling yaml.v2 map types.

pkg/model/appconfig.go

dynamic-plugins.goEmit enabled plugins list ConfigMap and mount packages.txt when processing enabled +65/-32

Emit enabled plugins list ConfigMap and mount packages.txt when processing enabled

• When OPERATOR_DP_PROCESSING is enabled, computes the enabled plugin set, creates a ConfigMap containing 'packages.txt' (newline-separated packages), and returns/mounts that ConfigMap instead of the full dynamic-plugins.yaml. Also rehomes 'DynaPlugin.IsDisabled' and updates updateAndValidate to support the new mount path.

pkg/model/dynamic-plugins.go

Tests (4) +149 / -59
config-refresh_test.goReduce config-refresh test timeout +1/-1

Reduce config-refresh test timeout

• Cuts the Eventually timeout from 10 minutes to 5 minutes to keep integration runs tighter while preserving polling interval.

integration_tests/config-refresh_test.go

rhdh-config_test.goMake rhdh deployment assertions conditional on DP processing mode +75/-58

Make rhdh deployment assertions conditional on DP processing mode

• Adjusts integration assertions to account for operator-side DP processing: different init-container mounts and additional '--config'/volume mount for the generated plugins app-config when enabled.

integration_tests/rhdh-config_test.go

appconfig_test.goUnit tests for plugins app-config generation and deep merge +69/-0

Unit tests for plugins app-config generation and deep merge

• Adds coverage for 'addPluginsAppConfig': verifies no ConfigMap is created without pluginConfig and validates deep-merge behavior when yaml.v2-style maps are provided.

pkg/model/appconfig_test.go

dynamic-plugins-reference_test.goForce operator DP processing in reference-merge tests +4/-0

Force operator DP processing in reference-merge tests

• Sets OPERATOR_DP_PROCESSING=true in merge/reference unit tests to align expected behavior with the new operator-side processing mode.

pkg/model/dynamic-plugins-reference_test.go

Other (2) +16 / -11
MakefileMake OPERATOR_DP_PROCESSING configurable for test/integration/run +6/-3

Make OPERATOR_DP_PROCESSING configurable for test/integration/run

• Introduces OPERATOR_DP_PROCESSING (default true) and threads it through 'make test', 'make integration-test', and 'make run' so local workflows can exercise both operator DP modes.

Makefile

copy-local-dynamic-plugins.shSelect dynamic-plugins.yaml source based on OPERATOR_DP_PROCESSING +10/-8

Select dynamic-plugins.yaml source based on OPERATOR_DP_PROCESSING

• Extends the local copy helper to use 'local-test/dynamic-plugins.yaml' only when OPERATOR_DP_PROCESSING=true (and profile=rhdh); otherwise uses the default-config version. Adds clearer logging for which source is active.

hack/copy-local-dynamic-plugins.sh

@rhdh-qodo-merge rhdh-qodo-merge Bot added enhancement New feature or request Tests Bug fix labels Jul 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.63636% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.25%. Comparing base (3b5e5e5) to head (6e94ffa).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pkg/model/appconfig.go 88.67% 3 Missing and 3 partials ⚠️
pkg/model/dynamic-plugins.go 88.57% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3190      +/-   ##
==========================================
+ Coverage   62.57%   63.25%   +0.67%     
==========================================
  Files          38       38              
  Lines        2234     2316      +82     
==========================================
+ Hits         1398     1465      +67     
- Misses        695      706      +11     
- Partials      141      145       +4     
Flag Coverage Δ
nightly ?
unittests 63.25% <88.63%> (+0.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/model/dynamic-plugins.go 79.32% <88.57%> (-1.88%) ⬇️
pkg/model/appconfig.go 88.46% <88.67%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gazarenkov

Copy link
Copy Markdown
Member Author

/build-images

@github-actions

Copy link
Copy Markdown
Contributor

PR images built successfully!

Images are available for testing:

  1. Operator: quay.io/rhdh-community/operator:0.11.0-pr-3190-6e94ffa
  2. Bundle: quay.io/rhdh-community/operator-bundle:0.11.0-pr-3190-6e94ffa
  3. Catalog: quay.io/rhdh-community/operator-catalog:0.11.0-pr-3190-6e94ffa

Also available with PR number tag:

  • quay.io/rhdh-community/operator:0.11.0-pr-3190
  • quay.io/rhdh-community/operator-bundle:0.11.0-pr-3190
  • quay.io/rhdh-community/operator-catalog:0.11.0-pr-3190

Triggered by @gazarenkov

@rm3l

rm3l commented Jul 15, 2026

Copy link
Copy Markdown
Member

/agentic_review

@rhdh-qodo-merge

Copy link
Copy Markdown

Qodo is busy working

Check back in a few minutes. Qodo's code review agents are on it.

Grey Divider

Comment thread pkg/model/dynamic-plugins.go
@openshift-ci openshift-ci Bot added the lgtm label Jul 16, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 094197f into redhat-developer:main Jul 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants