Skip to main content

Show Codacy on a component

Each annotated component shows its Codacy grade on its overview, and its issues in a tab. The card of Administration β€Ί Plugins says: An entity's Codacy grade on its overview, its issues in a tab.

Two steps: turn on the plugin, annotate the component.

1. πŸ”Œ Turn on the plugin​

  1. In Administration, under PLATFORM, click Plugins.

  2. On the Codacy card, click the switch Enable Codacy.

The switch is greyed out?

If the card says Configure the Codacy integration first, click it: the integration opens in Company connections. Add it (Add the Codacy integration). The plugin turns on by itself when you save the integration: go to step 2.

2. 🏷️ Annotate the component​

In the component's catalog-info.yaml, name the repository as Codacy knows it: the Codacy provider (gh for GitHub, gl for GitLab, bb for Bitbucket), the organization, then the repository.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: shop-api
annotations:
codacy.com/project-slug: gh/acme/shop-api
spec:
type: service
lifecycle: production
owner: group:default/platform-team

βœ… Check​

Wait a few minutes for the catalog to read the file, then open the component from Catalog. Without the annotation, the component has no Codacy card on its overview and no Codacy tab. With the annotation, the card and the tab show the grade and the issues. This part was not checked on a live instance.

βœ… That's it!