🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@janus-idp/backstage-plugin-catalog-backend-module-scaffolder-relation-processor

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@janus-idp/backstage-plugin-catalog-backend-module-scaffolder-relation-processor

The scaffolder-relation-processor backend module for the catalog plugin.

latest
Source
npmnpm
Version
1.3.2
Version published
Maintainers
0
Created
Source

âť—DEPRECATEDâť—

This package has been deprecated.

Please use the @backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor package instead.

Catalog Backend Module for Scaffolder Relation Catalog Processor

This is an extension module to the catalog-backend plugin, providing an additional catalog entity processor that adds a new relation that depends on the spec.scaffoldedFrom field to link scaffolder templates and the catalog entities they generated.

Getting Started

  • Install the scaffolder relation catalog processor module using the following command:

    yarn workspace backend add @janus-idp/backstage-plugin-catalog-backend-module-scaffolder-relation-processor
    

Installing on the new backend system

To install this module into the new backend system, add the following into the packages/backend/src/index.ts file:

const backend = createBackend();

// highlight-add-start
backend.add(
  import(
    '@janus-idp/backstage-plugin-catalog-backend-module-scaffolder-relation-processor/alpha'
  ),
);
// highlight-add-end

backend.start();

Installing on the legacy backend system

To install this module into the legacy backend system, add the following to the packages/backend/src/plugins/catalog.ts file:

// highlight-add-start
import { ScaffolderRelationEntityProcessor } from '@janus-idp/backstage-plugin-catalog-backend-module-scaffolder-relation-processor';

// highlight-add-end

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  const builder = await CatalogBuilder.create(env);

  /* ... other processors and/or providers ... */
  // highlight-add-start
  builder.addProcessor(new ScaffolderRelationEntityProcessor());
  // highlight-add-end

  const { processingEngine, router } = await builder.build();
  await processingEngine.start();

  return router;
}

Usage

Catalog entities containing the spec.scaffoldedFrom field will have a relation link be formed between it and the template corresponding to the entity ref in the spec.scaffoldedFrom field.

This link can be viewed in the relations field of the Raw YAML view of a catalog entity when inspecting an entity. In the entity with the spec.scaffoldedFrom field, the relation type is scaffoldedFrom with a target pointing to the value of the spec.scaffoldedFrom field. Conversely, for the target template, it will have a relation type of ScaffolderOf with a target pointing to the entity with the spec.scaffoldedFrom field.

These relations should also appear on the EntityCatalogGraphView component from the @backstage/plugin-catalog-graph package (only if the entity corresponding to the entity ref exists in the catalog).

Example graph view

scaffoldedFrom Relation Graph View scaffolderOf Relation Graph View

Example Raw YAML view

scaffoldedFrom Relation YAML View scaffoldedOf Relation YAML View

Keywords

support:tech-preview

FAQs

Package last updated on 16 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts