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

`export-dynamic-plugin` fails to find dependencies nested deeper than one level in `node_modules`

Prepare for Y ReleasePrepare for Z ReleaseRemove QuarterXMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 1.4
    • 1.4, 1.5.0
    • Dynamic plugins
    • None
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      Previously, the CLI examined the dependencies of embedded packages during the export process to know if other packages should be embedded. One of the methods was calling {{require}} when the CLI encountered a built embedded package, which was the case when wrapping an existing plugin.

      This update changes the parent directory that the {{require}} uses from the monorepo root to the embedded package. Therefore, the dependent package found is the dependency that is most relevant to the embedded package.
      Show
      Previously, the CLI examined the dependencies of embedded packages during the export process to know if other packages should be embedded. One of the methods was calling {{require}} when the CLI encountered a built embedded package, which was the case when wrapping an existing plugin. This update changes the parent directory that the {{require}} uses from the monorepo root to the embedded package. Therefore, the dependent package found is the dependency that is most relevant to the embedded package.
    • Bug Fix
    • Done
    • RHDH Dynamic Plugins 3266

      Description of problem:

      The export-dynamic-plugin command encounters an issue when a required dependency is located more than one level deep within the node_modules directory structure. This commonly occurs when different plugins depend on varying versions of the same package. In such cases, the top-level node_modules might contain a version different from the one actually required by the plugin being exported.

      While the correct dependency version does exist deeper within the node_modules hierarchy (e.g., within the node_modules folder of another dependency), the export-dynamic-plugin command fails to locate it. This results in a failed export, even though the necessary dependency is present within the project.

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

      Steps to Reproduce:

      1. Create a Backstage project with a plugin that depends on package 'A' version 1.0.0.
      2. Add another plugin which depends on a different version of package 'A', for example 2.0.0. This will likely install it directly under node_modules, causing the version mismatch.
      3. Add another dependency package 'B' which depends on package 'A' version 1.0.0. Package 'B' would therefore have it's own package 'A' v1.0.0 located under node_modules/B/node_modules/A.
      4. Try to export the first plugin using the export-dynamic-plugin command.

      Actual results:

      The export-dynamic-plugin command fails to locate the required dependency version and throws an error, halting the export process.

      Expected results:

      The export-dynamic-plugin command should successfully locate and include the correct version of the dependency, regardless of its nesting level within the node_modules structure. The export should complete without errors.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

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

              stlewis_2 Stan Lewis
              pschultz@redhat.com Paul Schultz
              RHIDP - Dynamic Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: