feat: add custom processor module to add ScaffoldedFrom relation
Description
Adds a custom catalog processor that creates relations between catalog entities and the scaffolder templates that created them based on the spec.scaffoldedFrom field in the catalog-info.yaml of the catalog entities.
What issue(s) does this fix?
Fixes: RHIDP-2156
How to test changes / Special notes to the reviewer
- Install the module using the instructions in the README.md
- Ingest an entity with a
spec.scaffoldedFromfield that matches theentityRefof a template entity in the catalog (ex:template:default/test-template). You can potentially use the following example template: https://github.com/janus-idp/backstage-plugins/blob/main/plugins/scaffolder-annotator-action/examples/templates/01-scaffolder-template.yaml - Observe the relation graph of the entity in the catalog (or view the raw YAML/JSON of the entity and find the
scaffoldedFromrelation in therelationsarray)
/retest failing
@Zaperex: No presubmit jobs available for janus-idp/backstage-plugins@main
In response to this:
/retest failing
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/retest
/retest
Used in conjunction with https://github.com/janus-idp/backstage-plugins/pull/1567
/retest
Hmm that's weird, the template should have the reverse relation (scaffolderOf) in the dependency graph since it should appear in the relations field of it's Raw YAML. In the following, I tested with backstage-showcase when I dynamically installed it (after modifying the catalog such that the templates has a dependency graph). In my case, the ownedBy link did not appear in the dependency graph since the corresponding entity did not exist in the catalog. Could that have been the case for you?
Added usage docs with examples of expected outputs. You can try using this software template that contains the custom action that automatically applies this spec.scaffoldedFrom field to catalog entities: https://github.com/janus-idp/backstage-plugins/blob/main/plugins/scaffolder-annotator-action/examples/templates/01-scaffolder-template.yaml
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: PatAKnight
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [PatAKnight]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
It should work if you manually add it though (as long as the referenced template exists)? That's how I initially tested it before having the action.