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

[bulk-import][UI] "YAMLException (expected a single document in the stream, but found more)" if catalog-info.yaml PR is updated with multiple Components

Prepare for Y ReleasePrepare for Z ReleaseRemove QuarterXMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • 1.3
    • Bulk Import Plugin
    • None
    • RHDH F&UI plugins 3262

      Description of problem:

      I was trying to mimic a user who wants to tune theirĀ catalog-info.yaml file in the import PR by adding multiple Components to it. They edited the file outside of RHDH, but right from GitHub.

      After doing this, the import details can no longer be seen/edited from the Bulk Import page.

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

      -

      Steps to Reproduce

      1. Use the bulk import to create an import PR for a given repo
      2. Make sure the import status is "Waiting for approval", meaning there is a PR open for it
      3. Once the import PR is created, navigate to the PR page on GitHub
      4. On GH, edit the catalog-info.yaml in the PR and add a YAML multi-doc separator, e.g.:
      apiVersion: backstage.io/v1alpha1
      kind: Component
      metadata:
        name: flutter
        annotations:
          github.com/project-slug: lemra-org-ent-2/flutter
      spec:
        type: other
        lifecycle: unknown
        owner: user:default/rm3l
      ---
      • Go back to the Bulk Import listing page on RHDH
      • Next to the repo, click on the "Edit" icon

      => You should see the YAML error

      Actual results:

      Expected results:

      Maybe handle this error gracefully? Do not crash if there is a YAML parsing error, or if the number of documents is unexpected..

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      RHDH Version: 1.4.0
      Backstage Version: 1.29.2
      Last Commit: janus-idp/backstage-showcase/pull/1581 @ b7fc2d6
      Build Time: 2024-09-11T11:26:31Z

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

      Screencast attached.Screencast from 2024-09-11 14-00-27.mp4

      Stacktrace:

      YAMLException: expected a single document in the stream, but found more
          at Object.Re [as load] (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/api/scalprum/janus-idp.backstage-plugin-bulk-import/static/2101.0466438e.chunk.js:2:198098)
          at Re (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/api/scalprum/janus-idp.backstage-plugin-bulk-import/static/1502.9e04b2dc.chunk.js:1:19712)
          at Ri (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:14:16975)
          at ua (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:16:43763)
          at ta (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:16:39558)
          at Zc (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:16:39489)
          at ml (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:16:39348)
          at iu (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:16:35766)
          at bs (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:16:36567)
          at hn (https://backstage-my-rhdh-my-ns.apps.rosa.oi2pg-ijxw5-mzw.308j.p3.openshiftapps.com/static/3144.8649d27c.chunk.js:14:3267) 

        1. image-2024-09-11-14-24-29-378.png
          175 kB
          Armel Soro
        2. Screencast from 2024-09-11 14-00-27.mp4
          2.76 MB
          Armel Soro
        3. Screenshot from 2024-09-11 14-07-41.png
          175 kB
          Armel Soro

              dsantra12 Debsmita Santra
              rh-ee-asoro Armel Soro
              RHIDP - Frontend Plugins & UI
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: