Uploaded image for project: 'Red Hat Internal Developer Platform'
  1. Red Hat Internal Developer Platform
  2. RHIDP-5607

Dynamic plugin default configuration couldn't be partially changed

    • 5
    • False
    • Hide

      None

      Show
      None
    • False
    • Moderate

      User Story

      As RHDH administrator, I want to be able to be forced to copy the whole default plugin config, I want to only configure options that I need to change and leave the rest to be loaded from dynamic-plugins.default.yaml, so when the default config changes the new defaults are automatically picked. 

       

       

       

      This was created as a bug, below is the original report:

      Description of problem:

      This is a follow-up on RHDHBUGS-161 based on the issues to change the entity tab name there.

      The backstage configuration allows customers to specify multiple configuration files. Their configuration files are "merged" in one configuration. This merge allows customers to extend or override some options while reusing the defaults from another 'bigger' app-config.yaml.

      For dynamic plugins the dynamic-plugins.default.yaml is automatically loaded.

      To enable a plugin, customers can specify just this plugin and switch disabled: true to disabled false.

      For example in the helm chart:

      global:
        dynamic:
          plugins:
            - package: ./dynamic-plugins/dist/backstage-community-plugin-topology
              disabled: false
      

      But when the customer also includes the pluginConfig.dynamicPlugins configuration, the standard merge process isn't used.

      As an example, to change the tab name "Topology" this configuration should be enough:

      global:
        dynamic:
          plugins:
            - package: ./dynamic-plugins/dist/backstage-community-plugin-topology
              disabled: false
              pluginConfig:
                dynamicPlugins:
                  frontend:
                    backstage-community.plugin-topology:
                      entityTabs:
                        - path: /topology
                          title: Changed Topology Tab Name
                          mountPoint: entity.page.topology
      

      But for some reason, and I think that's an issue, it's also required to specific also all moint points like here:

      global:
        dynamic:
          plugins:
            - package: ./dynamic-plugins/dist/backstage-community-plugin-topology
              disabled: false
              pluginConfig:
                dynamicPlugins:
                  frontend:
                    backstage-community.plugin-topology:
                      entityTabs:
                        - path: /topology
                          title: Topology Test
                          mountPoint: entity.page.topology
                      mountPoints:
                      - mountPoint: entity.page.topology/cards
                        importName: TopologyPage
                        config:
                          layout:
                            gridColumn: "1 / -1"
                            height: 75vh
                          if:
                            anyOf:
                              - hasAnnotation: backstage.io/kubernetes-id
                              - hasAnnotation: backstage.io/kubernetes-namespace
      

      This duplication requires then that the customer updates these mount points on each new RHDH release which is really "tricky".

      Prerequisites (if any, like setup, operators/versions):

      Tested on RHDH 1.3 and 1.4, YAML looks a bit different due Janus IDP => backstage refactoring. See examples below.

      Steps to Reproduce

      1. Create a RHDH via Helm chart with the 2nd Yaml above.
      2. Create a Component that enables the topology with the annotations mentioned in the 3rd Yaml.
      3. Verify that the Topology Tab name is changed but the Card isn't displayed.

      Actual results:

      The tab is shown but the topology card is not visible with the 2nd Yaml.

      It appears when the user also applies the mount point definition.

      Expected results:

      The tab and the topology should already be displayed with the 2nd Yaml.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      1.3 and 1.4 also if they use different plugin identifiers.

      1.3:

      global:
        dynamic:
          plugins:
            - package: ./dynamic-plugins/dist/janus-idp-backstage-plugin-topology
              disabled: false
              pluginConfig:
                dynamicPlugins:
                  frontend:
                    janus-idp.backstage-plugin-topology:
                      entityTabs:
                        - path: /topology
                          title: Changed Topology Tab Name
                          mountPoint: entity.page.topology
                      mountPoints:
                        - mountPoint: entity.page.topology/cards
                          importName: TopologyPage
                          config:
                            layout:
                              gridColumn: "1 / -1"
                              height: 75vh
                            if:
                              anyOf:
                                - hasAnnotation: backstage.io/kubernetes-id
                                - hasAnnotation: backstage.io/kubernetes-namespace
      

      1.4:

      global:
        dynamic:
          plugins:
            - package: ./dynamic-plugins/dist/backstage-community-plugin-topology
              disabled: false
              pluginConfig:
                dynamicPlugins:
                  frontend:
                    backstage-community.plugin-topology:
                      entityTabs:
                        - path: /topology
                          title: Changed Topology Tab Name
                          mountPoint: entity.page.topology
                      mountPoints:
                        - mountPoint: entity.page.topology/cards
                          importName: TopologyPage
                          config:
                            layout:
                              gridColumn: "1 / -1"
                              height: 75vh
                            if:
                              anyOf:
                                - hasAnnotation: backstage.io/kubernetes-id
                                - hasAnnotation: backstage.io/kubernetes-namespace
      

      Additional info (Such as Logs, Screenshots, etc):

      Demo helm charts:

      1. https://github.com/christoph-jerolimov/rhdh-helm-charts/tree/main/bugs/rhdhbugs-161
      2. https://github.com/christoph-jerolimov/rhdh-helm-charts/tree/main/bugs/rhidp-5607-1.3
      3. https://github.com/christoph-jerolimov/rhdh-helm-charts/tree/main/bugs/rhidp-5607-1.4

              Unassigned Unassigned
              cjerolim Christoph Jerolimov
              RHIDP - Dynamic Plugins
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: