Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/devlake-dora-metrics-initial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@backstage-community/plugin-devlake': minor
'@backstage-community/plugin-devlake-backend': minor
'@backstage-community/plugin-devlake-common': minor
---

Add DevLake DORA Metrics plugin for Backstage

Introduces a new community plugin that surfaces Apache DevLake DORA metrics in Backstage:

- `DoraMetricsPage`: full-page dashboard with team selector, time range presets, metric cards, and trend charts
- `EntityDoraCard`: compact entity card for the catalog, annotated via `devlake.io/project-name`
- Backend plugin with direct MySQL queries against DevLake's domain layer tables
- New Frontend System (NFS) extension points via `/alpha` entry point
- Optional Grafana deep-link per entity via `devlake.grafana.baseUrl` app-config
8 changes: 8 additions & 0 deletions workspaces/devlake/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in the readme](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
7 changes: 7 additions & 0 deletions workspaces/devlake/.changeset/add-devlake-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@backstage-community/plugin-devlake': minor
'@backstage-community/plugin-devlake-backend': minor
'@backstage-community/plugin-devlake-common': minor
---

Added new DevLake workspace with DORA Metrics plugins. Includes a frontend dashboard page with metric cards and trend charts, a backend plugin that proxies Apache DevLake API, and a common package with shared DORA types and level classifiers.
14 changes: 14 additions & 0 deletions workspaces/devlake/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"privatePackages": {
"tag": false,
"version": false
}
}
8 changes: 8 additions & 0 deletions workspaces/devlake/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.yarn/cache
.yarn/install-state.gz
node_modules
packages/*/src
packages/*/node_modules
plugins
*.local.yaml
2 changes: 2 additions & 0 deletions workspaces/devlake/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
playwright.config.ts
types/
1 change: 1 addition & 0 deletions workspaces/devlake/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../.eslintrc.cjs');
54 changes: 54 additions & 0 deletions workspaces/devlake/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# macOS
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Coverage directory generated when running tests with coverage
coverage

# Dependencies
node_modules/

# Yarn 3 files
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Node version directives
.nvmrc

# dotenv environment variables file
.env
.env.test

# Build output
dist
dist-types

# Temporary change files created by Vim
*.swp

# MkDocs build output
site

# Local configuration files
*.local.yaml

# Sensitive credentials
*-credentials.yaml

# vscode database functionality support files
*.session.sql

# E2E test reports
e2e-test-report/
6 changes: 6 additions & 0 deletions workspaces/devlake/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
dist-types
coverage
.vscode
.eslintrc.js
knip-report.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions workspaces/devlake/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins:
- checksum: b3b00465cee9a55ea92b7555876084a6dbfb4b9dd2ce7617a0bca1c138dec6b33befabdff7f4035b2a2ad70d59a05dad3a8faf3a34d3bec21fa7949a497fdf48
path: .yarn/plugins/@yarnpkg/plugin-backstage.cjs
spec: 'https://versions.backstage.io/v1/releases/1.48.2/yarn-plugin'
3 changes: 3 additions & 0 deletions workspaces/devlake/backstage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "1.48.2"
}
5 changes: 5 additions & 0 deletions workspaces/devlake/bcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"autoVersionBump": true,
"knipReports": true,
"listDeprecations": true
}
65 changes: 65 additions & 0 deletions workspaces/devlake/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@internal/devlake",
"version": "1.0.0",
"private": true,
"engines": {
"node": "22 || 24"
},
"scripts": {
"start": "backstage-cli repo start",
"tsc": "tsc",
"tsc:full": "tsc --skipLibCheck false --incremental false",
"build:all": "backstage-cli repo build --all",
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"new": "backstage-cli new --scope @backstage-community",
"build:api-reports": "yarn build:api-reports:only --tsc",
"build:api-reports:only": "backstage-repo-tools api-reports -o ae-wrong-input-file-type,ae-undocumented --validate-release-tags",
"build:knip-reports": "backstage-repo-tools knip-reports",
"postinstall": "cd ../../ && yarn install"
},
"workspaces": {
"packages": [
"packages/*",
"plugins/*"
]
},
"repository": {
"type": "git",
"url": "https://github.com/backstage/community-plugins",
"directory": "workspaces/devlake"
},
"devDependencies": {
"@backstage/cli": "backstage:^",
"@backstage/e2e-test-utils": "backstage:^",
"@backstage/repo-tools": "backstage:^",
"@changesets/cli": "^2.27.1",
"knip": "^5.27.4",
"node-gyp": "^10.0.0",
"prettier": "^2.3.2",
"typescript": "~5.3.0"
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18",
"csstype@npm:^3.0.2": "3.0.9",
"csstype@npm:^3.1.2": "3.0.9",
"csstype@npm:^3.1.3": "3.0.9"
},
"prettier": "@backstage/cli/config/prettier",
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md}": [
"prettier --write"
]
}
}
7 changes: 7 additions & 0 deletions workspaces/devlake/plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DevLake Plugins

This directory contains the plugins for the DevLake workspace.

- `devlake` - Frontend plugin for displaying DORA metrics dashboard
- `devlake-backend` - Backend plugin for proxying DevLake API requests
- `devlake-common` - Shared types and utilities
1 change: 1 addition & 0 deletions workspaces/devlake/plugins/devlake-backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
76 changes: 76 additions & 0 deletions workspaces/devlake/plugins/devlake-backend/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export interface Config {
/** Configuration options for the DevLake plugin */
devlake?: {
/**
* PostgreSQL connection settings for DevLake's database.
*
* @visibility backend
*/
db: {
/**
* Database host.
*/
host: string;

/**
* Database port. Defaults to 3306.
*/
port?: number;

/**
* Database user.
*/
user: string;

/**
* Database password.
*
* @visibility secret
*/
password: string;

/**
* Database name.
*/
database: string;

/**
* Use SSL connection. Defaults to false.
*/
ssl?: boolean;
};

/**
* Team-to-DevLake project mappings.
*
* @visibility frontend
*/
teams?: Array<{
/**
* Display name of the team.
*/
name: string;

/**
* The corresponding project name in DevLake.
*/
devlakeProjectName: string;
}>;
};
}
9 changes: 9 additions & 0 deletions workspaces/devlake/plugins/devlake-backend/knip-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Knip report

## Unused devDependencies (2)

| Name | Location | Severity |
| :--------------------------------------------------- | :---------------- | :------- |
| @backstage/plugin-auth-backend-module-guest-provider | package.json:50:6 | error |
| @backstage/plugin-auth-backend | package.json:49:6 | error |

59 changes: 59 additions & 0 deletions workspaces/devlake/plugins/devlake-backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "@backstage-community/plugin-devlake-backend",
"version": "0.1.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin",
"pluginId": "devlake",
"pluginPackages": [
"@backstage-community/plugin-devlake",
"@backstage-community/plugin-devlake-backend",
"@backstage-community/plugin-devlake-common"
]
},
"homepage": "https://backstage.io",
"repository": {
"type": "git",
"url": "https://github.com/backstage/community-plugins",
"directory": "workspaces/devlake/plugins/devlake-backend"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack",
"clean": "backstage-cli package clean"
},
"dependencies": {
"@backstage-community/plugin-devlake-common": "workspace:^",
"@backstage/backend-defaults": "backstage:^",
"@backstage/backend-plugin-api": "backstage:^",
"@backstage/config": "backstage:^",
"@types/express": "*",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"mysql2": "^3.11.0"
},
"devDependencies": {
"@backstage/backend-test-utils": "backstage:^",
"@backstage/cli": "backstage:^",
"@backstage/plugin-auth-backend": "backstage:^",
"@backstage/plugin-auth-backend-module-guest-provider": "backstage:^",
"@types/supertest": "^6.0.0",
"supertest": "^7.0.0"
},
"files": [
"dist",
"config.d.ts"
],
"configSchema": "config.d.ts"
}
25 changes: 25 additions & 0 deletions workspaces/devlake/plugins/devlake-backend/report.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## API Report File for "@backstage-community/plugin-devlake-backend"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { Config } from '@backstage/config';
import express from 'express';
import { LoggerService } from '@backstage/backend-plugin-api';

// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;

// @public
const devlakePlugin: BackendFeature;
export default devlakePlugin;

// @public (undocumented)
export interface RouterOptions {
// (undocumented)
config: Config;
// (undocumented)
logger: LoggerService;
}
```
Loading
Loading