Skip to content

Allow enabling Orchestrator plugin on rhdh - #1297

Merged
openshift-merge-bot[bot] merged 15 commits into
redhat-developer:mainfrom
gazarenkov:merge-plugins-config
Jul 1, 2025
Merged

Allow enabling Orchestrator plugin on rhdh #1297
openshift-merge-bot[bot] merged 15 commits into
redhat-developer:mainfrom
gazarenkov:merge-plugins-config

Conversation

@gazarenkov

@gazarenkov gazarenkov commented Jun 23, 2025

Copy link
Copy Markdown
Member

Description

NOTE: it depends on redhat-developer/rhdh#3016 (will be in draft until merge 3016)

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

https://issues.redhat.com/browse/RHIDP-7919

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

To test:

  • make plugin-infra install run
  • oc create namespace backstage
  • oc apply -f examples/orchestrator.yaml -n backstage
    Then:
  • make sure all 4 related pods are started on backstage namespace,
  • get url from the route and go there
  • make sure Orchestrator link is workable

Summary by Sourcery

Enable Orchestrator plugin on Red Hat Developer Hub by switching to Red Hat npm package references, refining dynamic plugin configuration, and updating related manifests, documentation, and tests.

Enhancements:

  • Switch dynamic plugin package references to @redhat/backstage-plugin-orchestrator npm coordinates for frontend and backend modules.
  • Remove deprecated dynamic-plugins-npmrc and registry-auth secret volume mounts across deployment and bundle configurations.
  • Update NPM_CONFIG_USERCONFIG environment variable to reference the nested .npmrc file under .npmrc.dynamic-plugins.
  • Add a Secret manifest for dynamic-plugins-npmrc in the default profile configuration.

Documentation:

  • Clarify enabling Orchestrator plugin via npm.registry.redhat.com and update example configuration.

Tests:

  • Update TestDefaultMultiSecretEnv to assert that generated secret names use the expected 'backstage-envs-' prefix.

Chores:

  • Bump createdAt timestamps in CSV manifests.
  • Remove unused IsOpenShift field in operator controller setup.

Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
# Conflicts:
#	bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Files changed in bundle and installer generation!

Those changes to the operator bundle/installer manifests should have been pushed automatically to your PR branch.

NOTE: If the PR checks are stuck after this additional commit, manually close the PR and immediately reopen it to trigger the checks again.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces changes that enable the Orchestrator plugin for RHDH by updating plugin package names, configuration, and related documentation.

  • Updated plugin package references in YAML configurations and examples.
  • Modified environment variable and volume mount settings to support the new plugin setup.
  • Updated autogenerated code and configuration files to reflect the new plugin configurations.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/model/secretenvs_test.go Added test to verify secret environment variable naming.
examples/orchestrator.yaml Updated plugin package references to use npm registry names.
docs/dynamic-plugins.md Updated documentation with additional guidance for enabling the Orchestrator plugin.
config/profile/rhdh/default-config/secret-files.yaml Added new secret configuration for dynamic plugins.
config/profile/rhdh/default-config/dynamic-plugins.yaml Replaced URL plugins with npm package references.
config/profile/rhdh/default-config/deployment.yaml Adjusted environment variable and volume mount configuration for secret files.
cmd/main.go Removed an unused commented configuration line.
bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml Updated dynamic plugins configuration and image reference.
bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml Updated metadata timestamp.
api/v1alpha*/zz_generated.deepcopy.go Standardized import aliasing for API versions.

Comment thread config/profile/rhdh/default-config/deployment.yaml
Comment thread bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml Outdated
@gazarenkov
gazarenkov marked this pull request as ready for review June 27, 2025 17:43
@openshift-ci
openshift-ci Bot requested a review from subhashkhileri June 27, 2025 17:44
@sourcery-ai

sourcery-ai Bot commented Jun 27, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR refactors the way the Orchestrator plugin is enabled by switching plugin package references to scoped npm artifacts, removing inline secret mounts and updating NPM config paths across manifests, introducing a standalone Secret manifest for npmrc injection, updating documentation and operator metadata, and applying minor code and test cleanups.

Flow diagram for plugin package resolution and secret injection

flowchart TD
  A[User enables Orchestrator plugin in config]
  B[Backstage deployment starts]
  C[dynamic-plugins-npmrc Secret mounted]
  D[.npmrc config available in container]
  E[Plugins fetched from npm.registry.redhat.com]
  F[Orchestrator plugin enabled]

  A --> B --> C --> D --> E --> F
Loading

File-Level Changes

Change Details Files
Switch dynamic plugins to npm registry packages
  • Replaced GitHub tgz URLs and integrity fields with @redhat/backstage-plugin-…@1.5.1 package references
examples/orchestrator.yaml
bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml
dist/rhdh/install.yaml
config/profile/rhdh/default-config/deployment.yaml
config/profile/rhdh/default-config/dynamic-plugins.yaml
Clean up dynamic plugin secret mounts and update NPM config path
  • Removed dynamic-plugins-npmrc and registry-auth secret volumes and mounts
  • Updated NPM_CONFIG_USERCONFIG to point to "/.npmrc.dynamic-plugins/.npmrc"
bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml
dist/rhdh/install.yaml
config/profile/rhdh/default-config/deployment.yaml
Add standalone Secret manifest for npmrc
  • Introduced secret-files.yaml defining dynamic-plugins-npmrc Secret with mount annotations
  • Included placeholder comments for registry-auth secret
config/profile/rhdh/default-config/secret-files.yaml
Update dynamic plugins documentation
  • Reworded dynamic-plugins.md to explain npm registry usage
  • Clarified the example reference for enabling Orchestrator
docs/dynamic-plugins.md
Bump operator CSV createdAt timestamps
  • Updated createdAt fields in both backstage-operator ClusterServiceVersions
bundle/backstage.io/manifests/backstage-operator.clusterserviceversion.yaml
bundle/rhdh/manifests/backstage-operator.clusterserviceversion.yaml
Minor code and test cleanups
  • Removed unused IsOpenShift flag in controller setup
  • Added assertion in secretenvs_test.go to verify secret env naming
cmd/main.go
pkg/model/secretenvs_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @gazarenkov - I've reviewed your changes - here's some feedback:

  • Consider extracting the orchestrator plugin version string into a shared variable or generator so you don’t have to manually bump it across all of the YAMLs.
  • Remove the leftover commented-out IsOpenShift line in cmd/main.go and the placeholder block in secret-files.yaml to keep the codebase clean.
  • Double-check that the updated NPM_CONFIG_USERCONFIG path (/opt/app-root/src/.npmrc.dynamic-plugins/.npmrc) is correctly wired into all deployment profiles and any build/install scripts.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the orchestrator plugin version string into a shared variable or generator so you don’t have to manually bump it across all of the YAMLs.
- Remove the leftover commented-out `IsOpenShift` line in cmd/main.go and the placeholder block in secret-files.yaml to keep the codebase clean.
- Double-check that the updated NPM_CONFIG_USERCONFIG path (/opt/app-root/src/.npmrc.dynamic-plugins/.npmrc) is correctly wired into all deployment profiles and any build/install scripts.

## Individual Comments

### Comment 1
<location> `docs/dynamic-plugins.md:72` </location>
<code_context>
 - scaffolder-backend-module
-See [example](/examples/orchestrator.yaml) for a complete configuration of the orchestrator plugin.

+These plugins are located in npm.registry.redhat.com NPM registry and included to the RHDH default.dynamic-plugins.yaml configuration file, so to enable Orchestrator a user should just enable them along with Sonataflow dependency.
+See [example](/examples/orchestrator.yaml) for a configuration of the orchestrator plugin.

</code_context>

<issue_to_address>
Use 'included in' instead of 'included to', and add 'the' before 'Sonataflow dependency'.

The correct phrasing is: 'included in the RHDH default.dynamic-plugins.yaml configuration file, so to enable Orchestrator, a user should just enable them along with the Sonataflow dependency.'
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
These plugins are located in npm.registry.redhat.com NPM registry and included to the RHDH default.dynamic-plugins.yaml configuration file, so to enable Orchestrator a user should just enable them along with Sonataflow dependency.
=======
These plugins are located in npm.registry.redhat.com NPM registry and included in the RHDH default.dynamic-plugins.yaml configuration file, so to enable Orchestrator, a user should just enable them along with the Sonataflow dependency.
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/dynamic-plugins.md Outdated
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

⚠️ Files changed in bundle and installer generation!

Those changes to the operator bundle/installer manifests should have been pushed automatically to your PR branch.

NOTE: If the PR checks are stuck after this additional commit, manually close the PR and immediately reopen it to trigger the checks again.

@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

@rm3l rm3l closed this Jul 1, 2025
@rm3l rm3l reopened this Jul 1, 2025
@rm3l

rm3l commented Jul 1, 2025

Copy link
Copy Markdown
Member

Closed and reopened to retrigger the PR checks.

@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

@rm3l rm3l left a comment

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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Jul 1, 2025
@openshift-ci

openshift-ci Bot commented Jul 1, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Jul 1, 2025
@openshift-merge-bot
openshift-merge-bot Bot merged commit 6efea4a into redhat-developer:main Jul 1, 2025
7 checks passed
@gazarenkov
gazarenkov deleted the merge-plugins-config branch July 1, 2025 12:01
Fortune-Ndlovu pushed a commit to Fortune-Ndlovu/rhdh-operator that referenced this pull request Sep 6, 2025
* rhdh orchestrator config

Signed-off-by: gazarenkov <gazarenkov@gmail.com>

* back the image

Signed-off-by: gazarenkov <gazarenkov@gmail.com>

* fix docs

Signed-off-by: gazarenkov <gazarenkov@gmail.com>

* Regenerate bundle/installer manifests

Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>

* Update docs/dynamic-plugins.md

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* fix rhdh integration test

* fix config

* Regenerate bundle/installer manifests

Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>

* plugins registry docs placeholder

* revert dynamic-plugins-registry-auth with deprecation note

* Regenerate bundle/installer manifests

Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>

---------

Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants