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

Introduce a CLI flag to relax version range checks on embedded transitive dependencies

Prepare for Y ReleasePrepare for Z ReleaseRemove QuarterXMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Dynamic plugins
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      Description of problem:

      When attempting to bump the @backstage/plugin-techdocs-backend version in our wrapper to 1.10.13 to fix RHIDP-4116 the following error is encountered when running export-dynamic-plugin:

      *$ janus-cli package export-dynamic-plugin --embed-package @backstage/plugin-techdocs-backend @backstage/plugin-search-backend-module-techdocs @backstage/plugin-techdocs-node --override-interop default --no-embed-as-dependencies
      Embeded package '@backstage/plugin-techdocs-node' is not part of direct dependencies. Are you sure you want to embed it ?
      Overriding Interop to 'default' for all imports
      Embedding module @backstage/plugin-search-backend-module-techdocs
      Embedding module @backstage/plugin-techdocs-backend
      Embedding module @backstage/plugin-techdocs-node
      Embedding module @backstage/plugin-techdocs-common
      
      Error: (plugin embed-modules) Error: Several incompatible versions ('^0.23.3', '^0.25.0') of the same transitive dependency ('@backstage/backend-common') for embedded module ('@backstage/plugin-techdocs-backend')
      

      This is because for this particular case the plugin-techdocs-backend package is a version that has been released with a later version of backstage with a newer backend-common version. The CLI rejects this minor version package dependency difference because historically these packages have not maintained semver semantics that well and often introduce breaking changes between minor versions.

      However as the upstream interfaces mature there's more chances for minor versions to be non-breaking as expected, and theoretically this version of plugin-techdocs-backend could work with the older backend-common dependency.

      To fix this, we should add a CLI flag that would allow the user to manually override this error on a per-package basis, for cases where the user is certain there is API compatibility between the discovered transitive dependency versions.

      Steps to Reproduce

      To see this, update this line on the release-1.3 to use 1.10.13, then do a yarn install/yarn build/yarn export-dynamic

            Unassigned Unassigned
            stlewis_2 Stan Lewis
            RHIDP - Dynamic Plugins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: