JSPM

@jikwan/backstage-plugin-dora-scorecard-backend

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 147
  • Score
    100M100P100Q100301F
  • License Apache-2.0

Backend for Backstage DORA Scorecard plugin - collects and serves DORA metrics data

Package Exports

  • @jikwan/backstage-plugin-dora-scorecard-backend
  • @jikwan/backstage-plugin-dora-scorecard-backend/dist/index.cjs.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jikwan/backstage-plugin-dora-scorecard-backend) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

DORA Scorecard Plugin (Backend)

Backend plugin that collects DORA metrics from GitHub and serves them to the frontend.

Install

yarn add --cwd packages/backend @jikwan/backstage-plugin-dora-scorecard-backend

Register in Backend

// packages/backend/src/index.ts
import { createBackend } from '@backstage/backend-defaults';

const backend = createBackend();

backend.add(import('@jikwan/backstage-plugin-dora-scorecard-backend'));

backend.start();

Configuration

Add to app-config.yaml.

Option 1: Personal Access Token

doraMetrics:
  github:
    organizations:
      - your-org-name
    token: ${GITHUB_TOKEN}

  environments:
    production:
      - prd
      - prod
      - production

  labels:
    failureIssue: bug

  collection:
    intervalMinutes: 30
    initialDays: 30
    includeServices: []
    excludeServices: []

Option 2: GitHub App

integrations:
  github:
    - host: github.com
      apps:
        - appId: ${GITHUB_APP_ID}
          clientId: ${GITHUB_APP_CLIENT_ID}
          clientSecret: ${GITHUB_APP_CLIENT_SECRET}
          privateKey: |
            ${GITHUB_APP_PRIVATE_KEY}

doraMetrics:
  github:
    organizations:
      - your-org-name

  environments:
    production:
      - prd
      - prod
      - production

  labels:
    failureIssue: bug

  collection:
    intervalMinutes: 30
    initialDays: 30
    includeServices: []
    excludeServices: []

Service Requirements

Catalog entities must include one of these annotations:

metadata:
  annotations:
    github.com/project-slug: your-org/your-repo

or

metadata:
  annotations:
    backstage.io/source-location: url:https://github.com/your-org/your-repo

API

The plugin ID is dora-metrics, so clients should use Backstage discovery:

  • GET {baseUrl}/scorecard/:service?days=30
  • POST {baseUrl}/targets/:service

Example baseUrl in default Backstage setup is typically /api/dora-metrics.

Notes

  • Database migrations run automatically on startup.
  • Data sync runs on startup and then at collection.intervalMinutes.

License

Apache-2.0