Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-2227

Problem with variable substitution in Dynamic Home page title when deploying with Helm

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 1.8.0
    • UI
    • 1
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      = Deployment update error with dynamic plugin configuration

      Updating the deployment configuration using the `values.yaml` to include specific dynamic plugin configurations might cause an error during the deployment process.

      When configuring the `dynamicRoutes` for the `red-hat-developer-hub.backstage-plugin-dynamic-home-page` plugin, the use of the placeholder {{firstName}} in a configuration property, for example title, can result in the following fatal deployment error:

      "function `firstName` not defined".

      This error prevents the cluster from spinning up correctly.

      .Configuration example
      [source,yaml]
      ----
      dynamicPlugins:
        frontend:
          red-hat-developer-hub.backstage-plugin-dynamic-home-page:
            dynamicRoutes:
              - path: /
                importName: DynamicHomePage
                config:
                  props:
                    title: 'Howdy {{firstName}} or {{displayName}}'
      ----
      Show
      = Deployment update error with dynamic plugin configuration Updating the deployment configuration using the `values.yaml` to include specific dynamic plugin configurations might cause an error during the deployment process. When configuring the `dynamicRoutes` for the `red-hat-developer-hub.backstage-plugin-dynamic-home-page` plugin, the use of the placeholder {{firstName}} in a configuration property, for example title, can result in the following fatal deployment error: "function `firstName` not defined". This error prevents the cluster from spinning up correctly. .Configuration example [source,yaml] ---- dynamicPlugins:   frontend:     red-hat-developer-hub.backstage-plugin-dynamic-home-page:       dynamicRoutes:         - path: /           importName: DynamicHomePage           config:             props:               title: 'Howdy {{firstName}} or {{displayName}}' ----
    • Known Issue
    • Done

      Description of problem:

      The 1.8 docs (vpn required) provides some example snippets that show how the title/subtitle can use variable substitution to insert the firstname or display name of a user entity. This syntax conflicts with Helm because it gets interpreted as template variables and fails with the following error on deployment:

      (https://docs.redhat.com/en/documentation/red_hat_developer_hub/)\\n*\n                  [Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/)\\n*\n                  [Backstage Community Plugins](https://github.com/backstage/community-plugins)\\n*\n                  [RHDH Plugins](https://github.com/redhat-developer/rhdh-plugins)\\n*\n                  [RHDH Showcase](https://github.com/redhat-developer/rhdh)                                                                 \\n\"\n                title: Important company links\n            importName: Markdown\n            mountPoint: home.page/cards\n- disabled: false\n  package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-floating-action-button\n- disabled: false\n  package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header\n- disabled: false\n  package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-quickstart": template: gotpl:76: function "firstName" not defined
      

      See Slack thread for further details

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

      Steps to Reproduce

      1. Deploy using a Helm chart
      2. Follow the doc instructions and add the pluginConfig for the Dynamic Home Page
                dynamicPlugins:
                  frontend:
                    red-hat-developer-hub.backstage-plugin-dynamic-home-page:
                      dynamicRoutes:
                        - path: /
                          importName: DynamicCustomizableHomePage
                          config:
                            props:
                              title: 'Howdy {{firstName}} or {{displayName}}'            
      

      Actual results:

      Deployment fails, see error above

      Expected results:

      RHDH is successfully deployed and title displays the firstName and displayName
      If this is a limitation, we should get this documented as a Known Issue

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      1.8

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

              Unassigned Unassigned
              ktsao@redhat.com Kim Tsao
              RHIDP - Frontend Plugins & UI
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: