feat(extensions): add source metadata to entities - #3939
feat(extensions): add source metadata to entities#3939christoph-jerolimov wants to merge 10 commits into
Conversation
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
…ing extensions Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…w catalog-source annotation gots automatically added Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
|
Preparing PR labels... |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3939 +/- ##
=======================================
Coverage 57.35% 57.35%
=======================================
Files 2384 2384
Lines 95608 95617 +9
Branches 26699 26704 +5
=======================================
+ Hits 54832 54841 +9
- Misses 39238 39239 +1
+ Partials 1538 1537 -1
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
73fba50 to
c165b09
Compare
|



This is a copy of #3711 where GitHub didn't updated the PR and now didn't let me reopen it because I force pushed the last 4 commits into your @hopehadfield branch. Normally this works fine. So here is a follow-up. You're work lgtm, Hope. -- I changes some configurations and moved the plugins yamls so that they are picked up now in the included Backstage app by the catalog-extensions-module.
From the origin PR:
Hey, I just made a Pull Request!
Resolves RHIDP-13665 / Epic RHIDP-13606
Problem
When RHDH is configured with multiple catalog index images (
CATALOG_INDEX_IMAGE+EXTRA_CATALOG_INDEX_IMAGES), theinstall-dynamic-pluginsinit container extracts entities from each image into separate directories. However, onceBaseEntityProvideringests them into the Backstage catalog, all source information is lost with the current implementation.Solution
Add an
extensions.backstage.io/catalog-sourceannotation that is automatically derived from the on-disk directory layout and set on every entity emitted byBaseEntityProvider.The derivation logic:
extra/<name>/catalog-entities/…getcatalog-source: "<name>"(matching the name fromEXTRA_CATALOG_INDEX_IMAGES)catalog-source: "primary"Changes
extensions-common/src/annotations.tsCATALOG_SOURCEtoExtensionsAnnotationenumcatalog-backend-module-extensions/src/providers/BaseEntityProvider.tsderiveCatalogSource()static method; updateaddProviderAnnotations()to set the annotation using the entity's file pathcatalog-backend-module-extensions/src/providers/BaseEntityProvider.test.tsdocs/catalog/plugins.mdcatalog-backend-module-extensions/README.mdHow to test
Unit tests:
Local dev (manual):
extensions.directoryinapp-config.yamlto point at itDesign decisions
"primary"as default. Vendor-neutral. The UI/config layer can map it to a display label as desired.EXTRA_CATALOG_INDEX_IMAGES(community=quay.io/...).BaseEntityProvider, so Plugins, Packages, and Collections all get the annotation.✔️ Checklist