feat(extensions): add source metadata to entities#3711
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>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
PR Summary by QodoDerive and attach catalog-source metadata to extension catalog entities
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
Context used 1. Unanchored extra path matching
|
Signed-off-by: Hope Hadfield <hhadfiel@redhat.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3711 +/- ##
=======================================
Coverage 54.55% 54.55%
=======================================
Files 2349 2349
Lines 89735 89741 +6
Branches 25135 25136 +1
=======================================
+ Hits 48953 48959 +6
Misses 40482 40482
Partials 300 300
*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:
|
|
Code review by qodo was updated up to the latest commit 800af80 |



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