Skip to content

Status.plugins name - #4248

Open
gazarenkov wants to merge 4 commits into
redhat-developer:mainfrom
gazarenkov:status.plugins-name
Open

gazarenkov wants to merge 4 commits into
redhat-developer:mainfrom
gazarenkov:status.plugins-name

Conversation

@gazarenkov

@gazarenkov gazarenkov commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Description

Fix information disclosure in status.plugins
Changes status.plugins to display plugin names only instead of full package URLs.

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

https://redhat.atlassian.net/browse/RHIDP-19505

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

Container Images

Container images are built and pushed to Quay automatically when relevant files change.
Image links will be posted in a PR comment once the push completes.

@gazarenkov
gazarenkov requested a review from a team as a code owner December 1, 2026 10:48
@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Show plugin names instead of package URLs in status.plugins

🐞 Bug fix 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• status.plugins now lists plugin names via DynaPlugin.Name() instead of raw package URLs,
 closing an information disclosure.
• Removes the admin doc step that asked users to verify transformed URLs in status.plugins, and
 the matching sentence.
• Plugin names are still sorted, so the list order is unchanged.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • Fault-specific containment limits risk to the originating changed behavior.
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, status entries copied each enabled plugin package reference.
  • After, each entry uses the existing Name parser and is sorted.
  • The changed correctness condition is that status output must represent each enabled package consistently across the parser's supported OCI, HTTP, local-path, and multi-plugin formats; no new state interaction, algorithm, concurrency, or coordinated invariant is introduced.
Sources

pkg/model/dynamic-plugins-reference.go[183-190]

func (p *DynaPlugin) Name() string {
	packageURL := p.Package

	// If !plugin-path present, return it as the plugin name
	// Use first ! to split, in case selector itself contains !
	if idx := strings.Index(packageURL, "!"); idx != -1 {
		return packageURL[idx+1:]
	}
Potential damage 🟢 Low 🩹 Cosmetic

  • Conservative damage bound for the originating changed behavior; downstream capabilities remain contained.
  • A parsing mismatch can make the Backstage CR status display an empty or different plugin name while the enabled plugin continues to run.
  • No persistent plugin or runtime state is changed by this calculation.
  • The status is recomputed during later reconciliation, and reverting the code restores the prior representation; no data repair or external compensation is required.
Sources

pkg/model/dynamic-plugins-reference.go[183-190]

func (p *DynaPlugin) Name() string {
	packageURL := p.Package

	// If !plugin-path present, return it as the plugin name
	// Use first ! to split, in case selector itself contains !
	if idx := strings.Index(packageURL, "!"); idx != -1 {
		return packageURL[idx+1:]
	}
Assessed commit 9935635
Diagram

graph TD
  A["Backstage Model"] --> B["GetEnabledPlugins"] --> C["DynaPlugin.Name()"] --> D["setEnabledPlugins"] --> E["Backstage CR status.plugins"]
Loading
High-Level Assessment

Reusing the existing DynaPlugin.Name() helper is the right fix. It already handles OCI digests and tags, !plugin-path selectors, and tarball and local paths, so no new parsing logic is needed. Alternatives such as redacting the URL with a regex or adding a separate display field were dismissed as duplicating existing logic. Note for reviewers: consumers that read status.plugins expecting full package URLs will see a breaking change in the field's contents.

Files changed (2) +1 / -8

Bug fix (1) +1 / -1
backstage_status.goWrite plugin names instead of package URLs to status +1/-1

Write plugin names instead of package URLs to status

• setEnabledPlugins now appends p.Name() rather than p.Package when building the status.plugins list. The list is still sorted, so the output order is unchanged. This prevents full OCI and registry URLs from being exposed in the CR status.

internal/controller/backstage_status.go

Documentation (1) +0 / -7
admin.mdRemove status.plugins URL verification step and related sentence +0/-7

Remove status.plugins URL verification step and related sentence

• Deletes the step that told admins to check transformed URLs in status.plugins with kubectl and jq. Also removes the sentence stating that transformed URLs are visible under status.plugins, since the field no longer exposes them.

docs/admin.md

@gazarenkov
gazarenkov requested a review from kim-tsao December 1, 2026 10:48
@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo


Action required

Nice, no open findings for this group


Remediation recommended

Nice, no open findings for this group


Informational

Nice, no open findings for this group


@rhdh-qodo-merge

Copy link
Copy Markdown

Important

The /generate_labels command by Qodo was deprecated on the 1st of October 2026 and is no longer available. We recommend switching to the latest Qodo review capabilities. Learn more

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

✅ PR images built and pushed successfully!

Images are available for testing (expires in 7 days):

Image Full tag PR tag
Operator quay.io/rhdh-community/operator:2.2.0-pr-4248-24acb64 quay.io/rhdh-community/operator:2.2.0-pr-4248
Bundle quay.io/rhdh-community/operator-bundle:2.2.0-pr-4248-24acb64 quay.io/rhdh-community/operator-bundle:2.2.0-pr-4248
Catalog quay.io/rhdh-community/operator-catalog:2.2.0-pr-4248-24acb64 quay.io/rhdh-community/operator-catalog:2.2.0-pr-4248

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 65.08%. Comparing base (39b66c3) to head (9935635).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/backstage_status.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4248   +/-   ##
=======================================
  Coverage   65.08%   65.08%           
=======================================
  Files          52       52           
  Lines        3282     3282           
=======================================
  Hits         2136     2136           
  Misses       1146     1146           
Flag Coverage Δ
unittests 65.08% <0.00%> (ø)

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

Files with missing lines Coverage Δ
internal/controller/backstage_status.go 64.70% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/admin.md Resolved
Comment thread docs/admin.md
@@ -125,12 +124,6 @@ data:
kubectl rollout restart deployment rhdh-operator -n rhdh-operator
```

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.

With operator dynamic-plugin processing enabled (OPERATOR_DP_PROCESSING=true), confirm mirrored OCI package URLs in the Backstage dynamic-plugins ConfigMap (packages.txt)

kubectl get configmap backstage-dynamic-plugins-<cr-name> -n <namespace> \
  -o jsonpath='{.data.packages\.txt}{"\n"}'

Suggestion to replace the deleted "verify" step

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Co-authored-by: Kim Tsao <84398375+kim-tsao@users.noreply.github.com>
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

✅ PR images built and pushed successfully!

Images are available for testing (expires in 7 days):

Image Full tag PR tag
Operator quay.io/rhdh-community/operator:2.2.0-pr-4248-05ff35e quay.io/rhdh-community/operator:2.2.0-pr-4248
Bundle quay.io/rhdh-community/operator-bundle:2.2.0-pr-4248-05ff35e quay.io/rhdh-community/operator-bundle:2.2.0-pr-4248
Catalog quay.io/rhdh-community/operator-catalog:2.2.0-pr-4248-05ff35e quay.io/rhdh-community/operator-catalog:2.2.0-pr-4248

@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

✅ PR images built and pushed successfully!

Images are available for testing (expires in 7 days):

Image Full tag PR tag
Operator quay.io/rhdh-community/operator:2.2.0-pr-4248-9935635 quay.io/rhdh-community/operator:2.2.0-pr-4248
Bundle quay.io/rhdh-community/operator-bundle:2.2.0-pr-4248-9935635 quay.io/rhdh-community/operator-bundle:2.2.0-pr-4248
Catalog quay.io/rhdh-community/operator-catalog:2.2.0-pr-4248-9935635 quay.io/rhdh-community/operator-catalog:2.2.0-pr-4248

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants