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β
-
In Administration, under PLATFORM, click Plugins.
-
On the Codacy card, click the switch Enable Codacy.
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!