Skip to main content

Getting Started with Scorecards

Introduction

Now that you have Catalog populated with Software Components Plugins enabled, let's create a scorecard utilizing the Catalog Datasource to monitor the existence of root fields and integrations via annotations within catalog-info.yaml metadata. Effectively tracking information within the catalog can serve as the initial step towards enforcing organizational engineering standards.

Register a Software Component

  1. Register a software component following the steps mentioned here, if you already have software components registered in your catalog you can move directly to create custom checks. Here's an example of catalog-info.yaml we will be using for this tutorial.
#Example
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: demo-service
description: pipeline build and deploy
annotations:
harness.io/project-url: https://app.harness.io/ng/account/vpCkHKsDSxK9_KYfjCTMKA/cd/orgs/default/projects/PREQA_NG_Pipelines/
jira/project-key: IDP
github.com/project-slug: Debanitrkl/backstage-test
backstage.io/techdocs-ref: url:https://github.com/backstage/backstage/tree/master/plugins/techdocs-backend/examples/documented-component
pagerduty.com/service-id: QWERTY
pagerduty.com/integration-key: ASDFGHJKL
tags:
- java

links:
- url: https://example.com/cloud
title: Link with Cloud Icon
icon: cloud
- url: https://example.com/dashboard
title: Dashboard
icon: dashboard
- url: https://example.com/help
title: Support
icon: help
- url: https://example.com/web
title: Website
icon: web
- url: https://example.com/alert
title: Alerts
icon: alert
spec:
type: service
lifecycle: experimental
owner: idp-dev

Create a Custom Check

You can skip this step if you want to use the default checks available and can start with creating a scorecard.

Pre-requisite

  1. Make sure you have the IDP Admin or IDP Platform Engineer role assigned to you with permissions to view, create and edit scorecards

Create a Check

  1. Go to Scorecards under Admin.
  2. Select Create Custom Check under Checks.

  1. Now we will be creating a custom check to check for Jira annotation.
  2. Add the Name and Description
  3. Now under Rules select All Of and the Datasource as Catalog Info YAML.
  4. Select the Datapoint as Evaluate expression (JEXL), and add the JEXL based on the jira annotation key mentioned on your catalog-info.yaml which would be <+metadata.annotations.'jira/project-key'>
  5. Now add the operator as Not equal to and add null under Value.
  6. Save the changes.

Create a Scorecard

Let's create a scorecard for catalog using the custom check we created above and some default checks available.

  1. Go to Scorecards and Create a New Scorecard.

  1. Now add the following default checks
    • Spec owner exists
    • Tech Docs exists
    • Pagerduty is setup

  1. Followed by the Custom Check Jira Check you created above, ignore this tep if you have skipped creating a custom check.

  1. For Filter catalog entities for which the scorecard is evaluated select the kind as Component and type all

  2. Now Publish the Scorecard.

  1. Go to your catalog and check for your software component you'll find the scores for catalog readinesss.

Next Steps

If you want to learn more on scorecards and track migrations using scorecards follow this tutorial.