Enable template synchronization using the scaffolder-relation-processor

Configure the scaffolder-relation-processor plugin to synchronize Software Template changes to downstream repositories.

Before you begin

  • You have added a custom Developer Hub application configuration.
  • You have configured GitHub or GitLab integrations in your RHDH app-config.yaml file.
  • Your scaffolded entities include the spec.scaffoldedFrom field referencing the source template.
  • Your entities include the backstage.io/managed-by-location annotation pointing to a valid GitHub or GitLab URL.

About this task

To automate the synchronization of changes from Software Templates to your repositories, you must configure the plugin in your backend settings and ensure that your entities contain the required metadata.

Procedure

  1. Enable the template sync and notification plugins in your RHDH dynamic-plugins.yaml file:
    plugins:
    # Enables the core template synchronization logic
      - package: ref://backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor
        enabled: true
    # Required only if you want to receive notifications for new pull requests
      - package: ref://backstage-plugin-notifications
        enabled: true
  2. Open your RHDH app-config.yaml file.
  3. Configure the pull request (PR) feature by adding the following configuration:
    scaffolder:
      pullRequests:
        templateUpdate:
          enabled: true
  4. Optional: Enable notifications to alert entity owners when a PR is created:
    scaffolder:
      notifications:
        templateUpdate:
          enabled: true
  5. Restart the Red Hat Developer Hub instance to apply the changes.

Results

  1. Update the version of a source template in its repository.
  2. Navigate to a repository scaffolded from that template.
  3. Confirm that a new pull request named [component-name]/template-upgrade-v[version] exists.