Skip to main content

Gerrit Discovery

The Gerrit integration has a special entity provider for discovering catalog entities from Gerrit repositories. The provider uses the "List Projects" API in Gerrit to get a list of repositories and will automatically ingest all catalog-info.yaml files stored in the root of the matching projects.


As this provider is not one of the default providers, you will first need to install the Gerrit provider plugin:

# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-catalog-backend-module-gerrit

Then add the plugin to the plugin catalog packages/backend/src/plugins/catalog.ts:

/* packages/backend/src/plugins/catalog.ts */
import { GerritEntityProvider } from '@backstage/plugin-catalog-backend-module-gerrit';
import { Duration } from 'luxon';
const builder = await CatalogBuilder.create(env);
/** ... other processors and/or providers ... */
GerritEntityProvider.fromConfig(env.config, {
logger: env.logger,
// optional: alternatively, use scheduler with schedule defined in app-config.yaml
schedule: env.scheduler.createScheduledTaskRunner({
frequency: { minutes: 30 },
timeout: { minutes: 3 },
// optional: alternatively, use schedule
scheduler: env.scheduler,


To use the discovery processor, you'll need a Gerrit integration set up. Then you can add any number of providers.

# app-config.yaml
yourProviderId: # identifies your dataset / provider independent of config changes
branch: master # Optional
query: 'state=ACTIVE&prefix=webapps'
schedule: # optional; same options as in TaskScheduleDefinition
# supports cron, ISO duration, "human duration" as used in code
frequency: { minutes: 30 }
# supports ISO duration, "human duration" as used in code
timeout: { minutes: 3 }
branch: master # Optional
query: 'state=ACTIVE&prefix=backend'

The provider configuration is composed of three parts:

  • host: the host of the Gerrit integration to use.
  • branch (optional): the branch where we will look for catalog entities (defaults to "master").
  • query: this string is directly used as the argument to the "List Project" API. Typically, you will want to have some filter here to exclude projects that will never contain any catalog files.